GNOME Bugzilla – Bug 585541
Bus.AddWatch crashes on Windows
Last modified: 2010-02-23 00:30:28 UTC
When using Bus.AddWatch the application crashes. A workaround is to use Bus.AddSignalWatch together with Bus.Message. The error that is thrown is: GLib:ERROR:gmain.c:1817:g_main_dispatch: assertion failed: (current->dispatching_sources == ¤t_source_link)
Created attachment 136409 [details] Testcase for Bus.AddWatch This testcase exposes the bug. It sets op a trivial pipeline, the pipeline is set to the playing state and upon reaching that state, the mainloop is quit. The expected behaviour is to see a couple of messages, after which the programs quits. This behaviour is shown by replacing pipeline.Bus.AddWatch(new BusFunc(BusCb)); with the two commented-out lines directly below it. The actual behaviour is that the error mentioned in the bug description is thrown.
I can't reproduce this here on Linux... both variants work just fine :/ Could you check if a C version of this works for you on Windows?
I can't reproduce it in C. There the callback works as expected. It might have something to do with the comment about the performance hack on http://git.gnome.org/cgit/glib/tree/glib/gmain.c?h=glib-2-20#n1802 , as the failing assert is on line 1817. But it's not clear to me why the managed case would be different for this testcase and why it only appears on Windows (both .Net and Mono failed). If you have some pointers on where to look next, I'm happy to investigate further
Could you check if it works if you store the bus watch delegate in your main class? Maybe it gets GC'd at some point otherwise (the correct fix would be to handle it like all the Set*Function things in Gst.Pad).
If this didn't fix it could you get a backtrace from that assertion with gdb?
Maarten, any news on this?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!
Maarten?
Yeah, I let this one slide for a bit to long, sorry. Thanks for the ping though. If I remember correctly, I did try storing the delegate to prevent it from being GCed, but it didn't resolve the problem. Next I tried to get the backtrace, but the whole experience of debugging on Windows was very frustrating. As even compiling on Windows is rather frustrating and time-consuming, I switched to compiling on Linux with mingw. When that works out, I'll revisit the testcase with git master and let you know the results.
Bug does not appear anymore with gstreamer-sharp git master.