[Mono-list] Mono embedding issue

Robert Jordan robertj at gmx.net
Tue Oct 10 09:00:45 EDT 2006


Hi Andreas,

Andreas Färber wrote:
>>> When embedding Mono 1.1.17.1 on OS X i386, I get an assertion failure
>>> in mono_jit_init:
>>> ** ERROR **: file threads.c: line 420 (mono_thread_attach): assertion
>>> failed: (thread_handle)
>>> aborting...
>> This basically means that io-layer's GetCurrentThread returned
>> NULL, which is completely nonsense because it always returns
>> a constant value != NULL.
>>
>> I suppose MacOS has its own GetCurrentThread function which gets
>> linked and called instead Mono's:
>>
>> http://bugzilla.ximian.com/show_bug.cgi?id=77324
> 
> I already read that bug report. It refers to _GetCurrentProcess as  
> opposed to GetCurrentThread.

Like GetCurrentProcess, GetCurrentThread is actually a Carbon function:

http://developer.apple.com/documentation/Carbon/Reference/Process_Manager/Reference/reference.html#//apple_ref/c/func/GetCurrentProcess
http://developer.apple.com/documentation/Carbon/Reference/Thread_Manager/Reference/reference.html#//apple_ref/c/func/GetCurrentThread

The proof by induction about why GetCurrentThread could fail as well,
is left as an exercise for the reader :-)

As suggested by bug #77324 (2006-03-10 16:38), you could try to
reference the Mono framework before Carbon:

	gcc  foo.c -framework Mono -framework Carbon -o ...

Robert



More information about the Mono-list mailing list