Inconsistent DEFAULT_MIN_STACK_SIZE Across Platforms Causes Unexpected Issues #126027
Description
The DEFAULT_MIN_STACK_SIZE is the default stack size assigned when creating a thread. This value varies across different platforms. The issue is that there isn't enough explanation as to why these values are different, and users might not realize that the stack size can vary.
Recently, I was running existing Windows code on a WASI target, and I kept encountering font decoding failures. Since it worked correctly on Windows, I suspected WASI's instability and spent considerable time debugging. After several days, I discovered that the root cause was the stack size: WASI has a very small stack size of 4KB, while Windows has a much larger stack size of 2MB. Once I forcibly increased the thread's stack size, all issues were resolved.
I felt quite frustrated that such a simple reason caused the problem.
Although this is my personal experience, I believe that rather than setting different default stack sizes for different platforms without a compelling reason, it would be better to have a consistent stack size across all platforms in Rust.
However, I acknowledge that this suggestion might not be very effective because the required memory can vary depending on the instruction set or architecture.
I would like to discuss this matter further.