After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 585541 - Bus.AddWatch crashes on Windows
Bus.AddWatch crashes on Windows
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-sharp
git master
Other Windows
: Normal critical
: 0.9.3
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-12 10:09 UTC by Maarten Bosmans
Modified: 2010-02-23 00:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase for Bus.AddWatch (1.05 KB, text/plain)
2009-06-12 10:13 UTC, Maarten Bosmans
Details

Description Maarten Bosmans 2009-06-12 10:09:16 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 == &current_source_link)
Comment 1 Maarten Bosmans 2009-06-12 10:13:52 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2009-06-12 13:16:12 UTC
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?
Comment 3 Maarten Bosmans 2009-06-15 11:48:08 UTC
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
Comment 4 Sebastian Dröge (slomo) 2009-06-17 11:43:09 UTC
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).
Comment 5 Sebastian Dröge (slomo) 2009-06-17 11:50:05 UTC
If this didn't fix it could you get a backtrace from that assertion with gdb?
Comment 6 Sebastian Dröge (slomo) 2009-09-11 08:51:48 UTC
Maarten, any news on this?
Comment 7 Akhil Laddha 2009-12-04 04:56:00 UTC
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!
Comment 8 Sebastian Dröge (slomo) 2009-12-04 06:11:08 UTC
Maarten?
Comment 9 Maarten Bosmans 2009-12-04 08:05:31 UTC
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.
Comment 10 Maarten Bosmans 2009-12-07 23:09:12 UTC
Bug does not appear anymore with gstreamer-sharp git master.