[Mono-devel-list] Make MONO_DEBUG=abort-on-sigsegv sleep

Ben Maurer bmaurer at ximian.com
Thu Jun 30 17:45:13 EDT 2005


Hey,

I was just debugging something and found this patch really helpful:

Index: mini.c
===================================================================
--- mini.c      (revision 46783)
+++ mini.c      (working copy)
@@ -9658,7 +9658,9 @@
                if (!ji) {
                        fprintf (stderr, "Got SIGSEGV while in unmanaged code, and the 'abort-on-sigsegv' MONO_DEBUG option is set. Aborting...\n");
                        /* Segfault in unmanaged code */
-                       abort ();
+                       //abort ();
+
+                       sleep (1000);
                }
        }

I was having trouble debugging a process because it was so threaded gdb
could not run it by itself. However, I was never able to attach it when
it segfaulted. Sleeping gave me enough time to get to another terminal.

I wonder if this should be the default behavior, or possibly another
option...

-- Ben




More information about the Mono-devel-list mailing list