This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][BZ #18080] S390: Fix setcontext/swapcontext which are not restoring sigmask.


Hi,

on s390/s390x, a call to setcontext or swapcontext does not restore the signal mask.
This can be reproduced with the following pseudocode:
-getcontext()
-block signal with sigprocmask
-setcontext()
-signal shouldnÂt be blocked anymore.

The corresponding sigprocmask calls in files:
sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
are using SIG_BLOCK instead of SIG_SETMASK.

This patch fixes this behaviour and adds a new testcase,
which checks signal mask after setcontext()/swapcontext() calls
and checks, if a pending signal was delivered after those calls.

Testsuite runs without regression on s390 and checked if new testcase passes on x86_64.

Ok to commit?

Bye
Stefan

---
2015-03-04  Stefan Liebler  <stli@linux.vnet.ibm.com>

	[BZ #18080]
	* sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
	(__setcontext): Use SIG_SETMASK instead of SIG_BLOCK.
	* sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
	(__swapcontext): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
	(__setcontext): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
	(__swapcontext): Likewise.
	* stdlib/Makefile (tests): Add new testcase tst-setcontext2.
	* stdlib/tst-setcontext2.c: New file.

Attachment: setcontext_20150304
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]