Repository navigation
fix: re-apply SA_ONSTACK to every extension signal handler - #2746
Merged
Merged
Conversation
mstegmeyer
force-pushed
the
fix/sa-onstack-all-signals
branch
from
October 22, 2026 06:14
a472acb to
0dfc1c5
Compare
henderkes
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2745
frankenphp_startup()already addsSA_ONSTACKto handlers that extensions install during MINIT, but only for SIGSEGV, SIGBUS and SIGFPE (#2650). An asynchronous signal handler without the flag is just as unsafe on a Go thread. Its signal frame overflows the goroutine stack into the neighbouring one, and the runtime crashes later in GC. dd-trace-php's SIGVTALRM handler does exactly this in production (DataDog/dd-trace-php#4354).This applies the existing fix-up to every signal. The test extension now installs a SIGVTALRM handler next to the SIGSEGV one. Go's own handlers already carry the flag, so only extension handlers change. Handlers installed after startup, such as
pcntl_signal(), are still not covered, as before.The extended
internal/testexttest fails onmainand passes with the change.go test -race ./...passes against PHP 8.5.12 ZTS (linux/arm64).