bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash crashes if TERM is unset and the Delete key is pressed twice


From: Chet Ramey
Subject: Re: bash crashes if TERM is unset and the Delete key is pressed twice
Date: Wed, 14 Dec 2022 14:30:04 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

On 12/14/22 2:01 PM, Emanuele Torre wrote:
On Wed, Dec 14, 2022 at 12:31:39PM -0500, Chet Ramey wrote:
On 12/13/22 9:00 AM, Emanuele Torre wrote:
This happens since 88d69b4fa224d93ef1d26b80229668397bb6496b .

If bash is started with the TERM variable unset or empty, it will
segfault and crash if you press the Delete key twice (it only happens
for the first prompt, and if you don't press anything before the two
Delete key presses).

I can't reproduce this on macOS, RHEL 7, Fedora 35, or Fedora 37, all
using xterm.

I can reproduce it consistently on my computer.

I tried to figure out what is causing the issue using gdb on the commit
88d69b4fa224d93ef1d26b80229668397bb6496b .

Try this.

*** ../bash-20221202/lib/readline/readline.c 2022-12-06 09:48:50.000000000 -0500
--- lib/readline/readline.c     2022-12-14 14:20:32.000000000 -0500
***************
*** 591,595 ****
          (*rl_redisplay_function) ();
          _rl_want_redisplay = 0;
!         memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));

          /* If we longjmped because of a timeout, handle it here. */
--- 591,596 ----
          (*rl_redisplay_function) ();
          _rl_want_redisplay = 0;
!         if (RL_ISSTATE (RL_STATE_CALLBACK))
!           memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t));

          /* If we longjmped because of a timeout, handle it here. */


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]