[Mono-dev] Interop Callback Segmentation fault

Ivan N. Zlatev contact at i-nz.net
Wed Jul 12 03:56:30 EDT 2006


It is a bug in mono indeed. I made a self-contained test and it worked
perfectly. Then I thought that it may be due to the fact Banshee loads
plugins/media engines dynamically (it is a xine backend for Banshee
what I am doing) and reproduced the way of loading the assembly and
executing the code, but again it worked. So at the moment I can tell
it only SEGFAULTs in Banshee, but still the code I use for the test
case and the banshee plugin is even the same assembly (I have the xine
library in xine-sharp.dll). Could I file a bug with the Banshee plugin
source code or? :s

On 7/11/06, Zoltan Varga <vargaz at gmail.com> wrote:
>                                     Hi,
>
>   This _might_ be a mono bug. Could you file a bug report and attach some
> kind of self-contained testcase (a xine dependency is ok) ?
>
>             Zoltan
>
> On 7/11/06, Ivan N. Zlatev <contact at i-nz.net> wrote:
> > Hey,
> >
> > I am on mono svn head and I get a segmentation fault when trying to
> > use this code:
> >
> > ===========================================
> > typedef void (*xine_event_listener_cb_t) (void *user_data,
> >                                           const xine_event_t *event);
> >
> > void xine_event_create_listener_thread (xine_event_queue_t *queue,
> >                                         xine_event_listener_cb_t callback,
> >                                         void *user_data);
> >
> > ===========================================
> >
> >                 [DllImport ("libxine")]
> >                 private static extern void
> > xine_event_create_listener_thread (IntPtr eventQueue, XineEventHandler
> > eventHandler, IntPtr data);
> >
> >                 public delegate void XineEventHandler (IntPtr data,
> > IntPtr eventArgs);
> >                 ...
> >                         eventQueue = xine_event_new_queue (_stream);
> >                         if (_eventQueue != IntPtr.Zero) {
> >                                 xine_event_create_listener_thread
> > (_eventQueue, HandleEvent, IntPtr.Zero);
> >                         }
> >                 ...
> >
> >                 private void HandleEvent (IntPtr data, IntPtr eventArgs)
> >                 {
> >                         Console.WriteLine ("Helllooo");
> >                 }
> > ===========================================
> >
> > This works when HandleEvent is static but else segfaults:
> >
> > (gdb) bt
> >
> > #0  0x08790f66 in ?? ()
> > #1  0xb4c72a8a in listener_loop (queue_gen=0x878d670) at events.c:209
> > #2  0xb7eda34b in start_thread () from /lib/libpthread.so.0
> > #3  0xb7e4465e in clone () from /lib/libc.so.6
> >
> > (gdb) p mono_pmip (0x08790f66)
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x0809603c in mono_jit_info_table_find (domain=0x0, addr=0x8790f66
> > "\022") at domain.c:173
> > 173             MonoJitInfoTable *table = domain->jit_info_table;
> >
> >
> > Any ideas what am I doing wrong or if it is a mono bug?
> >
> > --
> > Ivan N. Zlatev
> >
> > Web: http://www.i-nZ.net
> > GPG Key: http://files.i-nZ.net/i-nZ.asc
> > "It's all some kind of whacked out conspiracy."
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
>


-- 
Ivan N. Zlatev

Web: http://www.i-nZ.net
GPG Key: http://files.i-nZ.net/i-nZ.asc
"It's all some kind of whacked out conspiracy."



More information about the Mono-devel-list mailing list