When testing some Makefile changes with debug build on Fedora 37 with GCC 12, I discovered that OSv crashes or hangs in many scenarios. After some digging, I found the culprit lies in too small interrupt stack which is only 1 page large on x86_64 - probably the code generated with -O0 needs larger stack. Increasing the interrupt stack to 2 pages fixes the issue.
Given how small the interrupt stack is, we probably could at least introduce some "canary"-based type of solution similar to what we employ with the small syscall stack. Right after handling an interrupt in the interrupt() routing (see arch/x64/exceptions.cc) we could check the canary value and abort if overflow is detected.
When testing some Makefile changes with debug build on Fedora 37 with GCC 12, I discovered that OSv crashes or hangs in many scenarios. After some digging, I found the culprit lies in too small interrupt stack which is only 1 page large on x86_64 - probably the code generated with
-O0
needs larger stack. Increasing the interrupt stack to 2 pages fixes the issue.Given how small the interrupt stack is, we probably could at least introduce some "canary"-based type of solution similar to what we employ with the small syscall stack. Right after handling an interrupt in the
interrupt()
routing (seearch/x64/exceptions.cc
) we could check the canary value and abort if overflow is detected.