Skip to content

Fix SIGSEGV by skipping non-readable stack guard pages#95

Merged
JingMatrix merged 1 commit intomasterfrom
fossil
Feb 19, 2026
Merged

Fix SIGSEGV by skipping non-readable stack guard pages#95
JingMatrix merged 1 commit intomasterfrom
fossil

Conversation

@JingMatrix
Copy link
Copy Markdown
Owner

This commit fixeas a crash observed on specific devices (e.g., Redmi Note 10 Pro "sweet", Kernel 4.14) where nativeForkSystemServer_pre triggered a SIGSEGV (SEGV_ACCERR) when attempting to read the [anon:stack_and_tls:main] memory map.

We conjecture that the kernel on these devices reports the Stack Guard Page as part of the VMA range for the main thread's stack. A Guard Page is a memory region allocated at the limit of the stack with PROT_NONE permissions (no read/write/exec) to trap stack overflows.

Changes:

  • Added a check for PROT_READ in the map iteration loop.
  • Applied minor clang-format style fixes to pointer alignment in module.cpp.

This commit fixeas a crash observed on specific devices (e.g., Redmi Note 10 Pro "sweet", Kernel 4.14) where `nativeForkSystemServer_pre` triggered a SIGSEGV (SEGV_ACCERR) when attempting to read the `[anon:stack_and_tls:main]` memory map.

We conjecture that the kernel on these devices reports the Stack Guard Page as part of the VMA range for the main thread's stack. A Guard Page is a memory region allocated at the limit of the stack with `PROT_NONE` permissions (no read/write/exec) to trap stack overflows.

Changes:
- Added a check for `PROT_READ` in the map iteration loop.
- Applied minor clang-format style fixes to pointer alignment in `module.cpp`.
@JingMatrix JingMatrix mentioned this pull request Feb 15, 2026
1 task
@JingMatrix JingMatrix linked an issue Feb 15, 2026 that may be closed by this pull request
1 task
@JingMatrix JingMatrix merged commit e0c49d7 into master Feb 19, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

[Bug] Zygote64 Crash

1 participant