Rust on Windows: random crashes turned out to be the default stack size

216 points Havunenreddit 51 comments

Today, I encountered interesting detail when developing cross-platform program ( GitComet ) written fully in Rust.

Most development happened on Linux, and the app worked fine there. But after using the Windows build for a while, I started seeing what looked like random crashes.

Stackoverflow exception program exit, panic handlers dont run, no stacktrace.

In debug mode on Windows, the crashes became much easier to reproduce.

Increasing the Windows linker stack size to 8Mb fixed the issue:
Reference: https://github.com/Auto-Explore/GitComet/pull/99/changes#diff-519337722c958a057bccc24eada91aeccfc76cd22e0aab01a18a6529a007b8d6

I thought this was interesting learning experiment and wanted to share it with you guys