Out of bounds read in parse.y.

2024-08-26 Thread Collin Funk
Hi, When compiling with undefined behavior sanitizer and then running: $ ./bash parse.y:1000:93: runtime error: index -1 out of bounds for type 'int [257]' The offending section of code: case_command: CASE WORD newline_list IN newline_list ESAC {

Re: eval '<$(;)' causes Segmentation Fault

2024-08-26 Thread Zachary Santer
On Sun, Aug 25, 2024 at 8:57 PM wrote: > > All the following scripts can create a Segmentation Fault > > eval '<$[;]' > > eval '<$(;)' > > eval '<${;}' > > eval '<$[|]' > > eval '<$(|)' > > eval '<${|}' Configuration Information [Automatica

Re: bash-5.2.32 fails "make install" on RHEL 9

2024-08-26 Thread Dennis Clarke via Bug reports for the GNU Bourne Again SHell
On 8/26/24 16:29, Chet Ramey wrote: On 8/24/24 11:53 PM, Dennis Clarke via Bug reports for the GNU Bourne Again SHell wrote: This seemed to happen over and over and only during "make install". There are a number of loadable builtins that require arrays and don't build without them. It's anno

Re: eval '<$(;)' causes Segmentation Fault

2024-08-26 Thread Dale R. Worley
writes: > Repeat-By: > 1. Create a script, i.e. `poc.sh` with the problematic string > 2. Execute `bash poc.sh` Interestingly, when I run it (bash 5.1.0(1), which is pretty old), I don't get the seg fault when I enter that string from the keyboard, only when it's read from a scrip

Re: Question on $@ vs $@$@

2024-08-26 Thread Steffen Nurpmeso
Lawrence Velázquez wrote in <972ac206-a601-4337-8dfc-77bbaef22...@app.fastmail.com>: |On Sat, Aug 24, 2024, at 10:08 PM, Steffen Nurpmeso wrote: |> One hopefully last thing in this regard for me, ... |This easily obfuscates the structure of the "$@" expansion. You'd |be better off with somet

Re: Question on $@ vs $@$@

2024-08-26 Thread Steffen Nurpmeso
alex xmb sw ratchev wrote in : |try | |${@@Q} | |and | |${*@Q} | |greets I try to avoid using non-portable shell stuff. I do not think these would be understood by the ash shell variants (and ksh) which had results other than bash. --steffen | |Der Kragenbaer,The moon be

Re: Question on $@ vs $@$@

2024-08-26 Thread Steffen Nurpmeso
Chet Ramey wrote in : |On 8/23/24 5:47 PM, Steffen Nurpmeso wrote: |> If IFS has a value other than the default, then sequences of the |> whitespace characters space, tab, and newline are ignored at the |> beginning and end of the word, as long as the whitespace |> character is in the

Re: Question on $@ vs $@$@

2024-08-26 Thread Steffen Nurpmeso
Dear Robert, all. Robert Elz wrote in <39.1724620...@jacaranda.noi.kre.to>: |Date:Sun, 25 Aug 2024 04:08:58 +0200 |From:Steffen Nurpmeso |Message-ID: <20240825020858.nrX4pFTm@steffen%sdaoden.eu> | || (The only thinkable answer is that the step that my MUA does,

Re: Question on $@ vs $@$@

2024-08-26 Thread alex xmb sw ratchev
try ${@@Q} and ${*@Q} greets On Wed, Aug 14, 2024, 2:45 AM Steffen Nurpmeso wrote: > Hello. > > I include bug-bash even though i think bash is correct, but there > lots of people of expertise are listening, so, thus. > Sorry for cross-posting, nonetheless. > Given this snippet (twox() withou

RE: eval '<$(;)' causes Segmentation Fault

2024-08-26 Thread youheng.lue
>> These still cause the current devel branch to segfault, but (at least >> for me, on macOS) only when invoked via argument, as OP directed. For >> example, reading the scripts via stdin avoids the segfault. Tested on commit cf694865de527e597de5a906643a74037341a431 I reproduced within a Docker

Re: bash-5.2.32 fails "make install" on RHEL 9

2024-08-26 Thread Chet Ramey
On 8/24/24 11:53 PM, Dennis Clarke via Bug reports for the GNU Bourne Again SHell wrote: This seemed to happen over and over and only during "make install". There are a number of loadable builtins that require arrays and don't build without them. It's annoying, but everything else is already

Re: Question on $@ vs $@$@

2024-08-26 Thread Chet Ramey
On 8/24/24 11:49 PM, Lawrence Velázquez wrote: The bash manual says [1]: * ($*) Expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a

Re: Question on $@ vs $@$@

2024-08-26 Thread Chet Ramey
On 8/23/24 5:47 PM, Steffen Nurpmeso wrote: If IFS has a value other than the default, then sequences of the whitespace characters space, tab, and newline are ignored at the beginning and end of the word, as long as the whitespace character is in the value of IFS (an IFS whitespace cha

Re: eval '<$(;)' causes Segmentation Fault

2024-08-26 Thread Chet Ramey
On 8/25/24 10:54 PM, Lawrence Velázquez wrote: On Sun, Aug 25, 2024, at 6:24 PM, youheng@gmail.com wrote: Bash Version: 5.1 Patch Level: 16 Note that this version of bash is outdated and will not receive further updates. The current release is 5.2. All the following scripts c

Re: Why does case-pattern undergo "process substitution"?

2024-08-26 Thread Chet Ramey
On 8/23/24 3:41 PM, shynur . wrote: Hi, friends~ I'm reading the Bash Reference Manual, section 3.2.5.2. Here: . case _word_ in [ [(] _pattern_ [| _pattern_]…) _command-list_ ;;]… esac Each _pattern_ u

Re: 'wait -n' with and without id arguments

2024-08-26 Thread Chet Ramey
On 8/16/24 8:21 AM, Zachary Santer wrote: On Wed, Aug 14, 2024 at 11:22 PM Zachary Santer wrote: The implicit 'jobs' isn't happening before each PS1, but after each command completes. Thus, all the [1] Donerandom_sleep notifications when sourcing wait-n-failure, before

Re: 'wait -n' with and without id arguments

2024-08-26 Thread Chet Ramey
On 8/14/24 11:22 PM, Zachary Santer wrote: On Wed, Aug 14, 2024 at 3:22 PM Chet Ramey wrote: On 8/7/24 2:47 PM, Zachary Santer wrote: Now I understand that this is because the list of terminated child processes that 'wait -n' currently ignores is only used in the interactive shell. It's no