Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor the stack pointer in the game loop #6

Open
ChillerDragon opened this issue Jul 28, 2024 · 0 comments
Open

Monitor the stack pointer in the game loop #6

ChillerDragon opened this issue Jul 28, 2024 · 0 comments

Comments

@ChillerDragon
Copy link
Owner

We do not stack allocate anything. So every game tick the stack pointer should be exactly the same. If not we could throw with an exit message. Instead of running into the segfault. That error could then show if the stack just changed a bit indicating a missing pop or push depending on the direction. If it is too far off probably something else happend. Maybe someone set the stack pointer manually and that was not intentional or with the wrong value.

We could also monitor some values in the .data and .bss section that we do not expect to change. That could act as early alarm system for writing to the wrong memory sections. This should be one method call in the game loop that could be excluded from the release build for extra performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant