Discussion:
[Bug gdb/23342] New: sanity check stale struct frame_info *
jan.kratochvil at redhat dot com
2018-06-27 00:01:29 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23342

Bug ID: 23342
Summary: sanity check stale struct frame_info *
Product: gdb
Version: HEAD
Status: NEW
Severity: enhancement
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: jan.kratochvil at redhat dot com
Target Milestone: ---

GDB code commonly keeps struct frame_info * in local variables while calling
complicated call which possibly calls switch_to_thread() which invalidates
frame cache making the pointer stale.

Fedora had a reduction of such stale pointers:

https://src.fedoraproject.org/rpms/gdb/blob/a0d6e14aa39b8328976cf000849d2d9aa77adfd5/f/gdb-stale-frame_info.patch
[downstream patch FYI] workaround stale frame_info * (PR 13866)
http://sourceware.org/ml/gdb-patches/2012-04/msg00058.html
Message-ID: <***@host2.jankratochvil.net>

One of the possibilities now with C++ would be to make the pointer a RAII
pointer crashing if frame cache gets invalidating while such pointer still
exists. It would be similar to an easier alternative of a std::weak_ptr there.
--
You are receiving this mail because:
You are on the CC list for the bug.
sergiodj at redhat dot com
2018-06-27 01:15:31 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23342

Sergio Durigan Junior <sergiodj at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |sergiodj at redhat dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-07-27 09:04:06 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23342

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...