[Mono-list] Embedding woes, Mono 2.4

Vitor Peres dodecaphonic at gmail.com
Sun May 17 09:29:31 EDT 2009


Hey guys,

I've been for the past couple of days hitting my head against the wall  
over a problem that I finally admit I can't figure out. I'm using mono  
as an extension platform for my C++ application, and everything seemed  
fine up until I started needing to call methods in various contexts  
(it wasn't fine for long, as you can see).

I have an extension manager that loads assemblies up and returns an  
object wrapping a MonoAssembly* which knows a little extra over paths,  
returns its image and so on -- simple sugar coating. I proceeded to  
build MonoMethodDescs, search for the methods and get up to  
mono_runtime_invoke, and invariably got a SIGSEGV. All the pointers  
were initialized and everything seemed fine, which baffled me all the  
gazillion times I stepped through in gdb, but I figured: "hey, I'm  
overengineering, let's do away with this wrapper altogether. Makes no  
sense, but I'm out of ideas". So I passed around the MonoAssembly* and  
get the same SIGSEGV's when invoking. Ok, consistent.
But then, to my utter puzzlement, I tried hardcoding the loading of  
the assembly in the scope it was supposed to be used, and invocation  
then worked perfectly.

I looked for references of a similar use in a similar context and  
found out that the guy responsible for Qyoto is doing pretty much the  
same thing I am, and there seem to be no special calls. Is there  
something I should be aware of regarding sharing a MonoAssembly*?

I'm using Mono 2.4 on Mac OS X Leopard and Ubuntu 9.04, the dmg  
version on the first and compiled from source in the second. I don't  
have access to my work computer right now, so I can't provide the more  
detailed stacktrace it's giving on Linux, but it fails on exactly the  
same place in both OS's.

If extra information of any type is needed, let me know. I'll try to  
provide it to my best capacity.

Thanks in advance,

--
Vitor Peres (dodecaphonic)
---------------------------------------------
http://unabridgedhaiku.com
http://sotellmegod.com
http://twitter.com/dodecaphonic

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090517/70e12444/attachment-0001.html 


More information about the Mono-list mailing list