155125 avoid cutting away file:lineno after long function name
197259 Unsupported arch_prtctl PR_SET_GS option
201152 ppc64: Assertion in ppc32g_dirtyhelper_MFSPR_268_269
+201216 Fix Valgrind does not support pthread_sigmask() on OS X
201435 Fix Darwin: -v does not show kernel version
208217 "Warning: noted but unhandled ioctl 0x2000747b" on Mac OS X
211256 Fixed an outdated comment regarding the default platform.
L_$0_1: /* Even though we can't take a signal until the
__pthread_sigmask completes, start the range early.
- If eip is in the range [1,2), the syscall hasn't been started yet */
+ If eip is in the range [1,2), the syscall hasn't been started yet */
- /* Set the signal mask which should be current during the syscall. */
+ /* Set the signal mask which should be current during the syscall. */
/* Set up for __pthread_sigmask(SIG_SETMASK, sysmask, postmask) */
pushl 20(%ebp)
pushl 16(%ebp)
PRE(__pthread_sigmask)
{
- // GrP fixme
- // JRS: arguments are identical to sigprocmask
- // (how, sigset_t*, sigset_t*). Perhaps behave identically?
- log_decaying("UNKNOWN __pthread_sigmask is unsupported.");
- SET_STATUS_Success( 0 );
+ // arguments are identical to sigprocmask (how, sigset_t*, sigset_t*).
+ UWord arg1;
+ PRINT("__pthread_sigmask ( %ld, %#lx, %#lx )", ARG1, ARG2, ARG3);
+ PRE_REG_READ3(long, "__pthread_sigmask",
+ int, how, vki_sigset_t *, set, vki_sigset_t *, oldset);
+ if (ARG2 != 0)
+ PRE_MEM_READ( "__pthread_sigmask(set)", ARG2, sizeof(vki_sigset_t));
+ if (ARG3 != 0)
+ PRE_MEM_WRITE( "__pthread_sigmask(oldset)", ARG3, sizeof(vki_sigset_t));
+
+ /* Massage ARG1 ('how'). If ARG2 (the new mask) is NULL then the
+ value of 'how' is irrelevant, and it appears that Darwin's libc
+ passes zero, which is not equal to any of
+ SIG_{BLOCK,UNBLOCK,SETMASK}. This causes
+ VG_(do_sys_sigprocmask) to complain, since it checks the 'how'
+ value independently of the other args. Solution: in this case,
+ simply pass a valid (but irrelevant) value for 'how'. */
+ /* Also, in this case the new set is passed to the kernel by
+ reference, not value, as in some other sigmask related Darwin
+ syscalls. */
+ arg1 = ARG1;
+ if (ARG2 == 0 /* the new-set is NULL */
+ && ARG1 != VKI_SIG_BLOCK
+ && ARG1 != VKI_SIG_UNBLOCK && ARG1 != VKI_SIG_SETMASK) {
+ arg1 = VKI_SIG_SETMASK;
+ }
+ SET_STATUS_from_SysRes(
+ VG_(do_sys_sigprocmask) ( tid, arg1, (vki_sigset_t*)ARG2,
+ (vki_sigset_t*)ARG3 )
+ );
+
+ if (SUCCESS)
+ *flags |= SfPollAfter;
+}
+POST(__pthread_sigmask)
+{
+ vg_assert(SUCCESS);
+ if (RES == 0 && ARG3 != 0)
+ POST_MEM_WRITE( ARG3, sizeof(vki_sigset_t));
}
GO(__NR___pthread_kill, 328, "2s 0m");
SY(__NR___pthread_kill, x0, x0); FAIL;
- // __NR___pthread_sigmask 329
+ GO(__NR___pthread_sigmask, 329, "3s 0m");
+ SY(__NR___pthread_sigmask, x0, x0, x0); SUCC;
+
// __NR___sigwait 330
// __NR_sigwait 330) // GrP fixme hack
// __NR___disable_threadsignal 331
Syscall param __pthread_kill(sig) contains uninitialised byte(s)
...
+-----------------------------------------------------
+x2000149(329):__NR___pthread_sigmask 3s 0m
+-----------------------------------------------------
+Syscall param __pthread_sigmask(set) contains uninitialised byte(s)
+ ...
+
+Syscall param __pthread_sigmask(oldset) contains uninitialised byte(s)
+ ...
+
-----------------------------------------------------
(335): old utrace
-----------------------------------------------------