bug-bash
[Top][All Lists]
Advanced

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

${par@P} can cause segmentation faults


From: Emanuele Torre
Subject: ${par@P} can cause segmentation faults
Date: Sat, 28 Aug 2021 10:07:08 +0200

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin'
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout'
-DNON_INTERACTIVE_LOGIN_SHELLS
uname output: Linux t420 5.10.60-1-lts #1 SMP Fri, 20 Aug 2021
21:04:02 +0000 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.1
Patch Level: 8
Release Status: release

Description:

    PS1=\${PS1@P}

  makes bash segfault in interactive shells.

    a=\${a@P};${a@P}

  makes bash segfault also in non-interactive shells.

  Some uses of ${par@P} in prompt strings may be valid:

    b='\w' a='${b@P}'
    printf '%s\n' "${a@P}"

  But some others may cause segfaults:

    b=\${a@P} a=\${b@P}
    printf '%s\n' "${a@P}"

  Cheers,
   -emanuele6

Repeat-By:

  $ bash --norc
  bash-5.1$ PS1=\${PS1@P}
  Segmentation fault (core dumped)
  $

  or

  $ bash -c 'a=\${a@P};${a@P}'
  Segmentation fault (core dumped)
  $



reply via email to

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