NodeJS compiled with low value of PTHREAD_STACK_MIN causing segfaults
This is related to a bug reported to musl http://www.openwall.com/lists/musl/2018/03/15/9
In some setups, like AWS C5s and M5s instances, the low value of PTHREAD_STACK_MIN = 2048 set in the limits.h file owned by musl-dev file is not enough for nodejs to function properly
running the following command for example will case a segfault
node -e ‘process.setgid(0)’
As mentioned on the bug to musl thats caused by the low pthread-stack value.
Looking at how nodejs is compiled in Alpine, it looks for this value inside the limits.h file
I tested setting this value to 16384 in limits.h to mirror the glibc value and rebuilt nodejs and the issue was solved
I am not sure about the best way to fix this ,but i think either patching musl-dev or nodejs should be a workaround until musl increases the default value
(from redmine: issue id 9399, created on 2018-09-06)