[Mono-list] Help debugging program failing randomly

Danny dgortonii at gmail.com
Mon Apr 8 03:21:32 UTC 2013


I'm having a difficult time with an application I have written.  I 
recently made some changes and I'm having a problem with it failing at 
seemingly random times and locations (within the code), with sigsegv 
errors.  This is a multithreaded plugin-style daemon/service (can be 
launched from CLI) and I recently added a new component to it to poll a 
data acquisition board via USB using FTDI.

Almost all of our integrations like this use a shared library (or DLL on 
Windows) and p/invoke to access hardware.  I have done dozens of these 
integrations over USB without a persistent issue like this.  But still 
at first I suspected this new component, as I had initially thought it 
was trashing RAM because of the problems I had developing the shared library

However, at the same time as I made this addition, I was also (somewhat) 
forced to upgrade our base OS to the latest LTS Ubuntu 12.04 (was on 
10.04).  So unfortunately, I have more than one variable changing at a 
time.  So I confirmed, with a configuration that eliminates the newly 
developed component, that this problem occurs without that running.

That's good and bad, since now it seems likely that the offending code 
is out of my control.  I am hoping to get some information on the 
error(s) I was able to capture, or some advice on how to debug the root 
cause of this problem.

I have a couple of stack traces captured and I'll include what I believe 
is the crucial part of one here.  It's worth noting that not all of the 
stack traces are the same.  It's also worth noting that I have seen 
libgdiplus.so in other traces that I didn't get captured.

I tried setting up a 10.04 machine to test with, but one of our newer 
dependencies (ServiceStack) introduced a class that is not in the 
default mono on that platform, giving a startup error trying to resolve 
the IgnoreDataMemberAttribute class.  So I then got the latest mono set 
up on that machine now, but fear that this will result in the same error 
I am reporting (ie: I believe this to be a mono problem), since it 
should be the same mono framework running there.

Any help is greatly appreciated.

<snip - a bunch of standard output msgs from the service />


   at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipDeleteFont 
(intptr) <0xffffffff>
   at System.Drawing.Font.Dispose () <0x0002b>
   at (wrapper remoting-invoke-with-check) System.Drawing.Font.Dispose 
() <0xffffffff>
   at System.Drawing.Font.Finalize () <0x00013>
   at (wrapper runtime-invoke) 
object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intpt$

Native stacktrace:

         mono() [0x80e16fc]
         mono() [0x81209fc]
         mono() [0x806094d]

         /usr/lib/i386-linux-gnu/libfontconfig.so.1(+0x17b43) [0xb4b29b43]

         /usr/lib/libgdiplus.so.0(GdipDeleteFontFamily+0x132) [0xb5004642]
         /usr/lib/libgdiplus.so.0(GdipDeleteFont+0x2c) [0xb500510c]
         mono() [0x8150107]

<snip - 42 thread stack details>

Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.


More information about the Mono-list mailing list