GNOME Bugzilla – Bug 575781
pyg_notify_free needs to ensure it has GIL before calling Py_XDECREF
Last modified: 2009-06-16 22:56:14 UTC
I'm getting a crash with this stack trace in rhythmbox: Program received signal SIGSEGV, Segmentation fault.
+ Trace 213581
Thread 3059951440 (LWP 23133)
$1 = (PyThreadState *) 0x0 which seems to be happening because I'm passing around a sax parser object as the user_data for async read operations. After the final read operation, it crashes. Adding another reference to the parser object stops it crashing, I guess because pyg_notify_free doesn't end up destroying it there. Wrapping the Py_XDECREF calls in pygio_notify_free with pyg_gil_state_ensure/pyg_gil_state_release also stops it crashing. I can't seem to find a way to trigger the same crash in the gio unit test suite.
Created attachment 130865 [details] [review] obvious patch
(In reply to comment #1) > Created an attachment (id=130865) [edit] > obvious patch Looks good.
OK to commit?
(In reply to comment #3) > OK to commit? > sure
2009-04-09 Jonathan Matthew <jonathan@d14n.org> Bug 575781 – pyg_notify_free needs to ensure it has GIL before calling Py_XDECREF * gio/gio.override: Ensure we're holding the GIL before potentially destroying the callback and data.
*** Bug 578637 has been marked as a duplicate of this bug. ***
Good thing we now have that decref in one place only ;)
*** Bug 581928 has been marked as a duplicate of this bug. ***
*** Bug 583678 has been marked as a duplicate of this bug. ***
*** Bug 583745 has been marked as a duplicate of this bug. ***
*** Bug 583827 has been marked as a duplicate of this bug. ***
*** Bug 583950 has been marked as a duplicate of this bug. ***
*** Bug 584549 has been marked as a duplicate of this bug. ***
*** Bug 584603 has been marked as a duplicate of this bug. ***
*** Bug 584798 has been marked as a duplicate of this bug. ***
*** Bug 585316 has been marked as a duplicate of this bug. ***
*** Bug 586039 has been marked as a duplicate of this bug. ***
*** Bug 586042 has been marked as a duplicate of this bug. ***