Help with Debuging Interop Code with Mono
Hi all,
I am currently trying to debug some code C# I have written. Its a wrapper around a native library (LibVorbis), I have it working on Windows with .net fine but when I run it on Mono it Seg Faults. At the moment I think its likely to be a bug in my code which windows tolerates and Linux doesn't.
I tried to find the problem by running my app in Valgrind. Unfortunately it produces a large number of false positives during normal operation with Mono, I assume Mono's GC confuses Valgrind. It also doesn't appear to show an obvious source of my problems.
This happens in the latest release of Mono. However recently I have switched to using a build I made from SVN and I have also built and installed the mono debugger. I have been using a recent SVN build of Mono Develop which includes its new debugger, both for Mono and Native code.
The Managed stack trace from where my code crashes seems to be completely random, so I assume its getting screwed up somewhere before it actually segfaults. However it always segfaults when the garbage collector is running the GC_mark_from function at line 724 of mark.c according to the Mono Develop debugger.
Can someone who's familiar with the Mono's GC tell me what its doing at this point. Also is it possible to figure out which structure / object is causing the GC problems. Any other suggestions would be greatly appreciated.
Charlie M