This is the mail archive of the 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.


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

The corresponding sigprocmask calls in files:
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?


2015-03-04  Stefan Liebler  <>

	[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]