[Mono-dev] P/Invoking a VS2012 C++ DLL, DLL behavior is materially different in 3.2.3 than in 3.1 and .net

Dennis Fantoni dennis at fantoni.dk
Fri Sep 27 07:53:58 UTC 2013


(running on windows 7)

In short, if I wrote this in a dll in .net or mono 3.1  i would get to “this shows”

void tester() {
try {
throw(foo);
cerr<<”this never shows”
}
ctch(...){
cerr<<”this shows”
}
}

However, in 3.2.3 above code when called via Pinvoke, will display “this never shows” , indicating that the data structures used by the exception system inside the DLL has been damaged by mono.

I have created two VS2012 sample solutions to create a C# dll caller, and a C++ callee that exposes the problem – and filed a bug

https://bugzilla.xamarin.com/show_bug.cgi?id=14989

If someone have the time to confirm or comment, I would be very pleased. If I am not mistaken it is a pretty severe bug – it might happen that any vs2012 c++ DLL that uses exceptions internally has ceased to work with mono on windows. (the problem might be bigger, I havent tried to build dll’s with VS2010 or other languages).

Anyways, I would expect mono to behave similar to .net, but it does not in this respect.

Regards,


Dennis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130927/5bc137df/attachment.html>


More information about the Mono-devel-list mailing list