Skip to content

Commit b9843b8

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Prevent nested handling of SIGPROF.
TEST=ci Bug: #52765 Change-Id: I14301d67ad245d3df96624155b383cb5f4c7f981 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310975 Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Ben Konyi <[email protected]>
1 parent bbdf87d commit b9843b8

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

runtime/vm/signal_handler_android.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ void SignalHandler::Install(SignalAction action) {
122122
struct sigaction act = {};
123123
act.sa_sigaction = action;
124124
sigemptyset(&act.sa_mask);
125+
sigaddset(&act.sa_mask, SIGPROF); // Prevent nested signals.
125126
act.sa_flags = SA_RESTART | SA_SIGINFO | SA_ONSTACK;
126127
r = sigaction(SIGPROF, &act, nullptr);
127128
ASSERT(r == 0);

runtime/vm/signal_handler_linux.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void SignalHandler::Install(SignalAction action) {
115115
act.sa_handler = nullptr;
116116
act.sa_sigaction = action;
117117
sigemptyset(&act.sa_mask);
118+
sigaddset(&act.sa_mask, SIGPROF); // Prevent nested signals.
118119
act.sa_flags = SA_RESTART | SA_SIGINFO;
119120
int r = sigaction(SIGPROF, &act, nullptr);
120121
ASSERT(r == 0);

0 commit comments

Comments
 (0)