From: gnome-perl (bugzilla.gnome.o. <bug...@gn...> - 2012-02-19 14:39:30
|
https://bugzilla.gnome.org/show_bug.cgi?id=620099 gnome-perl | Glib | unspecified --- Comment #11 from Torsten Schoenfeld <kaf...@gm...> 2012-02-19 14:39:14 UTC --- (In reply to comment #10) > I managed to reproduce it in this small hang.pl script that simply play a file > given on the command line. > I tested this on a xubuntu 11.04, the hanging happens every time with the more > elaborated notify callback and with the line setting the volume to 1. If any of > these are removed, everything works correctly. I can reproduce the hang, and that's why I've been holding off on this patch for so long. The basic outline of this kind of hang is the following: • There are two threads involved: the main thread running the event loop and all Perl code, and an auxiliary thread constructed by gstreamer to manage the audio stream. • The call "$player->set(volume => 1)" reconfigures part of the pipeline and causes the auxiliary thread to change the "volume" property of the internal sink element while holding a lock. Among other things this triggers the "notify::volume" signal, for which we have a handler. But since this is in a non-main thread, the patch shovels the invocation over to the main loop and /blocks the auxiliary thread until the signal handler has returned/. • The signal handler calls get("volume") which ends up in the sink element's volume accessor, which also tries to acquire the lock mentioned above. Deadlock. A way to avoid the deadlock is to wrap in Glib::Idle->add those parts of the signal handler that access object properties: $player->signal_connect(notify => sub { my ($object,$property)=@_; Glib::Idle->add (sub { my $name=$property->get_name; warn "$object $name : ".$object->get($name)."\n"; Glib::SOURCE_REMOVE; }); }); Since this workaround exists, the patch fixes otherwise unsolvable problems while introducing new but solvable problems. So I'll try to get the patch into Glib today. -- Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. |