[Bug build/30413] [gdb/build] error: storing the address of local variable ‘<anonymous>’ in ‘frame_info_ptr::frame_list.intrusive_list<frame_info_ptr>::m_back’ [-Werror=dangling-pointer=]

mark at klomp dot org sourceware-bugzilla@sourceware.org
Wed May 3 15:43:36 GMT 2023


https://sourceware.org/bugzilla/show_bug.cgi?id=30413

--- Comment #8 from Mark Wielaard <mark at klomp dot org> ---
Note that the workaround commit in comment #7 fixed this issue for
fedora-rawhide, fedora-latest and suse-tumbleweed on x86_64. But there is
another instance of this issue on gentoo-sparc:
https://builder.sourceware.org/buildbot/#/builders/230/builds/1290

In file included from ../../binutils-gdb/gdb/frame.h:75,
                 from ../../binutils-gdb/gdb/frame.c:21:
In member function ‘void intrusive_list<T, AsNode>::push_empty(T&) [with T =
frame_info_ptr; AsNode = intrusive_base_node<frame_info_ptr>]’,
    inlined from ‘void intrusive_list<T, AsNode>::push_back(reference) [with T
= frame_info_ptr; AsNode = intrusive_base_node<frame_info_ptr>]’ at
../../binutils-gdb/gdb/../gdbsupport/intrusive_list.h:332:24,
    inlined from ‘frame_info_ptr::frame_info_ptr(std::nullptr_t)’ at
../../binutils-gdb/gdb/frame.h:233:26,
    inlined from ‘frame_info_ptr get_next_frame(frame_info_ptr)’ at
../../binutils-gdb/gdb/frame.c:2065:12,
    inlined from ‘void frame_register_unwind_location(frame_info_ptr, int,
int*, lval_type*, CORE_ADDR*, int*)’ at ../../binutils-gdb/gdb/frame.c:2159:35:
../../binutils-gdb/gdb/../gdbsupport/intrusive_list.h:415:12: error: storing
the address of local variable ‘<anonymous>’ in
‘frame_info_ptr::frame_list.intrusive_list<frame_info_ptr>::m_back’
[-Werror=dangling-pointer=]
  415 |     m_back = &elem;
      |     ~~~~~~~^~~~~~~
../../binutils-gdb/gdb/frame.c: In function ‘void
frame_register_unwind_location(frame_info_ptr, int, int*, lval_type*,
CORE_ADDR*, int*)’:
../../binutils-gdb/gdb/frame.c:2159:35: note: ‘<anonymous>’ declared here
 2159 |       this_frame = get_next_frame (this_frame);
      |                    ~~~~~~~~~~~~~~~^~~~~~~~~~~~
../../binutils-gdb/gdb/frame.c:3278:32: note: ‘frame_info_ptr::frame_list’
declared here
 3278 | intrusive_list<frame_info_ptr> frame_info_ptr::frame_list;
      |                                ^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1922: frame.o] Error 1
make[1]: *** Waiting for unfinished jobs....

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list