text similar to JSON can cause memory of bash to become abnormally large

2023-05-24 Thread wang yuhang
hi I accidentally copied a section of JSON text to the terminal and executed it, which resulted in a system crash.Bash version is 5.1.8. Later, I reproduced it and found that when I executed the following command, the memory usage of bash became very large. $ [{"key":"1","key":"1","key"

Re: Searches in bash don't works

2023-05-24 Thread Dennis Williamson
On Wed, May 24, 2023, 5:21 PM William via Bug reports for the GNU Bourne Again SHell wrote: > Hi. It's the first time I send a message about a bug using bashbug. I > don't known if the message was sent properly. So, I repeat it that way. > > > Machine: i686 > > OS: linux-gnu > Compiler: gcc > Com

Searches in bash don't works

2023-05-24 Thread William via Bug reports for the GNU Bourne Again SHell
Hi. It's the first time I send a message about a bug using bashbug. I don't known if the message was sent properly. So, I repeat it that way. Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-

Re: parsing command substitution inside parameter expansion in interactive shell

2023-05-24 Thread Chet Ramey
On 5/23/23 2:50 PM, Grisha Levit wrote: One more similar case when the parameter expansion is quoted: bash --norc -in <<<$'"${_+$("\n")}"' bash-5.2$ "${_+$(" bash: command substitution: line 2: unexpected EOF while looking for matching `"' > ")}" bash --norc -in <<<$'"${_+$(:\n)}"' bash-5.2

Re: nofork command substitution

2023-05-24 Thread Chet Ramey
On 5/23/23 4:17 PM, Grisha Levit wrote: An interactive shell gets confused (PS1 shown instead of PS2) when using newline as the first character of the substitution: $ bash --norc -i <<<$'${\n:;}' bash-5.2$ ${ bash-5.2$ :;} Thanks for the report. Chet -- ``The lyf so short, the craft so long

Re: nofork command substitution

2023-05-24 Thread Chet Ramey
On 5/23/23 4:17 PM, Grisha Levit wrote: Things don't seem to work right with an empty funsub: bash --pretty-print <<<'${ }' ${ ; } It should allow the empty command substitution, like $(), and not add the `;' when it reconstitutes the text. -- ``The lyf so short, the craft so long to lerne.

Unset during expansion w/ nofork sub

2023-05-24 Thread Grisha Levit
There are a lot of code paths that (reasonably) do not expect a variable to disappear while being expanded/assigned to, and usually cause a segfault if that happens (as is now possible with the new nofork command substitution). I don't think there is any legitimate use case to be supported here, a

Re: nofork command substitution

2023-05-24 Thread Chet Ramey
On 5/23/23 6:52 AM, Koichi Murase wrote: I really appreciate that the feature ${ command; } is finally implemented. I have a function that mimics the behavior of the nofork command substitution in my project. I changed the function to switch to use the new nofork command substitutions in new B