File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -342,6 +342,8 @@ void SetupCrashHandler()
342342#elif defined(__native_client__)
343343static void CrashHandler (const void * data, size_t n)
344344{
345+ // Note: this only works on the main thread. Otherwise we hit
346+ // Sys::Error("SendMsg from non-main VM thread");
345347 VM::CrashDump (static_cast <const uint8_t *>(data), n);
346348 Sys::Error (" Crashed with NaCl exception" );
347349}
Original file line number Diff line number Diff line change @@ -106,13 +106,16 @@ static char realErrorMessage[256];
106106void Sys::Error (Str::StringRef message)
107107{
108108 if (!OnMainThread ()) {
109- // On a non-main thread we can't rely on IPC, so we may not be able to communicate the
110- // error message. So try to trigger a crash dump instead (exiting with abort() triggers
111- // one but exiting with _exit() doesn't). This will give something to work with when
112- // debugging. (For the main thread case a message is usually enough to diagnose the problem
113- // so we don't generate a crash dump; those consume disk space after all.)
109+ // On a non-main thread we can't use IPC, so we can't communicate the error message. Just exit.
114110 // Also note that throwing ExitException would only work as intended on the main thread.
111+ #ifdef __native_client__
112+ // Don't abort, to avoid "nacl_loader.exe has stopped working" popup on Windows
113+ _exit (222 );
114+ #else
115+ // Trigger a core dump if enabled. Would give us something to work with since the
116+ // error message can't be shown.
115117 std::abort ();
118+ #endif
116119 }
117120
118121#ifdef __native_client__
You can’t perform that action at this time.
0 commit comments