| Summary: | Segfault during gdb.execute('quit') within exit event handler | ||
|---|---|---|---|
| Product: | gdb | Reporter: | krinkodot22 |
| Component: | python | Assignee: | Not yet assigned to anyone <unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ssbssa |
| Priority: | P2 | ||
| Version: | 8.2 | ||
| Target Milestone: | 11.1 | ||
| Host: | Target: | ||
| Build: | Last reconfirmed: | ||
| Project(s) to access: | ssh public key: | ||
I can reproduce a problem with gdb 10.2: C:/src/repos/binutils-gdb.git/gdb/thread.c:95: internal-error: thread_info* inferior_thread(): Assertion `current_thread_ != nullptr' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) y But with 11.1 it works for me. I think it was fixed by: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=219f56b4842f4e72540082af96e47efa0f0f0a82 (In reply to Hannes Domani from comment #1) > I can reproduce a problem with gdb 10.2: > > C:/src/repos/binutils-gdb.git/gdb/thread.c:95: internal-error: thread_info* > inferior_thread(): Assertion `current_thread_ != nullptr' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) y > > But with 11.1 it works for me. > > I think it was fixed by: > https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff; > h=219f56b4842f4e72540082af96e47efa0f0f0a82 I'm closing this now. |
Within a sourced Python script, running `gdb.execute('quit')` during an exit event handler causes a segfault. To reproduce, run gdb on any executable after sourcing this Python script: def on_exit(event): gdb.execute('quit') gdb.events.exited.connect(on_exit) When the inferior ends, gdb should quit, but it segfaults instead. This happens on gdb 8.2 and newer. Also reported on RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1684822