From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8519 Path: news.gmane.org!not-for-mail From: u-wsnj@aetey.se Newsgroups: gmane.linux.lib.musl.general Subject: pthread_getattr_np() vs explicit runtime loader Date: Sun, 20 Sep 2015 08:39:09 +0200 Message-ID: <20150920063909.GO12087@example.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1442731203 29332 80.91.229.3 (20 Sep 2015 06:40:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Sep 2015 06:40:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8531-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 20 08:40:01 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZdYI3-0003Mq-RH for gllmg-musl@m.gmane.org; Sun, 20 Sep 2015 08:39:59 +0200 Original-Received: (qmail 22232 invoked by uid 550); 20 Sep 2015 06:39:56 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 22061 invoked from network); 20 Sep 2015 06:39:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fripost.org; h= content-disposition:content-type:content-type:mime-version :message-id:subject:subject:from:from:date:date; s=20140703; t= 1442731176; x=1444545577; bh=tVDMHDKXxywms7OFzcJqMgoQkDUZPShNqTz z6PfXgZc=; b=KLbY6llUQO7HW5gcE2xAk8OJGXTUJug91ehyL6nqolpAxBM7IrS zEZXZLblqNdX4lKuKxwlkymEYmzfZqyTb6TvBWqep8LMslXccWpEhZYXv0215FMo Byr/2Cf3BNkSkFL8YzGZa662z5ZE7goUla35LkxdOlliZNcbAX5GgTRg= X-Virus-Scanned: Debian amavisd-new at fripost.org Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:8519 Archived-At: Hello, musl 1.1.8 on ia32 Linux, building gcc 5.2.0 succeeds. Nevertheless a subset of the resulting executables segfault when run by an explicit loader (which is the vital mode of operation in our setups). They do not seem to segfault when using the implicit loader which suggests the result depends on the memory mapping layout. Moreover, the last syscalls seen before the crash are mremap(), presumably reflecting that pthread_getattr_np() is involved. It looks like (according to a discussion in mail archives) the logic in this function makes assumptions which not necessarily are true while using an explicit runtime loader. Would you comment on whether this guess is correct and hopefully make pthread_getattr_np() work even with the explicit loader? The strace examples limited to mremap() follow. The same files and libraries are being used, also the same loader path is used explicitly as embedded in the executable. ----------------------------------------------------------------- $ strace -e mremap \ /..../ --library-path ... /..../jv-convert --help mremap(0xffffc000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffffb000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffffa000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff9000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff8000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff7000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff6000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff5000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff4000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff3000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff2000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff1000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff0000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffef000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffee000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffed000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffec000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffeb000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffea000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe9000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe8000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe7000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe6000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe5000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe4000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe3000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe2000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe1000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe0000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdf000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffde000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdd000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdc000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdb000, 4096, 8192, 0) = -1 EFAULT (Bad address) --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 30289 detached ----------------------------------------------------------------- $ LD_LIBRARY_PATH=... strace -e mremap /..../jv-convert --help mremap(0xffffc000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffffb000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffffa000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff9000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff8000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff7000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff6000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff5000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff4000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff3000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff2000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff1000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xffff0000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffef000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffee000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffed000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffec000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffeb000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffea000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe9000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe8000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe7000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe6000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe5000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe4000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe3000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe2000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe1000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffe0000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdf000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffde000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdd000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdc000, 4096, 8192, 0) = -1 ENOMEM (Cannot allocate memory) mremap(0xfffdb000, 4096, 8192, 0) = -1 EFAULT (Bad address) Usage: jv-convert [OPTIONS] [INPUTFILE [OUTPUTFILE]] Convert from one encoding to another. --encoding FROM --from FROM use FROM as source encoding name --to TO use TO as target encoding name -i FILE read from FILE -o FILE print output to FILE --reverse swap FROM and TO encodings --help print this help, then exit --version print version number, then exit `-' as a file name argument can be used to refer to stdin or stdout. Process 30291 detached ----------------------------------------------------------------- Regards, Rune