Re: Bash regexp parsing would benefit from safe recursion limit

2022-04-08 Thread Dale R. Worley
willi1337 bald writes: > A deeply nested and incorrect regex expression can cause exhaustion of > stack resources, which crashes the bash process. Further, you could construct a deeply nested regex that is correct but would still crash the process. It's hard to define what should happen in a

Re: Bug in Bash on syntax error in functions?

2022-04-08 Thread Roel Van de Paar via Bug reports for the GNU Bourne Again SHell
Understood. Thank you both. On Sat, Apr 9, 2022 at 6:46 AM Chet Ramey wrote: > On 4/8/22 4:33 PM, Lawrence Velázquez wrote: > > > Notably, these don't execute "echo b" either, demonstrating that > > this isn't actually about functions at all. > > I may have been too obscure saying the function

Re: Bug in Bash on syntax error in functions?

2022-04-08 Thread Chet Ramey
On 4/8/22 4:33 PM, Lawrence Velázquez wrote: Notably, these don't execute "echo b" either, demonstrating that this isn't actually about functions at all. I may have been too obscure saying the function body was a brace group command. { echo a echo "$[ 1 + ]"

Re: Bug in Bash on syntax error in functions?

2022-04-08 Thread Lawrence Velázquez
On Fri, Apr 8, 2022, at 3:23 PM, Chet Ramey wrote: > So the difference is between a command not found > >> $ ./testfail1 >> a >> ./testfail1: line 3: fail_command: command not found >> b >> $ ./testfail2 >> a >> ./testfail2: line 3: 1 + : syntax error: operand expected (error token is >> "+ ") >>

Re: Bug in Bash on syntax error in functions?

2022-04-08 Thread Chet Ramey
On 4/8/22 2:42 AM, Roel Van de Paar via Bug reports for the GNU Bourne Again SHell wrote: Hi! I am using GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu). Here is what looks to be a bug: It's not. There are a couple of misconceptions here. Let's go through them.

Bug in Bash on syntax error in functions?

2022-04-08 Thread Roel Van de Paar via Bug reports for the GNU Bourne Again SHell
Hi! I am using GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu). Here is what looks to be a bug: -- $ cat testfail1 #!/bin/bash echo 'a' fail_command echo 'b' $ cat testfail2 #!/bin/bash echo 'a'