2 ms·
Of course you can have a SIGSEGV when you exceed the max stack size. That's fine and to be expected. What's NOT fine is for a large stack allocation to cause
by cryptonector 5y ago
Of course you can have a SIGSEGV when you exceed the max stack size. That's fine and to be expected.
What's NOT fine is for a large stack allocation to cause the program to silently scribble over another stack or heap.
- masklinn 5y ago> Of course you can have a SIGSEGV when you exceed the max stack size. That's fine and to be expected. It's more that you can't expect anything better, having an actual stack overflow error would be a lot more helpful.
- cryptonector 5y agoRight. With 64-bit ISAs you can address 2^64 bytes, but... you can't exactly have 2^64 bytes. At some point the system will fail. How it fails is important. A ran-out-of-resources errors is a lot better than undefined behavior resulting from random memory corruption. And yes, portable C has finite size_t. Therefore portable C must fail in some way when limits are exceeded.