This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/18080] [s390] setcontext/swapcontext does not restore signal mask
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 28 Apr 2016 08:37:07 +0000
- Subject: [Bug libc/18080] [s390] setcontext/swapcontext does not restore signal mask
- Auto-submitted: auto-generated
- References: <bug-18080-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18080
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, release/2.19/master has been updated
via 05cc5bbd3cf037daee848c11792a6471de01298d (commit)
via aa60d72514a2bc51017edeb0ccdd9904b8c2e745 (commit)
from a02f3e795993ae0f80242b488061b74666605625 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=05cc5bbd3cf037daee848c11792a6471de01298d
commit 05cc5bbd3cf037daee848c11792a6471de01298d
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date: Thu Apr 28 10:21:58 2016 +0200
S390: Fix "backtrace() returns infinitely deep stack frames with
makecontext()" [BZ #18508].
On s390/s390x backtrace(buffer, size) returns the series of called
functions until
"makecontext_ret" and additional entries (up to "size") with
"makecontext_ret".
GDB-backtrace is also warning:
"Backtrace stopped: previous frame identical to this frame (corrupt
stack?)"
To reproduce this scenario you have to setup a new context with
makecontext()
and activate it with setcontext(). See e.g. cf() function in testcase
stdlib/tst-makecontext.c.
Or see bug in libgo "Bug 66303 - runtime.Caller() returns infinitely deep
stack frames
on s390x " (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66303).
This patch omits the cfi_startproc/cfi_endproc directives in ENTRY/END
macro of
__makecontext_ret. Thus no frame information is generated in .eh_frame and
backtrace
stops after __makecontext_ret. There is also no .eh_frame info for _start
or
thread_start functions.
ChangeLog:
[BZ #18508]
* stdlib/Makefile ($(objpfx)tst-makecontext3):
Depend on $(libdl).
* stdlib/tst-makecontext.c (cf): Test if _Unwind_Backtrace
is not called infinitely times.
(backtrace_helper): New function.
(trace_arg): New struct.
(st1): Enlarge stack size.
* sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S:
(__makecontext_ret): Omit cfi_startproc and cfi_endproc.
* sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S:
Likewise.
(cherry picked from commit 890b7a4b33d482b5c768ab47d70758b80227e9bc)
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aa60d72514a2bc51017edeb0ccdd9904b8c2e745
commit aa60d72514a2bc51017edeb0ccdd9904b8c2e745
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date: Thu Apr 28 10:12:05 2016 +0200
S/390: Fix setcontext/swapcontext which are not restoring sigmask. [BZ
#18080]
This patch uses sigprocmask(SIG_SETMASK) instead of SIG_BLOCK
in setcontext, swapcontext.
(cherry picked from commit 2e807f29595eb5b1e5d0decc6e356a3562ecc58e)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 31 +++
NEWS | 2 +-
stdlib/Makefile | 12 +-
stdlib/tst-makecontext.c | 41 ++++-
stdlib/tst-setcontext2.c | 230 ++++++++++++++++++++
.../sysv/linux/s390/s390-32/__makecontext_ret.S | 8 +
sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S | 2 +-
sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S | 16 +-
.../sysv/linux/s390/s390-64/__makecontext_ret.S | 8 +
sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S | 2 +-
sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S | 16 +-
11 files changed, 337 insertions(+), 31 deletions(-)
create mode 100644 stdlib/tst-setcontext2.c
--
You are receiving this mail because:
You are on the CC list for the bug.