[Mono-bugs] [Bug 381928] GLib crashes can hang mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Apr 21 17:37:34 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=381928

User dbera.web at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=381928#c10





--- Comment #10 from D Bera <dbera.web at gmail.com>  2008-04-21 15:37:34 MST ---
Great. I made some progress based on the pointer.
This is stacktrace I get with the try-catch. Incidentally, the try-catch
solution works for the simple test case but does not work everytime in beagle.
So there could be more things happening there.

Stacktrace:

  at (wrapper managed-to-native) GlibCrash.g_free (intptr) <0x00004>
  at (wrapper managed-to-native) GlibCrash.g_free (intptr) <0xffffffff>
  at GlibCrash.Main () <0x00020>
  at (wrapper runtime-invoke) GlibCrash.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono [0x816c4c7]
        [0xbfffe440]
        [0xbfffe410]
        /lib/i686/libc.so.6(gsignal+0x55) [0xb7cecec5]
        /lib/i686/libc.so.6(abort+0x101) [0xb7cee921]
        /lib/i686/libc.so.6 [0xb7d2383c]
        /lib/i686/libc.so.6(cfree+0x1bb) [0xb7d2f13b]
        /usr/lib/libglib-2.0.so.0(g_free+0x31) [0xb7eaa1b1]
        [0xb790b251]
        [0xb790b1be]
        mono(mono_runtime_exec_main+0xcd) [0x80d4b0d]

Notice how it goes into abort(), which causes the software signalling method
gsignal() which then moves back into mono (probably to mono's signal handler!).
Even though I see that prior to abort(), mono tries to set the signal handler
to SIG_DFL. I tried to use gdb to see which function 0x816c4c7 points to but
failed.

So I instead set the SIGABRT handler directly to SIG_DFL
Stdlib.SetSignalAction (Signum.SIGABRT, SignalAction.Default);
and was able to successfully crash the test program and beagle. Hint: please
take a second look at the code for resetting the SIGABRT handler.

Now with the default handler for SIGABRT I will definitely loose the nice
stacktrace. Is there anything else that I will loose. From mini.c, it seems
like SIGABRT is handled similarly as SIGSEGV. So both will now abort, which is
somewhat acceptable.

If this works, then I will probably set SIG_DFL for SIGABRT in beagle unless
--mono-debug is set.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list