Hi,
I am trying to implement a UPnP IGD (Internet Gateway
Device) compilant daemon using mono and the UPnP SDK from
Intel.
This SDK is using internal threading using pthreads an
notifies the host application of events through a registered C
style callback.
Every thing goes fine until the delegate is called from this
internally created thread. The program crashes with
unhandled exception. I've compiled the UPnP SDK using <gc/gc.h> to allow the GC to intecept the calls
to pthreads primitives, but this seems not to be
enough.
After a small investigation, I've discovered that the method
mono_get_domain is called from mono_jit_compile_method. All this is
directly called from a thread that has not been created the mono runtine, thus
not having any TLS containing the original domain.
The method mono_get_domain
returns a NULL pointer that causes the line :
(jit.c:3815)
jit_code_hash = target_domain->jit_code_hash;
to dereference a NULL pointer.
Am I missing something ? Should the mono runtime also
intercept any pthreads calls and how can this be done ?
Anyway, so far this is the only problem that prevents this SDK
from running from a mono hosted application.
Thanks,
Jerome
