You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In musl, ARG_MAX is defined as 131072 which seems to match linux kernel's definition of ARG_MAX.
processes.c in few places allocates "char cmdline[ARG_MAX];" buffers, and the default stack size of musl is about 80 kB, so the program crashes.
Allocating 100kB+ in stack sounds like a bad idea anyway. Perhaps use 4096 buffers always (as this is assumed if ARG_MAX is not defined). Alternatively, you could create the thread for processes.c with pthread_attr asking for sufficiently large stack.
The text was updated successfully, but these errors were encountered:
ARG_MAX is quite big on many systems, for example >100 kByte on
GNU/Linux. This is a problem for systems with tight memory constraints,
for example embedded devices.
This patch uses at most 4 kByte for this, which out to be enough for the
vast majority of users. Users with specific requirements can compile
with "CMDLINE_BUFFER_SIZE=${LOTS}" in their CPPFLAGS to override this
default.
Fixes: #652
In musl, ARG_MAX is defined as 131072 which seems to match linux kernel's definition of ARG_MAX.
processes.c in few places allocates "char cmdline[ARG_MAX];" buffers, and the default stack size of musl is about 80 kB, so the program crashes.
Allocating 100kB+ in stack sounds like a bad idea anyway. Perhaps use 4096 buffers always (as this is assumed if ARG_MAX is not defined). Alternatively, you could create the thread for processes.c with pthread_attr asking for sufficiently large stack.
The text was updated successfully, but these errors were encountered: