]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make soft-float powerpc swapcontext restore the signal mask (bug 21045).
authorJoseph Myers <joseph@codesourcery.com>
Mon, 16 Jan 2017 21:34:48 +0000 (21:34 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 16 Jan 2017 21:34:48 +0000 (21:34 +0000)
The soft-float powerpc version of swapcontext does not restore the
signal mask, resulting in stdlib/tst-setcontext2 failing:

after getcontext
after setcontext
after swapcontext
FAIL: SIGUSR2 is blocked after swapcontext.

This patch fixes this by adjusting the arguments passed to
__sigprocmask so that it restores the saved signal mask as well as
saving the existing one.  (For hard-float, this code is only used for
a compat symbol, not for the current version of swapcontext.)

Tested for soft-float powerpc.

[BZ #21045]
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
(__CONTEXT_FUNC_NAME): Pass address of signal mask to be restored
to __sigprocmask.

ChangeLog
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S

index 9498803f7fba461e72f233ffce302a9d3041785f..66ce72be9b58cbcbfb35a48b5021b0e2868ae13a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-16  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #21045]
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+       (__CONTEXT_FUNC_NAME): Pass address of signal mask to be restored
+       to __sigprocmask.
+
 2017-01-16  Chris Metcalf  <cmetcalf@mellanox.com>
 
        * sysdeps/tile/tilegx/memchr.c (__memchr): Handle pointer
index a0bcbf157e7f9b75c2565325348d7f543f85f01d..6696d540dcbe4f09782cd3d4ee0fa663bb45444e 100644 (file)
@@ -271,7 +271,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 /* Restore ucontext (parm1) from stack.  */
        lwz     r12,_FRAME_PARM_SAVE1(r1)
-       li      r4,0
+       lwz     r4,_FRAME_PARM_SAVE2(r1)
+       addi    r4,r4,_UC_SIGMASK
        stw     r3,_UC_REGS_PTR(r12)
        addi    r5,r12,_UC_SIGMASK
        li      r3,SIG_SETMASK