2 ms·
musl's thread stack size is too low (128K), so many open source test suites segfault. I do not understand why musl doesn't move to at least 512K like OSX. The
by hygh 5y ago
musl's thread stack size is too low (128K), so many open source test suites segfault.
I do not understand why musl doesn't move to at least 512K like OSX.
The generous 8192K glibc thread stack size isn't actually used on Linux with overallocation, so I fail to see why musl chose that small default in the first place.
- synergy20 5y agomaybe, musl by design, is for resource limited embedded boxes. multiple threads with large stack size will eat up RAM. If you need larger thread stack I believe you can set it in the code. "Since 1.1.21, musl supports increasing the default thread stack size via the PT_GNU_STACK program header, which can be set at link time via -Wl,-z,stack-size=N." Of course you can always use pthread_attr_setstacksize
- masklinn 5y ago> maybe, musl by design, is for resource limited embedded boxes. multiple threads with large stack size will eat up RAM. It won’t really: that’s vmem, it’ll only need a bit of memory for the accounting of the mappings in the kernel.
- glb100 5y ago> Of course you can always use pthread_attr_setstacksize. No you can't, not with std::thread, which makes std::thread nearly unusable with musl.
- temac 5y ago> The generous 8192K glibc thread stack size isn't actually used on Linux with overallocation Is it even (over)committed? The main reason for having a max stack size is multithreading, but I'm not sure why it should be committed at all. Surely, an unbounded single thread stack is not precommitted to infinity?