Skip to content

Commit 9e79919

Browse files
fixup! fixup! [libunwind] Replace process_vm_readv with pipe
1 parent 058521c commit 9e79919

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libunwind/src/UnwindCursor.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,11 +2980,11 @@ bool UnwindCursor<A, R>::isReadableAddr(const pint_t addr) const {
29802980
// We MUST use a raw syscall here, as wrappers may try to access
29812981
// sigsetAddr which may cause a SIGSEGV. A raw syscall however is
29822982
// safe. Additionally, we need to pass the kernel_sigset_size, which is
2983-
// different from libc sizeof(sigset_t). 8 seems to work for both 64bit and
2984-
// 32bit archs.
2985-
const auto approxKernelSigsetSize = 8;
2986-
int Result = syscall(SYS_rt_sigprocmask, /*how=*/~0, sigsetAddr, nullptr,
2987-
approxKernelSigsetSize);
2983+
// different from libc sizeof(sigset_t). For the majority of architectures,
2984+
// it's 64 bits (_NSIG), and libc NSIG is _NSIG + 1.
2985+
const auto kernelSigsetSize = NSIG / 8;
2986+
const int Result = syscall(SYS_rt_sigprocmask, /*how=*/~0, sigsetAddr,
2987+
nullptr, kernelSigsetSize);
29882988
(void)Result;
29892989
// Because our "how" is invalid, this syscall should always fail, and our
29902990
// errno should always be EINVAL or an EFAULT. EFAULT is not guaranteed

0 commit comments

Comments
 (0)