From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11790 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: possible bug in setjmp implementation for ppc64 Date: Thu, 3 Aug 2017 02:00:03 +0300 (MSK) Message-ID: References: <1501520360.0.593167188853569@go.bunnymail.go> <20170731203007.GB1627@brightrain.aerifal.cx> <20170801051042.GA14914@dora.lan> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1501714823 18960 195.159.176.226 (2 Aug 2017 23:00:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Aug 2017 23:00:23 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) To: musl@lists.openwall.com Original-X-From: musl-return-11803-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 03 01:00:15 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dd2ce-0004Tf-DT for gllmg-musl@m.gmane.org; Thu, 03 Aug 2017 01:00:12 +0200 Original-Received: (qmail 5409 invoked by uid 550); 2 Aug 2017 23:00:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5388 invoked from network); 2 Aug 2017 23:00:14 -0000 In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11790 Archived-At: 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