bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash on large brace expansion


From: Dale R. Worley
Subject: Re: Crash on large brace expansion
Date: Thu, 15 Jul 2021 20:59:37 -0400

Gabríel Arthúr Pétursson <gabriel.arthur.petursson@advania.is> writes:
> Executing the following results in a fierce crash:
>
>    $ bash -c '{0..255}.{0..255}.{0..255}.{0..255}'
>    malloc(): unaligned fastbin chunk detected 2
>    Aborted (core dumped)

As others have noted, you are attempting to construct 2^32 words.  Now
it's probable that you could run it on a computer with enough RAM to do
the job.  (I work with ones that have 128 GiB.)  But the indexes
involved are large enough that they are likely overflowing various
32-bit counters/pointers.  So bash dies on an internal error in
malloc().

Dale



reply via email to

[Prev in Thread] Current Thread [Next in Thread]