This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: release GIL along all paths
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 13 Oct 2011 08:53:35 -0600
- Subject: FYI: release GIL along all paths
I'm checking this in.
I noticed that gdbpy_breakpoint_deleted can return early while still
holding the GIL. This is a bug. The fix is to ensure that the GIL is
released along all paths.
Tom
2011-10-13 Tom Tromey <tromey@redhat.com>
* python/py-breakpoint.c (gdbpy_breakpoint_deleted): Ensure GIL is
always released.
Index: python/py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-breakpoint.c,v
retrieving revision 1.25
diff -u -r1.25 py-breakpoint.c
--- python/py-breakpoint.c 5 Aug 2011 14:24:10 -0000 1.25
+++ python/py-breakpoint.c 13 Oct 2011 14:52:37 -0000
@@ -841,15 +841,15 @@
state = PyGILState_Ensure ();
bp = get_breakpoint (num);
- if (! bp)
- return;
-
- bp_obj = bp->py_bp_object;
- if (bp_obj)
+ if (bp)
{
- bp_obj->bp = NULL;
- --bppy_live;
- Py_DECREF (bp_obj);
+ bp_obj = bp->py_bp_object;
+ if (bp_obj)
+ {
+ bp_obj->bp = NULL;
+ --bppy_live;
+ Py_DECREF (bp_obj);
+ }
}
PyGILState_Release (state);
}