From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: possible bug in setjmp implementation for ppc64
Date: Wed, 2 Aug 2017 19:02:57 -0400 [thread overview]
Message-ID: <20170802230257.GL1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1708030154550.12138@monopod.intra.ispras.ru>
On Thu, Aug 03, 2017 at 02:00:03AM +0300, Alexander Monakov wrote:
> On Tue, 1 Aug 2017, David Edelsohn wrote:
> > "If glibc is built as a static library, the contents of r2 are saved
> > in the jmp_buf; but if glibc is built as a dynamic library, the
> > contents of the TOC save slot is saved in the jmp_buf. Similarly, if
> > glibc is built as a dynamic library, longjmp *updates* the TOC save
> > slot with the r2 value from the jmp_buf before returning."
> >
> > GLIBC setjmp/longjmp code explicitly differs for shared and static
> > versions of the library. Musl libc needs equivalent functionality in
> > its implementation.
>
> Note that since Glibc also supports static dlopen, it is possible to arrive
> at a situation where libc.a longjmp is used for returning to a call site
> of libc.so setjmp, in which case TOC save slot is not restored as it
> ought to be, and the caller of setjmp segfaults. A testcase is available at
> https://sourceware.org/bugzilla/show_bug.cgi?id=21895
Thanks for investigating and writing this up.
Rich
prev parent reply other threads:[~2017-08-02 23:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 20:06 felix.winkelmann
2017-07-31 20:30 ` Rich Felker
2017-08-01 5:10 ` Bobby Bingham
2017-08-01 5:28 ` Alexander Monakov
2017-08-01 22:45 ` Rich Felker
2017-08-01 23:07 ` Rich Felker
2017-08-02 0:28 ` Bobby Bingham
2017-08-02 3:55 ` Rich Felker
2017-08-02 4:31 ` Bobby Bingham
2017-08-02 4:58 ` Rich Felker
2017-08-02 13:38 ` Bobby Bingham
2017-08-02 14:46 ` Rich Felker
2017-08-03 0:19 ` Bobby Bingham
2017-08-01 15:33 ` David Edelsohn
2017-08-02 23:00 ` Alexander Monakov
2017-08-02 23:02 ` Rich Felker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170802230257.GL1627@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).