From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E80FD3858C54; Thu, 7 Apr 2022 08:02:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E80FD3858C54 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29032] [gdb][test-case failure, taskset] FAIL: gdb.base/eof-exit.exp: with non-dump terminal: close GDB with eof (timeout) Date: Thu, 07 Apr 2022 08:02:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Thu, 07 Apr 2022 08:02:18 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29032 --- Comment #2 from Tom de Vries --- Also reproduces with gdb 11.2. I did the following experiment: print out the chars in a debug file as they= are read from the input stream by readline (iow the result of the read in rl_ge= tc). In the passing case, readline indeed sees the \004 char. But in the failing case, it gets \000 instead. My current theory is that this is caused by the terminal being switched for= th and back between prepped and unprepped mode, and that what we're seeing is = the result of the 'send_gdb "\004"' arriving at the terminal while being unprep= ped. Reading here ( https://www.gnu.org/software/libc/manual/html_node/Canonical-or-Not.html ) I read: ... In canonical input processing mode, terminal input is processed in lines terminated by newline ('\n'), EOF, or EOL characters ... So, that sounds plausible. If the EOF is interpreted by the terminal as en= d of input, and there's no other input, the result could well be an empty string, that is, a string consisting of a single '\0'. I tried to test this theory by extending the period that the terminal is unprepped, like so: ... diff --git a/readline/readline/rltty.c b/readline/readline/rltty.c index d0cd572713a..6b81bd804ce 100644 --- a/readline/readline/rltty.c +++ b/readline/readline/rltty.c @@ -711,6 +711,7 @@ rl_deprep_terminal (void) RL_UNSETSTATE(RL_STATE_TERMPREPPED); _rl_release_sigint (); + usleep (100 * 1000); } #endif /* !NO_TTY_DRIVER */ ... and indeed this makes the problem reproducible without taskset. --=20 You are receiving this mail because: You are on the CC list for the bug.=