public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "aburgess at redhat dot com" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug gdb/28948] New: Enabling/disabling logging over an interpreter switch can crash gdb Date: Mon, 07 Mar 2022 21:38:41 +0000 [thread overview] Message-ID: <bug-28948-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=28948 Bug ID: 28948 Summary: Enabling/disabling logging over an interpreter switch can crash gdb Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: aburgess at redhat dot com Target Milestone: --- Try this GDB session: (gdb) file /path/to/some/executable (gdb) set logging file /tmp/gdb.log (gdb) set logging debugredirect on (gdb) set logging enabled on Copying output to /tmp/gdb.log. Redirecting debug output to /tmp/gdb.log. (gdb) set debug infrun 1 (gdb) start ... snip ... (gdb) tui enable # Then at the TUI prompt: (gdb) set logging debugredirect off (gdb) set logging enabled off (gdb) stepi (gdb) stepi (gdb) stepi # By this point GDB has usually crashed for me. This is very similar to this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28620 It might almost be considered a duplicate of that bug, but I'm not 100% sure the same fix for the previous will also fix this, though the underlying problem is identical in nature. What happens is that when we enable logging, GDB stashes the current output file descriptors to one side, and replaces them with alternative file descriptors. Then, when we switch interpreter (tui enable) we replace the current output streams with the streams for the new interpreter. Then, when we disable logging, we replace the current streams (those for the tui now) with the earlier backed up streams (those from before logging was enabled), which happen to be the streams for the CLI. At this point, weird stuff happens. Usually the TUI will immediately disappear from the screen, and usually GDB crashes pretty quickly. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2022-03-07 21:38 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-07 21:38 aburgess at redhat dot com [this message] 2022-08-10 19:07 ` [Bug gdb/28948] " tromey at sourceware dot org 2022-08-11 13:05 ` tromey at sourceware dot org 2022-08-12 17:23 ` tromey at sourceware dot org 2022-08-12 20:02 ` tromey at sourceware dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-28948-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).