On Sat, 21 Jan 2023 at 09:24, N R <nicolas.reyl...@gmail.com> wrote: > I ran into a segmentation fault running bash --posix. Here are the > steps to reproduce : > bash-5.1$ echo () { echo test } > > echo test > > } > bash-5.1$ echo > Even though I'm not sure what is causing this seg fault, I'm sure it is > not the normal/expected behaviour.
That is the normal expected behaviour. What do you expect this should do: $ foo() { foo ; } ; foo This code instructs the function foo to call itself again and again without limit forever. So it tries to do that until the process entirely fills its call stack with return addresses and runs out of memory resources at which point the operating system will kill the process. That's not bash' fault. That's the programmers fault.