mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: possible bug in setjmp implementation for ppc64
Date: Thu, 3 Aug 2017 02:00:03 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.20.13.1708030154550.12138@monopod.intra.ispras.ru> (raw)
In-Reply-To: <CAGWvnyn8WVVc28W=HY=Q86O7RVCuF8HRNx2D5BbDY=dhfCMfGw@mail.gmail.com>

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.
Alexander


  reply	other threads:[~2017-08-02 23:00 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 [this message]
2017-08-02 23:02         ` Rich Felker

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=alpine.LNX.2.20.13.1708030154550.12138@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --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).