if (!frame->managed)
return FALSE;
- *data = MONO_CONTEXT_GET_SP(ctx);
+ if (!ctx) {
+ // FIXME: Happens with llvm_only
+ *data = NULL;
+ return TRUE;
+ }
+
+ *data = MONO_CONTEXT_GET_SP (ctx);
g_assert (*data);
return TRUE;
}
gpointer sp = mono_thread_get_managed_sp ();
MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+ if (!sp)
+ return TRUE;
+
gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
if (above_threshold)
static gboolean handling_sigsegv = FALSE;
/*
- * mono_handle_native_sigsegv:
+ * mono_handle_native_crash:
*
- * Handle a SIGSEGV received while in native code by printing diagnostic
- * information and aborting.
+ * Handle a native crash (e.g. SIGSEGV) while in native code by
+ * printing diagnostic information and aborting.
*/
void
-mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
+mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
{
#ifdef MONO_ARCH_USE_SIGACTION
struct sigaction sa;
#endif
MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id);
- const char *signal_str = (signal == SIGSEGV) ? "SIGSEGV" : "SIGABRT";
if (handling_sigsegv)
return;
if (mini_get_debug_options ()->suspend_on_sigsegv) {
- mono_runtime_printf_err ("Received SIGSEGV, suspending...");
+ mono_runtime_printf_err ("Received %s, suspending...", signal);
#ifdef HOST_WIN32
while (1)
;
"a fatal error in the mono runtime or one of the native libraries \n"
"used by your application.\n"
"=================================================================\n",
- signal_str);
+ signal);
#ifdef MONO_ARCH_USE_SIGACTION
#else
void
-mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
+mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
{
g_assert_not_reached ();
}