public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tui/25348] Segfault on mode switch from TUI to CLI
Date: Wed, 17 Jun 2020 00:03:31 +0000	[thread overview]
Message-ID: <bug-25348-4717-JQaFQFpFOz@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25348-4717@http.sourceware.org/bugzilla/>

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a350efd4fb368a35ada608f6bc26ccd3bed0ae6b

commit a350efd4fb368a35ada608f6bc26ccd3bed0ae6b
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Jun 16 17:55:57 2020 -0600

    Fix crash when exiting TUI with gdb -tui

    PR tui/25348 points out that, when "gdb -tui" is used, then exiting
    the TUI will cause a crash.

    This happens because tui_setup_io stashes some readline variables --
    but because this happens before readline is initialized, some of these
    are NULL.  Then, when exiting the TUI, the NULL values are "restored",
    causing a crash in readline.

    This patch fixes the problem by ensuring that readline is initialized
    first.  Back in commit 11061048d ("Give a name to the TUI SingleKey
    keymap"), a call to rl_initialize was removed from
    tui_initialize_readline; this patch resurrects the call, but moves it
    to the end of the function, so as not to remove the ability to modify
    the SingleKey map from .inputrc.

    gdb/ChangeLog
    2020-06-16  Tom Tromey  <tom@tromey.com>

            PR tui/25348:
            * tui/tui.c (tui_ensure_readline_initialized): Rename from
            tui_initialize_readline.  Only run once.  Call rl_initialize.
            * tui/tui.h (tui_ensure_readline_initialized): Rename from
            tui_initialize_readline.
            * tui/tui-io.c (tui_setup_io): Call
            tui_ensure_readline_initialized.
            * tui/tui-interp.c (tui_interp::init): Update.

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

  parent reply	other threads:[~2020-06-17  0:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-25348-4717@http.sourceware.org/bugzilla/>
2020-06-06 18:18 ` tromey at sourceware dot org
2020-06-06 18:49 ` tromey at sourceware dot org
2020-06-06 20:07 ` tromey at sourceware dot org
2020-06-17  0:03 ` cvs-commit at gcc dot gnu.org [this message]
2020-06-17 12:22 ` tromey at sourceware dot org
2020-09-04 11:58 ` 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-25348-4717-JQaFQFpFOz@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: link
Be 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).