ITADN

Investigate ways to detect stack overflows

#1824Opentothambrus11 创建于 2026-01-11
research topic
T
tothambrus11commented
In our current implementation, stack overflow is UB (due to LLVM behavior). If we want to fix it, we may need to work around that. It would be nice to detect stack overflow and crash the process / handle it somehow specially if we can. Apple has this: [___chkstk_darwin](https://forums.swift.org/t/what-is-chkstk-darwin/59519). It would be interesting to see different solutions of different OSs, and what we can do in embedded settings. Also, we need to see if we should keep ourselves constrained to small stacks (1-8MB). Thanks to subscripts, it will be viable to build abstractions around stack allocation, so we may be able to use the stack more than other languages. I'll put this topic on my backlog, but if anyone has resources in the meantime, I'd appreciate some pointers.
0 条评论