From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A4FC3851C3E; Wed, 27 May 2020 07:00:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A4FC3851C3E From: "phi.debian at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug tui/26036] GDB core dump TUI + rl Date: Wed, 27 May 2020 07:00:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tui X-Bugzilla-Version: 9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: phi.debian at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 07:00:29 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26036 --- Comment #2 from Phi --- Well in case someone takes ownership, here is my finding. I am NOT c++ aware, and I don't know GDB software organisation at all, so I= may be completly out of bounds. To me TUI is the culprit (not RL that got a NULL *FILE). In the function=20 /ldev/gdb-9.[12]/gdb/tui/tui-io.c tui_setup_io (int mode)=20=20=20=20=20=20=20=20=20 { } When mode=3D=3D1 (curses) there is a killing sequence. if (mode) { /* Redirect readline to TUI. */ ... tui_old_rl_outstream =3D rl_outstream; ... rl_outstream =3D tui_rl_outstream; ... } When run with -tui we enter here with RL not initialised, then rl_outstream=3D=3D0, later on on GDB first prompt, we strike ^X^A, tui rest= ore the tui_old_rl_outstream that is still 0x0 (whatever RL got initialised), then kaboom. To me a fix 'could be'=20 < tui_old_rl_outstream =3D rl_outstream; > tui_old_rl_outstream =3D rl_outstream ? rl_outstream:tui_rl_outstream; Because even though RL is not inited at that time, TUI is and then this is = what could be backed up. I tried this on both 9.1 and 9.2 and it solve here. BUT it may not be the final way to do this. Good luck! Phi --=20 You are receiving this mail because: You are on the CC list for the bug.=