Commit c41b0205 authored by Vasili Skurydzin's avatar Vasili Skurydzin Committed by V8 LUCI CQ

Aix: Prevent main thread from getting terminated with SIGPROF when

profiling is enabled

Bug: v8:12952

Change-Id: Ie3c3de71c5ca4be8256ac87e60b183bc45e47cf6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3696481Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Cr-Commit-Position: refs/heads/main@{#81075}
parent 77ba98ef
......@@ -19,7 +19,11 @@
#include <sys/syscall.h>
#endif
#if V8_OS_DARWIN
#if V8_OS_AIX
#include "src/base/platform/time.h"
#elif V8_OS_DARWIN
#include <mach/mach.h>
// OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h>
// and is a typedef for struct sigcontext. There is no uc_mcontext.
......@@ -343,8 +347,14 @@ class SignalHandler {
static void Restore() {
if (signal_handler_installed_) {
sigaction(SIGPROF, &old_signal_handler_, nullptr);
signal_handler_installed_ = false;
#if V8_OS_AIX
// On Aix & IBMi, SIGPROF can sometimes arrive after the default signal
// handler is restored, resulting in intermittent test failure when
// profiling is enabled (https://crbug.com/v8/12952)
base::OS::Sleep(base::TimeDelta::FromMicroseconds(10));
#endif
sigaction(SIGPROF, &old_signal_handler_, nullptr);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment