On 5/24/23 9:39 PM, wang yuhang via Bug reports for the GNU Bourne Again SHell wrote:
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":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1"},{"key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1"},{"key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1"},{"key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1","key":"1"}]


Bash will do what you tell it to. If you tell it to generate a huge amount
of text using brace expansion, it will do its best to do it.

It will catch memory allocation errors, and free the already-allocated
memory, but with most malloc() implementations, the memory will stay with
the bash process.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to