public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/31172] New: gdb.post_event SIGSEGV in batch mode
@ 2023-12-16  0:44 mitch at runsafesecurity dot com
  2024-01-29 10:45 ` [Bug python/31172] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mitch at runsafesecurity dot com @ 2023-12-16  0:44 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31172
           Summary: gdb.post_event SIGSEGV in batch mode
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: mitch at runsafesecurity dot com
  Target Milestone: ---

OS: Debian GNU/Linux 10 (buster)
Version: gdb-13.2 built from source against Python 3.7.

$ gdb --batch -ex 'pi gdb.post_event(lambda : print("test"))' 

Fatal signal: Segmentation fault
----- Backtrace -----
0x563e4c327527 gdb_internal_backtrace_1
        ../../gdb/bt-utils.c:122
0x563e4c327527 _Z22gdb_internal_backtracev
        ../../gdb/bt-utils.c:168
0x563e4c44573a handle_fatal_signal
        ../../gdb/event-top.c:956
0x563e4c4457df handle_sigsegv
        ../../gdb/event-top.c:1029
0x7fb16addc72f ???
0x7fb16af9bec9 ???
0x7fb16af9c01b ???
Segmentation fault (core dumped)


Stack trace as reported by gdb --args (with above cmd):
...
#0  0x00007f47ac003ec9 in PyThreadState_New () from
/usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0
#1  0x00007f47ac00401c in PyGILState_Ensure () from
/usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0
#2  0x00005568cdefebff in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>) at
../../gdb/python/python.c:265
#3  gdbpy_event::~gdbpy_event (this=0x5568cfa1c6d0, __in_chrg=<optimized out>)
at ../../gdb/python/python.c:1022
#4  std::_Function_base::_Base_manager<gdbpy_event>::_M_destroy (__victim=...)
at /usr/include/c++/8/bits/std_function.h:188
#5  std::_Function_base::_Base_manager<gdbpy_event>::_M_manager (__dest=...,
__source=..., __op=<optimized out>)
    at /usr/include/c++/8/bits/std_function.h:212
#6  0x00005568cdf73fce in std::_Function_base::~_Function_base
(this=0x5568cf8552f0, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/std_function.h:257
#7  std::function<void ()>::~function() (this=0x5568cf8552f0,
__in_chrg=<optimized out>) at /usr/include/c++/8/bits/std_function.h:370
#8  std::_Destroy<std::function<void ()> >(std::function<void ()>*)
(__pointer=0x5568cf8552f0) at /usr/include/c++/8/bits/stl_construct.h:98
#9  std::_Destroy_aux<false>::__destroy<std::function<void
()>*>(std::function<void ()>*, std::function<void ()>*) (__last=<optimized
out>, 
    __first=0x5568cf8552f0) at /usr/include/c++/8/bits/stl_construct.h:108
#10 std::_Destroy<std::function<void ()>*>(std::function<void ()>*,
std::function<void ()>*) (__last=<optimized out>, __first=<optimized out>)
    at /usr/include/c++/8/bits/stl_construct.h:137
#11 std::_Destroy<std::function<void ()>*, std::function<void ()>
>(std::function<void ()>*, std::function<void ()>*,
std::allocator<std::function<void ()> >&) (__last=0x5568cf855310,
__first=<optimized out>) at /usr/include/c++/8/bits/stl_construct.h:206
#12 std::vector<std::function<void ()>, std::allocator<std::function<void ()> >
>::~vector() (this=0x5568cf626c50 <runnables>, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/stl_vector.h:567
#13 0x00007f47ab8bcebc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#14 0x00007f47ab8bcfea in exit () from /lib/x86_64-linux-gnu/libc.so.6
#15 0x00005568ce0533e2 in quit_force (exit_arg=<optimized out>,
from_tty=from_tty@entry=0) at ../../gdb/top.c:1896
#16 0x00005568cdddc3f3 in captured_main_1
(context=context@entry=0x7fffb9066670) at ../../gdb/main.c:1311
#17 0x00005568cdddcf7b in captured_main (data=data@entry=0x7fffb9066670) at
../../gdb/main.c:1320
#18 gdb_main (args=args@entry=0x7fffb9066690) at ../../gdb/main.c:1345
#19 0x00005568cda7ca8b in main (argc=<optimized out>, argv=<optimized out>) at
../../gdb/gdb.c:32


Note: it does not crash when run without '--batch' in interactive mode, which
is the expected behavior.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-27 17:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16  0:44 [Bug python/31172] New: gdb.post_event SIGSEGV in batch mode mitch at runsafesecurity dot com
2024-01-29 10:45 ` [Bug python/31172] " vries at gcc dot gnu.org
2024-01-29 11:28 ` vries at gcc dot gnu.org
2024-02-23 20:26 ` tromey at sourceware dot org
2024-02-23 20:27 ` tromey at sourceware dot org
2024-02-27 17:38 ` cvs-commit at gcc dot gnu.org
2024-02-27 17:38 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).