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 159852 - [PATCH] [api] g_signal_emit thread safety issues
[PATCH] [api] g_signal_emit thread safety issues
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.8.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-29 15:26 UTC by Wim Taymans
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to lock iterate signal (914 bytes, patch)
2004-11-29 17:32 UTC, Wim Taymans
none Details | Review
don't lock in the iterate virtual method (2.25 KB, patch)
2004-11-29 17:58 UTC, Wim Taymans
none Details | Review
still use signal handler but unlock in bin iterate (2.03 KB, patch)
2004-12-20 18:47 UTC, Wim Taymans
none Details | Review

Description Wim Taymans 2004-11-29 15:26:29 UTC
testsuite/threads/signal2 shows the problem. This method of firing a signal and
calling a virtual function is used in the iterate method in gstbin.c, resulting
in weird assertions failing from time to time. Since this bug can only be
triggered in a small window, it is hard to reproduce.
Comment 1 Wim Taymans 2004-11-29 17:32:30 UTC
Created attachment 34282 [details] [review]
patch to lock iterate signal

This patch adds a recursive lock around the iterate signal to mask the problem.
Comment 2 Wim Taymans 2004-11-29 17:58:44 UTC
Created attachment 34284 [details] [review]
don't lock in the iterate virtual method

A slightly less intrusive patch that only locks around the signal emision but
not on the actual iterate function.
Comment 3 Benjamin Otte (Company) 2004-12-16 01:40:25 UTC
Both patches have a problem.
The first makes it so only one bin at a time can iterate which makes using
multiple threads kinda useless and the second breaks applications that use
post-signals to update the UI. I'm not sure there are any though, but I remember
telling people to use the iterate signal for that.
Comment 4 Thomas Vander Stichele 2004-12-20 18:29:22 UTC
running into this *a lot* with the ogg muxer and multiple input pads.  marking
as blocker.
Comment 5 Ronald Bultje 2004-12-20 18:42:21 UTC
Dude, you're suggesting to apply an incredibly invasive patch that has been
tested by one or two persons.
Comment 6 Wim Taymans 2004-12-20 18:47:18 UTC
Created attachment 35051 [details] [review]
still use signal handler but unlock in bin iterate

This patch still uses the signal emision to trigger the virtual function. The
lock is put around the signal emit to protect against unsafe glib refcounting
but the lock is released in the iterate_func. This should make multiple bins
iterate simultaneously.
Comment 7 Thomas Vander Stichele 2004-12-21 11:14:44 UTC
commited