[Mono-dev] crashes in glib hangs (not exits) program

D Bera dbera.web at gmail.com
Mon Apr 21 11:27:39 EDT 2008

>  > "doing nothing". Hope I am clear this time. Looking at the stack trace
>  > I _think_ its just some bug in mono's after-crash-stacktrace-printer
>  > which is causing the problem. Mono's behaviour (and yours too) is
>  > absolutely right otherwise.
>  It's most likely the g_spawn* that gets the stack trace from gdb. You
>  may try to comment out the offending code in mini/mini-exceptions.c.
>  Perhaps we should couple the gdb stack trace with mono's --debug switch.
>  Or replace the g_spawn* call with plain libc calls...

Using libc methods instead of glib ones might work. But then again it
needs to be tested if a libc crash causes the same problem. Printing
the stacktrace only with --debug would be really bad in terms of
debugging but the current scenario is even worse.

For some reason, catching the "unmanaged exception" has the correct
behaviour even though it could be just a side effect. Zoltan pointed
out that unmanaged exceptions are not converted to exceptions in mono
even though the windows side seem to do it and recomment using
AppDomain.UnhandleException to log the crash before terminating. I am
not sure how they do it ... since the unmanaged exception could have
corrupted basic data structures so much that even the logging might

I am not in a state of building mono and testing the suggested
workaround but I would really appreciate the bug getting some
attention. In the mean time if someone can explain why catching the
exception seems to always work in mono, then I can publish a critical
release of beagle to workaround the problem (the problem in beagle
happens with a crash in evolution-sharp -> evolution-glue-native-lib).

Thanks a lot,
- dBera

Debajyoti Bera @ http://dtecht.blogspot.com
beagle / KDE fan
Mandriva / Inspiron-1100 user

More information about the Mono-devel-list mailing list