GNOME Bugzilla – Bug 469852
[upnp Coherence] crash upon activating plugin
Last modified: 2007-11-28 23:26:30 UTC
Just installed python-Coherence-0.4.0-1.fc7 from Fedora repository and attempted to activate the plugin while a "ushare" instance was running and got a crash immediately: Using host libthread_db library "/lib/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread -1208670496 (LWP 17434)] [New Thread -1232077936 (LWP 17445)] 0x00110402 in __kernel_vsyscall ()
+ Trace 157565
Thread 1 (Thread -1208670496 (LWP 17434))
Get the same crash even if no ushare instances are running, here is the console message it prints during the crash: WARN coherence Aug 24 03:04:58 Coherence UPnP framework version 0.4.0 starting... (coherence/base.py:156) rhythmbox: Python/pystate.c:610: PyGILState_Release: Assertion `oldstate == PyGILState_UNLOCKED' failed. Cannot access memory at address 0x445d
I believe I've seen the same errors with Epiphany Python (or were they Totem ones?) plugins, but I wouldn't swear by it.
I get the same crash, same output. Any ideas on what's going on?
*** Bug 477340 has been marked as a duplicate of this bug. ***
Breaking on PyGILState_Ensure and PyGILState_Release, I see: Breakpoint 2, 0x002cb306 in PyGILState_Ensure () from /usr/lib/libpython2.5.so.1.0 (gdb) bt
+ Trace 164190
And it will crash afterwards with the second release that doesn't have a matching ensure. PyGILState_Ensure doesn't seem to be called by pygobject!? Johan, ideas?
Looks like threads are being init'ed in pygobject in between the first call to ensure, and the release. Which would mean the first ensure doesn't get called, but the release is. I'm testing a patch now.
Created attachment 95914 [details] [review] rhythmbox-upnp-assert.patch That seems to fix it...
Packages for Fedora will be at: http://koji.fedoraproject.org/koji/taskinfo?taskID=167799
Seems to work fine, although I probably need a much newer Coherence for it to work with the PS3.
(In reply to comment #7) > Created an attachment (id=95914) [edit] > rhythmbox-upnp-assert.patch > > That seems to fix it... > Looks correct, thread support should be initialized as early as possible.
Patch fixes the crash, I think ready to apply to SVN trunk.
Apparently we might need to watch out for threading issues in the python bindings, but on the whole this improves the situation and doesn't seem to break anything else.
Committed to trunk and 0.10 branch 2007-10-10 Bastien Nocera <hadess@hadess.net> * plugins/rb-python-module.c: (rb_python_module_init_python): Fix crash when activating a Python plugin that uses threads, the UPNP plugin in this case (Closes: #469852)
*** Bug 439544 has been marked as a duplicate of this bug. ***
*** Bug 453583 has been marked as a duplicate of this bug. ***
*** Bug 479005 has been marked as a duplicate of this bug. ***