This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/18125] aarch64: arm: nios2: hppa: setcontext incorrectly calls _exit after last linked context.
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 08 May 2015 15:30:42 +0000
- Subject: [Bug libc/18125] aarch64: arm: nios2: hppa: setcontext incorrectly calls _exit after last linked context.
- Auto-submitted: auto-generated
- References: <bug-18125-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18125
--- Comment #1 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, master has been updated
via c92d40c0bcfdeec96848d1e67902e621942144e9 (commit)
from a6d78c3b9dc9bf598a60be18e23bf8fe7668a088 (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=c92d40c0bcfdeec96848d1e67902e621942144e9
commit c92d40c0bcfdeec96848d1e67902e621942144e9
Author: Carlos O'Donell <carlos@systemhalted.org>
Date: Fri May 8 11:20:32 2015 -0400
Bug 18125: Call exit after last linked context.
There appears to be a discrepancy among the implementations
of setcontext with regards to the function called once the last
linked-to context has finished executing via setcontext.
The POSIX standard says:
~~~
If the uc_link member of the ucontext_t structure pointed to by
the ucp argument is equal to 0, then this context is the main
context, and the thread will exit when this context returns.
~~~
It says "exit" not "exit immediately" nor "exit without running
functions registered with atexit or on_exit."
Therefore the AArch64, ARM, hppa and NIOS II implementations are
wrong and no test detects it.
It is questionable if this should even be fixed or just documented
that the above 4 targets are wrong. The functions are deprecated
and nobody should be using them, but at the same time it silly to
have cross-target differences that make it hard to port old
applications from say x86_64 to AArch64.
Therefore I will ix the 4 arches, and checkin a regression
test to prevent it from changing again.
https://sourceware.org/ml/libc-alpha/2015-03/msg00720.html
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 13 +++
NEWS | 18 ++--
stdlib/Makefile | 9 ++-
stdlib/tst-setcontext3.c | 138 ++++++++++++++++++++++++++
stdlib/tst-setcontext3.sh | 54 ++++++++++
sysdeps/unix/sysv/linux/aarch64/setcontext.S | 2 +-
sysdeps/unix/sysv/linux/arm/setcontext.S | 2 +-
sysdeps/unix/sysv/linux/hppa/setcontext.S | 3 +-
sysdeps/unix/sysv/linux/nios2/setcontext.S | 6 +-
9 files changed, 229 insertions(+), 16 deletions(-)
create mode 100644 stdlib/tst-setcontext3.c
create mode 100644 stdlib/tst-setcontext3.sh
--
You are receiving this mail because:
You are on the CC list for the bug.