You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
…g mode
When building OSv with newer GCC (>= 12) in debug mode, the interrupt
handler running on dedicated stack needs more than 1 page otherwise it
causes overflow. Similarly, the code setting up large syscall stack,
running on small 2K stack runs of of space as well.
To fix this, we increase the interrupt stack size to 8K and small
syscall stack size to 8K when building in debug mode (#ifndef NDEBUG).
Ideally, in long term we should implement some canary-based logic to
detect interrupt stack overflow as the issue #1339 explains.
Ref #1339
Signed-off-by: Waldemar Kozaczuk <[email protected]>
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.The text was updated successfully, but these errors were encountered: