This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [ping] [patch] related_breakpoint stale ref crash fix
On Thu, 11 Feb 2010 20:17:05 +0100, Pedro Alves wrote:
> On Thursday 11 February 2010 15:25:51, Jan Kratochvil wrote:
> > 2009-12-23 ÂJan Kratochvil Â<jan.kratochvil@redhat.com>
> >
> > ÂÂÂÂÂÂÂÂ* breakpoint.c (delete_breakpoint <bpt->related_breakpoint != NULL>):
> > ÂÂÂÂÂÂÂÂNew.
>
> Yeah, OK.
Checked-in.
> I think you wanted:
>
> * breakpoint.c (delete_breakpoint) <bpt->related_breakpoint != NULL>:
>
> It's 6.8.5 in the GCS.
I have remembered it wrong, fixed.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-02/msg00081.html
--- src/gdb/ChangeLog 2010/02/11 21:45:25 1.11348
+++ src/gdb/ChangeLog 2010/02/11 22:25:26 1.11349
@@ -1,3 +1,8 @@
+2010-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * breakpoint.c (delete_breakpoint) <bpt->related_breakpoint != NULL>:
+ New.
+
2010-02-11 Pedro Alves <pedro@codesourcery.com>
* ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out on
--- src/gdb/breakpoint.c 2010/01/26 23:56:53 1.452
+++ src/gdb/breakpoint.c 2010/02/11 22:25:27 1.453
@@ -8691,6 +8691,16 @@
if (bpt->type == bp_none)
return;
+ /* At least avoid this stale reference until the reference counting of
+ breakpoints gets resolved. */
+ if (bpt->related_breakpoint != NULL)
+ {
+ gdb_assert (bpt->related_breakpoint->related_breakpoint == bpt);
+ bpt->related_breakpoint->disposition = disp_del_at_next_stop;
+ bpt->related_breakpoint->related_breakpoint = NULL;
+ bpt->related_breakpoint = NULL;
+ }
+
observer_notify_breakpoint_deleted (bpt->number);
if (breakpoint_chain == bpt)