Skip to content

Commit cd572ae

Browse files
authored
Set SA_ONSTACK in zend_sigaction (#9597)
1 parent e6831db commit cd572ae

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ PHP NEWS
55
- Core:
66
. Fixed bug GH-9388 (Improve unset property and __get type incompatibility
77
error message). (ilutov)
8+
. SA_ONSTACK is now set for signal handlers to be friendlier to other
9+
in-process code such as Go's cgo. (Kévin Dunglas)
810

911
- Opcache:
1012
. Added start, restart and force restart time to opcache's

Zend/zend_signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ ZEND_API void zend_sigaction(int signo, const struct sigaction *act, struct siga
248248
if (SIGG(handlers)[signo-1].handler == (void *) SIG_IGN) {
249249
sa.sa_sigaction = (void *) SIG_IGN;
250250
} else {
251-
sa.sa_flags = SA_SIGINFO | (act->sa_flags & SA_FLAGS_MASK);
251+
sa.sa_flags = SA_ONSTACK | SA_SIGINFO | (act->sa_flags & SA_FLAGS_MASK);
252252
sa.sa_sigaction = zend_signal_handler_defer;
253253
sa.sa_mask = global_sigmask;
254254
}

0 commit comments

Comments
 (0)