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    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to