mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpiutil, hal] Crash on failure for SetupNowRio() and wpi::Now() when not configured (#6417)
This is an unrecoverable condition, so always terminate.
This commit is contained in:
@@ -594,6 +594,14 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
|
||||
});
|
||||
|
||||
if (!SetupNowRio()) {
|
||||
fmt::print(stderr,
|
||||
"Failed to run SetupNowRio(). This is a fatal error. The "
|
||||
"process is being terminated.\n");
|
||||
std::fflush(stderr);
|
||||
// Attempt to force a segfault to get a better java log
|
||||
*reinterpret_cast<int*>(0) = 0;
|
||||
// If that fails, terminate
|
||||
std::terminate();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user