Today, my colleague came across a thread stack overflow core dump:
From above diagram, we can see only this function’s stack will occupy ~7 MiB
space. Check the stack size configuration on system:
$ ulimit -S -s
8192
just 8 MiB
. Double the stack size:
$ ulimit -S -s 16384
The program won’t crash.
Reference:
General: How do I change my default limits for stack size, core file size, etc.?.