Skip to content

Conversation

@j-lojek
Copy link

@j-lojek j-lojek commented Dec 13, 2025

On aarch64 kernels with 64KiB pages (e.g. GH200 aarch64+64k), NLE hardcodes STACK_SIZE=64KiB. create_fcontext_stack() uses the first page as a guard page; with a 64KiB page size this leaves no usable stack space and results in a segfault on first reset()/context switch. This change computes an effective stack size at runtime and ensures at least 2 pages (guard + usable) via sysconf(_SC_PAGESIZE), while keeping existing behavior on 4KiB page systems. Tested on GH200: 2000 continuous resets test passed without a segfault.

@StephenOman StephenOman added the bug Something isn't working label Dec 14, 2025
@StephenOman StephenOman merged commit 786c7a8 into NetHack-LE:main Dec 15, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants