[cpu-profiler] Set SA_ONSTACK for the signal handler

This has no effect on our normal V8 builds as we don't set an
alternate stack.

Embedders like Go have to use alt stacks so this makes them work
with V8 if they have set up an alt stack themselves.

Change-Id: Icf3f4b39c026948875f5b2762ea6ffabaab03e8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2505718
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70855}
This commit is contained in:
Peter Marshall 2020-10-28 18:23:12 +01:00 committed by Commit Bot
parent 014112a864
commit 0933c6d49c

View File

@ -329,9 +329,9 @@ class SignalHandler {
sa.sa_sigaction = &HandleProfilerSignal;
sigemptyset(&sa.sa_mask);
#if V8_OS_QNX
sa.sa_flags = SA_SIGINFO;
sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
#else
sa.sa_flags = SA_RESTART | SA_SIGINFO;
sa.sa_flags = SA_RESTART | SA_SIGINFO | SA_ONSTACK;
#endif
signal_handler_installed_ =
(sigaction(SIGPROF, &sa, &old_signal_handler_) == 0);