mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: webkitfltk segfaults in do_relocs
Date: Wed, 19 Nov 2014 15:56:35 -0500	[thread overview]
Message-ID: <20141119205635.GO22465@brightrain.aerifal.cx> (raw)
In-Reply-To: <20141119202001.GA18169@newbook>

On Wed, Nov 19, 2014 at 12:20:02PM -0800, Isaac Dunham wrote:
> On Wed, Nov 19, 2014 at 02:58:24PM -0500, Rich Felker wrote:
> > On Wed, Nov 19, 2014 at 11:48:28AM -0800, Isaac Dunham wrote:
> > > On Wed, Nov 19, 2014 at 02:13:11PM -0500, Rich Felker wrote:
> > > > It looks like it's trying to apply a relocation to a read-only part of
> > > > the mapping. Could you provide the output of readelf -a testapp? That
> > > > would let me get an idea what's going on. It's probably too big to
> > > > send as an attachment raw but compressing it with gzip will probably
> > > > make it okay, or you could just send a link to a pastebin or similar
> > > > (sprunge.us preferred).
> > > That's 31.1 MB, over four and a half gzipped, 2.1 MB XZ-compressed.
> > > 
> > > Not sure how to proceed.
> > 
> > Uhg. Do you have anywhere you can upload it and provide a link?
> > 
> > Rich
> > 
> 
> https://www.dropbox.com/s/2e9f91zclw5liei/wkfltk-readelf-a.xz?dl=1
> (unfortunately, you may need a browser).

Got it. The line number in your original report seems to be off by a
bit (it points to TLSDESC related cases) but I've found the offending
relocation(s):

0083deea  0000c402 R_386_PC32        00000000   exp
0083df03  00010a02 R_386_PC32        00000000   log
0083df1c  00030502 R_386_PC32        00000000   floor
0083df35  00024502 R_386_PC32        00000000   ceil

I have no idea why the linker is emitting these. It should have
resolved them at ld time to PLT entries in the main program's PLT, but
maybe since you're building as PIE (this is defautl on Alpine) that
doesn't happen (this would be a linker bug, IMO). If it were going
to do this (leave the relocations in the output), it should mark the
program as DT_TEXTREL (having textrels), but this is probably
suppressed for PIE because it's not supposed to happen.

My best guess as to what's triggering the problem is that there's some
nasty asm or other hacks that are not PIE-compatible somewhere in the
program. It's also possible that you're pulling in static libraries
(which would not be PIE-compatible) due to not having the dynamic
version of a needed library installed.

Finding which .o or .a file these references to exp/log/floor/ceil are
coming from would help narrow down the source of the problem.
Alternatively you could try building as non-PIE.

Rich


  reply	other threads:[~2014-11-19 20:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 16:44 Isaac Dunham
2014-11-19 16:50 ` Rich Felker
2014-11-19 19:04   ` Isaac Dunham
2014-11-19 19:13     ` Rich Felker
2014-11-19 19:48       ` Isaac Dunham
2014-11-19 19:58         ` Rich Felker
2014-11-19 20:20           ` Isaac Dunham
2014-11-19 20:56             ` Rich Felker [this message]
2014-11-19 22:43               ` Isaac Dunham
2014-11-20  6:14                 ` Timo Teras
2014-11-22  5:24 ` webkitfltk segfaults in do_relocs (partly solved) Isaac Dunham

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=20141119205635.GO22465@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).