mailing list of musl libc
 help / color / mirror / code / Atom feed
* webkitfltk segfaults in do_relocs
@ 2014-11-19 16:44 Isaac Dunham
  2014-11-19 16:50 ` Rich Felker
  2014-11-22  5:24 ` webkitfltk segfaults in do_relocs (partly solved) Isaac Dunham
  0 siblings, 2 replies; 11+ messages in thread
From: Isaac Dunham @ 2014-11-19 16:44 UTC (permalink / raw)
  To: musl, alpine-devel

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

Hello,
I've been trying to get WebkitFLTK[1] working on Alpine, and I have it
building.
But as usual, that's the easy part. The test program, 
Source/WebKit/fltk/testapp/testapp, segfaults in do_relocs.
I'm attaching the output of bt full.

Build dependencies include:
g++ >= 4.7.3
python2 perl ruby 
icu-dev cairo-dev harfbuzz-dev libxslt-dev sqlite-dev fltk-dev

harfbuzz must be built with ICU, as alpine does; fltk must be 1.3.3
or later; Alpine provides python2 as python.

Build directions are in README.asciidoc, and amount to:
make -C Source/WTF/wtf && \
make -C Source/JavaScriptCore gen && \
make -C Source/JavaScriptCore && \
make -C Source/WebCore && \
make -C Source/WebKit/fltk


Additionally, at least a gig of RAM per thread will be needed,
and a very fast processor or lots of time.
On my laptop with an Atom N270 and a gigabyte of ram, I get 
occasional swap thrashing, and the compilation takes a little over
11 hours.

So if someone who has a faster system can look at this, I'd be
grateful.

Thank you,
Isaac Dunham

[1] https://github.com/clbr/webkitfltk

[-- Attachment #2: wkfltk.bt --]
[-- Type: text/plain, Size: 5037 bytes --]

(gdb) bt full
#0  0xb7f98b58 in do_relocs (dso=dso@entry=0xb7ffd570 <builtin_dsos.4209>, 
    rel=0x5440ac, rel_size=23504, stride=2) at src/ldso/dynlink.c:365
        base = 0x400000 "\177ELF\001\001\001"
        syms = 0x402730
        strings = 0x407db0 ""
        sym = 0x403bb0
        name = 0x408d0f "exp"
        ctx = <optimized out>
        astype = <optimized out>
        sym_index = <optimized out>
        def = {sym = <optimized out>, dso = 0xb7ffd610 <builtin_dsos.4209+160>}
        reloc_addr = 0xc45f10 <expThunk+9>
        sym_val = <optimized out>
        tls_val = 163891
        addend = <optimized out>
#1  0xb7f98cb3 in reloc_all (p=p@entry=0xb7ffd570 <builtin_dsos.4209>)
    at src/ldso/dynlink.c:895
        dyn = {201243774, 14263, 6128, 48558780, 364, 32176, 10032, 0, 0, 0, 
          32242, 16, 1356908, 23348355, 0, 30905, 0, 67428, 1283352, 8, 17, 
          3086997596, 0, 1350780, 0, 47786180, 0, 84, 0, 0, 0, 0, 0, 0}
#2  0xb7f997c1 in __dynlink (argc=1, argv=<optimized out>)
    at src/ldso/dynlink.c:1308
        aux = {2189687800, 0, 0, 4194356, 32, 9, 4096, 3086458880, 0, 5569354, 
---Type <return> to continue, or q <return> to quit---
          0, 1000, 1000, 1000, 1000, 3221224859, 3219782647, 100, 0, 0, 0, 0, 
          0, 0, 0, 3221224843, 0, 0, 0, 0, 0, 3221225402, 3086455840, 
          3086454784, 0, 0, 0, 0}
        i = <optimized out>
        phdr = <optimized out>
        ehdr = <optimized out>
        builtin_dsos = {{base = 0x400000 "\177ELF\001\001\001", 
            name = 0xbfffffba "/home/idunham/src/webkitfltk/Source/WebKit/fltk/testapp/./testapp", dynv = 0x324f124, next = 0x32669a0, prev = 0x0, 
            phdr = 0x400034, phnum = 9, phentsize = 32, refcnt = 0, 
            syms = 0x402730, hashtab = 0x40016c, ghashtab = 0x0, 
            versym = 0x40fba2, strings = 0x407db0 "", 
            map = 0x400000 "\177ELF\001\001\001", map_len = 48656384, dev = 0, 
            ino = 0, global = 1 '\001', relocated = 0 '\000', 
            constructed = 0 '\000', kernel_mapped = 1 '\001', deps = 0x0, 
            needed_by = 0x0, rpath_orig = 0x40f669 "/usr/lib", 
            rpath = 0x40f669 "/usr/lib", tls_image = 0x31928c4, tls_len = 0, 
            tls_size = 16, tls_align = 4, tls_id = 1, tls_offset = 16, 
            relro_start = 47783936, relro_end = 48562176, new_dtv = 0x0, 
            new_tls = 0x0, new_dtv_idx = 0, new_tls_idx = 0, td_index = 0x0, 
            fini_next = 0x0, shortname = 0x0, 
            buf = 0xb7ffd610 <builtin_dsos.4209+160> ""}, {
            base = 0xb7f7a000 "\177ELF\001\001\001", 
---Type <return> to continue, or q <return> to quit---
            name = 0x400154 "/lib/ld-musl-i386.so.1", dynv = 0xb7ffceec, 
            next = 0xb7ffd6b0 <builtin_dsos.4209+320>, prev = 0xb5a55e50, 
            phdr = 0xb7f7a034, phnum = 6, phentsize = 32, refcnt = 0, 
            syms = 0xb7f803d0, hashtab = 0xb7f7a0f4, ghashtab = 0xb7f7ce60, 
            versym = 0x0, strings = 0xb7f878f0 "", 
            map = 0xb7f7a000 "\177ELF\001\001\001", map_len = 548864, dev = 0, 
            ino = 0, global = 1 '\001', relocated = 1 '\001', 
            constructed = 0 '\000', kernel_mapped = 1 '\001', deps = 0x0, 
            needed_by = 0x0, rpath_orig = 0x0, rpath = 0x0, tls_image = 0x0, 
            tls_len = 0, tls_size = 0, tls_align = 0, tls_id = 0, 
            tls_offset = 0, relro_start = 532480, relro_end = 536576, 
            new_dtv = 0x0, new_tls = 0x0, new_dtv_idx = 0, new_tls_idx = 0, 
            td_index = 0x0, fini_next = 0x0, shortname = 0xb7fd7b87 "libc.so", 
            buf = 0xb7ffd6b0 <builtin_dsos.4209+320> ""}, {
            base = 0xb7f7b000 "", name = 0xb7fd7eee "", dynv = 0xb7f79308, 
            next = 0xb5a55f10, prev = 0xb7ffd610 <builtin_dsos.4209+160>, 
            phdr = 0xb7f79034, phnum = 4, phentsize = 32, refcnt = 0, 
            syms = 0xb7f790dc, hashtab = 0xb7f790b4, ghashtab = 0x0, 
            versym = 0xb7f79182, strings = 0xb7f7912c "", map = 0x0, 
            map_len = 0, dev = 0, ino = 0, global = 1 '\001', 
            relocated = 1 '\001', constructed = 0 '\000', 
            kernel_mapped = 0 '\000', deps = 0x0, needed_by = 0x0, 
            rpath_orig = 0x0, rpath = 0x0, tls_image = 0x0, tls_len = 0, 
---Type <return> to continue, or q <return> to quit---
            tls_size = 0, tls_align = 0, tls_id = 0, tls_offset = 0, 
            relro_start = 0, relro_end = 0, new_dtv = 0x0, new_tls = 0x0, 
            new_dtv_idx = 0, new_tls_idx = 0, td_index = 0x0, fini_next = 0x0, 
            shortname = 0xb7fd7c4c "linux-gate.so.1", 
            buf = 0xb7ffd750 <builtin_tls> ""}}
        app = 0xb7ffd570 <builtin_dsos.4209>
        lib = 0xb7ffd610 <builtin_dsos.4209+160>
        vdso = 0xb7ffd6b0 <builtin_dsos.4209+320>
        env_preload = <optimized out>
        vdso_base = <optimized out>
        auxv = <optimized out>
        envp = 0xbffffc8c
        initial_tls = <optimized out>
#3  0xb7f9a1fc in _dlstart () at src/ldso/i386/start.s:12

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 16:44 webkitfltk segfaults in do_relocs Isaac Dunham
@ 2014-11-19 16:50 ` Rich Felker
  2014-11-19 19:04   ` Isaac Dunham
  2014-11-22  5:24 ` webkitfltk segfaults in do_relocs (partly solved) Isaac Dunham
  1 sibling, 1 reply; 11+ messages in thread
From: Rich Felker @ 2014-11-19 16:50 UTC (permalink / raw)
  To: Isaac Dunham; +Cc: musl, alpine-devel

On Wed, Nov 19, 2014 at 08:44:15AM -0800, Isaac Dunham wrote:
> Hello,
> I've been trying to get WebkitFLTK[1] working on Alpine, and I have it
> building.
> But as usual, that's the easy part. The test program, 
> Source/WebKit/fltk/testapp/testapp, segfaults in do_relocs.
> I'm attaching the output of bt full.

Could you also provide a disassembly and register dump at the point of
crash?

Rich


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 16:50 ` Rich Felker
@ 2014-11-19 19:04   ` Isaac Dunham
  2014-11-19 19:13     ` Rich Felker
  0 siblings, 1 reply; 11+ messages in thread
From: Isaac Dunham @ 2014-11-19 19:04 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl, alpine-devel

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

On Wed, Nov 19, 2014 at 11:50:50AM -0500, Rich Felker wrote:
> On Wed, Nov 19, 2014 at 08:44:15AM -0800, Isaac Dunham wrote:
> > Hello,
> > I've been trying to get WebkitFLTK[1] working on Alpine, and I have it
> > building.
> > But as usual, that's the easy part. The test program, 
> > Source/WebKit/fltk/testapp/testapp, segfaults in do_relocs.
> > I'm attaching the output of bt full.
> 
> Could you also provide a disassembly and register dump at the point of
> crash?
> 
Attaching output of gdb disassemble and info all-registers.

It's segfaulting "at line 365 of src/ldso/dynlink.c", for what that's worth.

I'm providing the link command as well in case the problem is there.

Thanks,
Isaac Dunham

[-- Attachment #2: wkfltk-disasm-registers.txt --]
[-- Type: text/plain, Size: 14230 bytes --]

(gdb) disassemble
Dump of assembler code for function do_relocs:
   0xb7f989ae <+0>:	push   %ebp
   0xb7f989af <+1>:	mov    %esp,%ebp
   0xb7f989b1 <+3>:	push   %edi
   0xb7f989b2 <+4>:	push   %esi
   0xb7f989b3 <+5>:	push   %ebx
   0xb7f989b4 <+6>:	sub    $0x4c,%esp
   0xb7f989b7 <+9>:	mov    (%eax),%esi
   0xb7f989b9 <+11>:	mov    %eax,-0x28(%ebp)
   0xb7f989bc <+14>:	call   0xb7f8bf0c <__x86.get_pc_thunk.bx>
   0xb7f989c1 <+19>:	add    $0x645bb,%ebx
   0xb7f989c7 <+25>:	mov    %edx,-0x30(%ebp)
   0xb7f989ca <+28>:	mov    %esi,-0x38(%ebp)
   0xb7f989cd <+31>:	mov    0x24(%eax),%esi
   0xb7f989d0 <+34>:	mov    0x34(%eax),%eax
   0xb7f989d3 <+37>:	mov    %esi,-0x4c(%ebp)
   0xb7f989d6 <+40>:	mov    %eax,-0x50(%ebp)
   0xb7f989d9 <+43>:	mov    0xc(%ebp),%eax
   0xb7f989dc <+46>:	shl    $0x2,%eax
   0xb7f989df <+49>:	mov    %eax,-0x54(%ebp)
   0xb7f989e2 <+52>:	cmpl   $0x0,0x8(%ebp)
   0xb7f989e6 <+56>:	je     0xb7f98c17 <do_relocs+617>
   0xb7f989ec <+62>:	mov    -0x30(%ebp),%eax
   0xb7f989ef <+65>:	mov    0x4(%eax),%eax
   0xb7f989f2 <+68>:	movzbl %al,%edx
   0xb7f989f5 <+71>:	test   %edx,%edx
   0xb7f989f7 <+73>:	je     0xb7f98c09 <do_relocs+603>
   0xb7f989fd <+79>:	lea    -0x1(%edx),%ecx
   0xb7f98a00 <+82>:	cmp    $0x28,%ecx
   0xb7f98a03 <+85>:	ja     0xb7f98a14 <do_relocs+102>
   0xb7f98a05 <+87>:	movsbl -0x2520d(%edx,%ebx,1),%ecx
   0xb7f98a0d <+95>:	test   %ecx,%ecx
   0xb7f98a0f <+97>:	mov    %cl,-0x48(%ebp)
   0xb7f98a12 <+100>:	jne    0xb7f98a24 <do_relocs+118>
   0xb7f98a14 <+102>:	push   %eax
   0xb7f98a15 <+103>:	mov    -0x28(%ebp),%eax
   0xb7f98a18 <+106>:	push   %edx
   0xb7f98a19 <+107>:	pushl  0x4(%eax)
   0xb7f98a1c <+110>:	lea    -0x254dd(%ebx),%eax
   0xb7f98a22 <+116>:	jmp    0xb7f98a9b <do_relocs+237>
---Type <return> to continue, or q <return> to quit---
   0xb7f98a24 <+118>:	mov    -0x30(%ebp),%edx
   0xb7f98a27 <+121>:	mov    -0x38(%ebp),%esi
   0xb7f98a2a <+124>:	add    (%edx),%esi
   0xb7f98a2c <+126>:	shr    $0x8,%eax
   0xb7f98a2f <+129>:	je     0xb7f98aa9 <do_relocs+251>
   0xb7f98a31 <+131>:	shl    $0x4,%eax
   0xb7f98a34 <+134>:	mov    -0x50(%ebp),%edx
   0xb7f98a37 <+137>:	add    -0x4c(%ebp),%eax
   0xb7f98a3a <+140>:	add    (%eax),%edx
   0xb7f98a3c <+142>:	cmp    $0x7,%ecx
   0xb7f98a3f <+145>:	mov    %eax,-0x2c(%ebp)
   0xb7f98a42 <+148>:	mov    %edx,-0x34(%ebp)
   0xb7f98a45 <+151>:	mov    0x948(%ebx),%edx
   0xb7f98a4b <+157>:	jne    0xb7f98a50 <do_relocs+162>
   0xb7f98a4d <+159>:	mov    0xc(%edx),%edx
   0xb7f98a50 <+162>:	cmp    $0x3,%ecx
   0xb7f98a53 <+165>:	sete   %cl
   0xb7f98a56 <+168>:	push   %edi
   0xb7f98a57 <+169>:	movzbl %cl,%ecx
   0xb7f98a5a <+172>:	push   %edi
   0xb7f98a5b <+173>:	push   %ecx
   0xb7f98a5c <+174>:	pushl  -0x34(%ebp)
   0xb7f98a5f <+177>:	lea    -0x20(%ebp),%eax
   0xb7f98a62 <+180>:	call   0xb7f9889f <find_sym>
   0xb7f98a67 <+185>:	mov    -0x20(%ebp),%eax
   0xb7f98a6a <+188>:	add    $0x10,%esp
   0xb7f98a6d <+191>:	mov    -0x1c(%ebp),%edx
   0xb7f98a70 <+194>:	test   %eax,%eax
   0xb7f98a72 <+196>:	mov    %eax,-0x24(%ebp)
   0xb7f98a75 <+199>:	jne    0xb7f98aba <do_relocs+268>
   0xb7f98a77 <+201>:	mov    -0x2c(%ebp),%eax
   0xb7f98a7a <+204>:	cmpw   $0x0,0xe(%eax)
   0xb7f98a7f <+209>:	jne    0xb7f98a8b <do_relocs+221>
   0xb7f98a81 <+211>:	mov    0xc(%eax),%al
   0xb7f98a84 <+214>:	shr    $0x4,%al
   0xb7f98a87 <+217>:	cmp    $0x2,%al
   0xb7f98a89 <+219>:	je     0xb7f98aba <do_relocs+268>
   0xb7f98a8b <+221>:	mov    -0x28(%ebp),%eax
   0xb7f98a8e <+224>:	push   %ecx
   0xb7f98a8f <+225>:	pushl  -0x34(%ebp)
---Type <return> to continue, or q <return> to quit---
   0xb7f98a92 <+228>:	pushl  0x4(%eax)
   0xb7f98a95 <+231>:	lea    -0x254a9(%ebx),%eax
   0xb7f98a9b <+237>:	push   %eax
   0xb7f98a9c <+238>:	call   0xb7f97b90 <error>
   0xb7f98aa1 <+243>:	add    $0x10,%esp
   0xb7f98aa4 <+246>:	jmp    0xb7f98c09 <do_relocs+603>
   0xb7f98aa9 <+251>:	mov    -0x28(%ebp),%edx
   0xb7f98aac <+254>:	movl   $0x0,-0x24(%ebp)
   0xb7f98ab3 <+261>:	movl   $0x0,-0x2c(%ebp)
   0xb7f98aba <+268>:	cmpl   $0x2,0xc(%ebp)
   0xb7f98abe <+272>:	jbe    0xb7f98ac8 <do_relocs+282>
   0xb7f98ac0 <+274>:	mov    -0x30(%ebp),%eax
   0xb7f98ac3 <+277>:	mov    0x8(%eax),%edi
   0xb7f98ac6 <+280>:	jmp    0xb7f98ad9 <do_relocs+299>
   0xb7f98ac8 <+282>:	mov    -0x48(%ebp),%ecx
   0xb7f98acb <+285>:	mov    $0x8c,%eax
   0xb7f98ad0 <+290>:	xor    %edi,%edi
   0xb7f98ad2 <+292>:	bt     %ecx,%eax
   0xb7f98ad5 <+295>:	jb     0xb7f98ad9 <do_relocs+299>
   0xb7f98ad7 <+297>:	mov    (%esi),%edi
   0xb7f98ad9 <+299>:	mov    -0x24(%ebp),%eax
   0xb7f98adc <+302>:	test   %eax,%eax
   0xb7f98ade <+304>:	je     0xb7f98aec <do_relocs+318>
   0xb7f98ae0 <+306>:	mov    0x4(%eax),%eax
   0xb7f98ae3 <+309>:	mov    (%edx),%ecx
   0xb7f98ae5 <+311>:	mov    %eax,-0x24(%ebp)
   0xb7f98ae8 <+314>:	add    %eax,%ecx
   0xb7f98aea <+316>:	jmp    0xb7f98af5 <do_relocs+327>
   0xb7f98aec <+318>:	xor    %ecx,%ecx
   0xb7f98aee <+320>:	movl   $0x0,-0x24(%ebp)
   0xb7f98af5 <+327>:	mov    -0x48(%ebp),%al
   0xb7f98af8 <+330>:	dec    %eax
   0xb7f98af9 <+331>:	cmp    $0xd,%al
   0xb7f98afb <+333>:	ja     0xb7f98c09 <do_relocs+603>
   0xb7f98b01 <+339>:	movzbl %al,%eax
   0xb7f98b04 <+342>:	mov    -0x25244(%ebx,%eax,4),%eax
   0xb7f98b0b <+349>:	add    %ebx,%eax
   0xb7f98b0d <+351>:	jmp    *%eax
   0xb7f98b0f <+353>:	sub    %esi,%edi
   0xb7f98b11 <+355>:	jmp    0xb7f98b19 <do_relocs+363>
---Type <return> to continue, or q <return> to quit---
   0xb7f98b13 <+357>:	cmpl   $0x0,-0x2c(%ebp)
   0xb7f98b17 <+361>:	je     0xb7f98b1d <do_relocs+367>
   0xb7f98b19 <+363>:	add    %ecx,%edi
   0xb7f98b1b <+365>:	jmp    0xb7f98b58 <do_relocs+426>
   0xb7f98b1d <+367>:	add    -0x38(%ebp),%edi
   0xb7f98b20 <+370>:	jmp    0xb7f98b58 <do_relocs+426>
   0xb7f98b22 <+372>:	mov    -0x2c(%ebp),%eax
   0xb7f98b25 <+375>:	push   %edx
   0xb7f98b26 <+376>:	pushl  0x8(%eax)
   0xb7f98b29 <+379>:	push   %ecx
   0xb7f98b2a <+380>:	push   %esi
   0xb7f98b2b <+381>:	call   0xb7fc60c7 <memcpy>
   0xb7f98b30 <+386>:	jmp    0xb7f98aa1 <do_relocs+243>
   0xb7f98b35 <+391>:	sub    %esi,%edi
   0xb7f98b37 <+393>:	add    %edi,%ecx
   0xb7f98b39 <+395>:	mov    %ecx,(%esi)
   0xb7f98b3b <+397>:	jmp    0xb7f98c09 <do_relocs+603>
   0xb7f98b40 <+402>:	mov    0x74(%edx),%eax
   0xb7f98b43 <+405>:	mov    %eax,(%esi)
   0xb7f98b45 <+407>:	jmp    0xb7f98c09 <do_relocs+603>
   0xb7f98b4a <+412>:	sub    0x78(%edx),%edi
   0xb7f98b4d <+415>:	add    -0x24(%ebp),%edi
   0xb7f98b50 <+418>:	jmp    0xb7f98b58 <do_relocs+426>
   0xb7f98b52 <+420>:	add    0x78(%edx),%edi
   0xb7f98b55 <+423>:	sub    -0x24(%ebp),%edi
=> 0xb7f98b58 <+426>:	mov    %edi,(%esi)
   0xb7f98b5a <+428>:	jmp    0xb7f98c09 <do_relocs+603>
   0xb7f98b5f <+433>:	cmpl   $0x2,0xc(%ebp)
   0xb7f98b63 <+437>:	ja     0xb7f98b68 <do_relocs+442>
   0xb7f98b65 <+439>:	mov    0x4(%esi),%edi
   0xb7f98b68 <+442>:	cmpl   $0x0,0x924(%ebx)
   0xb7f98b6f <+449>:	je     0xb7f98bf6 <do_relocs+584>
   0xb7f98b75 <+455>:	mov    0x8d4(%ebx),%eax
   0xb7f98b7b <+461>:	cmp    %eax,0x74(%edx)
   0xb7f98b7e <+464>:	jb     0xb7f98bf6 <do_relocs+584>
   0xb7f98b80 <+466>:	sub    $0xc,%esp
   0xb7f98b83 <+469>:	push   $0xc
   0xb7f98b85 <+471>:	mov    %edx,-0x48(%ebp)
   0xb7f98b88 <+474>:	call   0xb7f9e324 <malloc>
   0xb7f98b8d <+479>:	add    $0x10,%esp
---Type <return> to continue, or q <return> to quit---
   0xb7f98b90 <+482>:	mov    -0x48(%ebp),%edx
   0xb7f98b93 <+485>:	test   %eax,%eax
   0xb7f98b95 <+487>:	jne    0xb7f98bc9 <do_relocs+539>
   0xb7f98b97 <+489>:	cmpl   $0x0,-0x2c(%ebp)
   0xb7f98b9b <+493>:	mov    -0x34(%ebp),%ecx
   0xb7f98b9e <+496>:	jne    0xb7f98ba6 <do_relocs+504>
   0xb7f98ba0 <+498>:	lea    -0x254e5(%ebx),%ecx
   0xb7f98ba6 <+504>:	mov    %eax,-0x48(%ebp)
   0xb7f98ba9 <+507>:	push   %eax
   0xb7f98baa <+508>:	mov    -0x28(%ebp),%eax
   0xb7f98bad <+511>:	push   %ecx
   0xb7f98bae <+512>:	lea    -0x2547f(%ebx),%ecx
   0xb7f98bb4 <+518>:	mov    %edx,-0x2c(%ebp)
   0xb7f98bb7 <+521>:	pushl  0x4(%eax)
   0xb7f98bba <+524>:	push   %ecx
   0xb7f98bbb <+525>:	call   0xb7f97b90 <error>
   0xb7f98bc0 <+530>:	mov    -0x48(%ebp),%eax
   0xb7f98bc3 <+533>:	add    $0x10,%esp
   0xb7f98bc6 <+536>:	mov    -0x2c(%ebp),%edx
   0xb7f98bc9 <+539>:	mov    -0x28(%ebp),%ecx
   0xb7f98bcc <+542>:	mov    0x74(%edx),%edx
   0xb7f98bcf <+545>:	add    -0x24(%ebp),%edi
   0xb7f98bd2 <+548>:	mov    0x94(%ecx),%ecx
   0xb7f98bd8 <+554>:	mov    %ecx,0x8(%eax)
   0xb7f98bdb <+557>:	mov    -0x28(%ebp),%ecx
   0xb7f98bde <+560>:	mov    %eax,0x94(%ecx)
   0xb7f98be4 <+566>:	mov    %edx,(%eax)
   0xb7f98be6 <+568>:	lea    -0x62d6c(%ebx),%edx
   0xb7f98bec <+574>:	mov    %edi,0x4(%eax)
   0xb7f98bef <+577>:	mov    %eax,0x4(%esi)
   0xb7f98bf2 <+580>:	mov    %edx,(%esi)
   0xb7f98bf4 <+582>:	jmp    0xb7f98c09 <do_relocs+603>
   0xb7f98bf6 <+584>:	lea    -0x62d70(%ebx),%eax
   0xb7f98bfc <+590>:	mov    %eax,(%esi)
   0xb7f98bfe <+592>:	mov    -0x24(%ebp),%eax
   0xb7f98c01 <+595>:	sub    0x78(%edx),%eax
   0xb7f98c04 <+598>:	add    %eax,%edi
   0xb7f98c06 <+600>:	mov    %edi,0x4(%esi)
   0xb7f98c09 <+603>:	mov    -0x54(%ebp),%eax
   0xb7f98c0c <+606>:	add    %eax,-0x30(%ebp)
---Type <return> to continue, or q <return> to quit---
   0xb7f98c0f <+609>:	sub    %eax,0x8(%ebp)
   0xb7f98c12 <+612>:	jmp    0xb7f989e2 <do_relocs+52>
   0xb7f98c17 <+617>:	lea    -0xc(%ebp),%esp
   0xb7f98c1a <+620>:	pop    %ebx
   0xb7f98c1b <+621>:	pop    %esi
   0xb7f98c1c <+622>:	pop    %edi
   0xb7f98c1d <+623>:	pop    %ebp
   0xb7f98c1e <+624>:	ret    
End of assembler dump.
(gdb) info all-registers
eax            0xb7f98b0f	-1208382705
ecx            0xb7fa2033	-1208344525
edx            0xb7ffd610	-1207970288
ebx            0xb7ffcf7c	-1207971972
esp            0xbffffa50	0xbffffa50
ebp            0xbffffaa8	0xbffffaa8
esi            0xc45f10	12869392
edi            0xb735c11f	-1221213921
eip            0xb7f98b58	0xb7f98b58 <do_relocs+426>
eflags         0x10283	[ CF SF IF RF ]
cs             0x73	115
ss             0x7b	123
ds             0x7b	123
es             0x7b	123
fs             0x0	0
gs             0x0	0
st0            0	(raw 0x00000000000000000000)
st1            0	(raw 0x00000000000000000000)
st2            0	(raw 0x00000000000000000000)
st3            0	(raw 0x00000000000000000000)
st4            0	(raw 0x00000000000000000000)
st5            0	(raw 0x00000000000000000000)
st6            0	(raw 0x00000000000000000000)
st7            42	(raw 0x4004a800000000000000)
fctrl          0x37f	895
fstat          0x0	0
ftag           0xffff	65535
fiseg          0x73	115
fioff          0xb7f9db4b	-1208362165
foseg          0x7b	123
fooff          0xbffff770	-1073744016
fop            0x11c	284
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
---Type <return> to continue, or q <return> to quit---
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, 
  uint128 = 0x00000000000000000000000000000000}
mxcsr          0x1f80	[ IM DM ZM OM UM PM ]
mm0            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm1            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm2            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm3            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm4            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm5            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm6            {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 
    0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm7            {uint64 = 0xa800000000000000, v2_int32 = {0x0, 0xa8000000}, 
---Type <return> to continue, or q <return> to quit---
  v4_int16 = {0x0, 0x0, 0x0, 0xa800}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
    0x0, 0xa8}}
(gdb) 


[-- Attachment #3: wkfltk-test-ld.txt --]
[-- Type: text/plain, Size: 4629 bytes --]

make: Entering directory '/home/idunham/src/webkitfltk/Source/WebKit/fltk'
g++ -o testapp/testapp testapp/*.cpp -I .. -I ../.. -I . -I ../../WTF -I webkit -I WebCoreSupport -std=gnu++11 -g -Wall -DBUILDING_FLTK__ -D_GLIBCXX_USE_SCHED_YIELD -D_GLIBCXX_USE_NANOSLEEP -I/usr/include  -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libxml2 -I/usr/include/harfbuzz   -I ../../JavaScriptCore/ForwardingHeaders -I ../../WebCore -I ../../WebCore/ForwardingHeaders -I ../../WebCore/Modules/geolocation -I ../../WebCore/Modules/filesystem -I ../../WebCore/Modules/mediastream -I ../../WebCore/Modules/navigatorcontentutils -I ../../WebCore/Modules/networkinfo -I ../../WebCore/Modules/webdatabase -I ../../WebCore/Modules/websockets -I ../../WebCore/accessibility -I ../../WebCore/bindings/generic -I ../../WebCore/bindings/js -I ../../WebCore/bindings -I ../../WebCore/bridge -I ../../WebCore/bridge/c -I ../../WebCore/bridge/jsc -I ../../WebCore/css -I ../../WebCore/dom -I ../../WebCore/dom/default -I ../../WebCore/editing -I ../../WebCore/fileapi -I ../../WebCore/history -I ../../WebCore/html -I ../../WebCore/html/forms -I ../../WebCore/html/shadow -I ../../WebCore/inspector -I ../../WebCore/loader -I ../../WebCore/loader/archive -I ../../WebCore/loader/appcache -I ../../WebCore/loader/icon -I ../../WebCore/loader/cache -I ../../WebCore/page -I ../../WebCore/page/animation -I ../../WebCore/page/scrolling -I ../../WebCore/platform -I ../../WebCore/platform/animation -I ../../WebCore/platform/audio -I ../../WebCore/platform/fltk -I ../../WebCore/platform/cairo -I ../../WebCore/platform/graphics -I ../../WebCore/platform/graphics/filters -I ../../WebCore/platform/graphics/harfbuzz -I ../../WebCore/platform/graphics/harfbuzz/ng -I ../../WebCore/platform/graphics/cairo -I ../../WebCore/platform/graphics/texmap -I ../../WebCore/platform/graphics/opentype -I ../../WebCore/platform/graphics/transforms -I ../../WebCore/platform/mediastream -I ../../WebCore/platform/mock -I ../../WebCore/platform/network -I ../../WebCore/platform/network/curl -I ../../WebCore/platform/sql -I ../../WebCore/platform/text -I ../../WebCore/plugins -I ../../WebCore/rendering -I ../../WebCore/rendering/line -I ../../WebCore/rendering/shapes -I ../../WebCore/rendering/style -I ../../WebCore/storage -I ../../WebCore/style -I ../../WebCore/svg -I ../../WebCore/svg/animation -I ../../WebCore/svg/graphics -I ../../WebCore/svg/properties -I ../../WebCore/workers -I ../../JavaScriptCore -I ../../JavaScriptCore/API -I ../../JavaScriptCore/assembler -I ../../JavaScriptCore/bytecode -I ../../JavaScriptCore/bytecompiler -I ../../JavaScriptCore/disassembler -I ../../JavaScriptCore/dfg -I ../../JavaScriptCore/heap -I ../../JavaScriptCore/debugger -I ../../JavaScriptCore/interpreter -I ../../JavaScriptCore/jit -I ../../JavaScriptCore/llint -I ../../JavaScriptCore/parser -I ../../JavaScriptCore/profiler -I ../../JavaScriptCore/runtime  -DENABLE_CANVAS_PATH  -DENABLE_CHANNEL_MESSAGING  -DENABLE_CONTEXT_MENUS  -DENABLE_CSS_BOX_DECORATION_BREAK  -DENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED  -DENABLE_DETAILS_ELEMENT  -DENABLE_FTPDIR  -DENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING  -DENABLE_ICONDATABASE  -DENABLE_IMAGE_DECODER_DOWN_SAMPLING  -DENABLE_INSPECTOR  -DENABLE_JIT  -DENABLE_LEGACY_VENDOR_PREFIXES  -DENABLE_LINK_PREFETCH  -DENABLE_LLINT  -DENABLE_METER_ELEMENT  -DENABLE_NAVIGATOR_HWCONCURRENCY  -DENABLE_PROMISES  -DENABLE_PROGRESS_ELEMENT  -DENABLE_SVG_FONTS  -DENABLE_TEMPLATE_ELEMENT  -DENABLE_WEB_SOCKETS  -DENABLE_XSLT  -DENABLE_SUBPIXEL_LAYOUT  -DENABLE_VIEW_MODE_CSS_MEDIA  -DENABLE_CURSOR_SUPPORT  -DENABLE_DRAG_SUPPORT  -DENABLE_FIFTH_VIDEO  -DENABLE_VIDEO  -DENABLE_VIDEO_TRACK  -DENABLE_MATHML  -DENABLE_TEXT_CARET  -DENABLE_TEXT_SELECTION  -DENABLE_WILL_REVEAL_EDGE_EVENTS  -DWTF_USE_TEXTURE_MAPPER  -DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS -DENABLE_NETSCAPE_PLUGIN_API=0 -DENABLE_SQL_DATABASE=0 -DENABLE_DATE_AND_TIME_INPUT_TYPES=0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -Wall -I/usr/include/freetype2 -Os -fomit-frame-pointer -pipe -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT /tmp/libwebkitfltk.a \
	-lz -pthread -lxslt -lxml2 -ldl -lsqlite3 `icu-config --ldflags` -lharfbuzz -lharfbuzz-icu -lfreetype -lfontconfig -lcairo -lpng -ljpeg -lrt -lcurl -lssl -lcrypto -lglib-2.0 `/usr/bin/fltk-config --ldflags --use-images` -static-libgcc -static-libstdc++
make: Leaving directory '/home/idunham/src/webkitfltk/Source/WebKit/fltk'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 19:04   ` Isaac Dunham
@ 2014-11-19 19:13     ` Rich Felker
  2014-11-19 19:48       ` Isaac Dunham
  0 siblings, 1 reply; 11+ messages in thread
From: Rich Felker @ 2014-11-19 19:13 UTC (permalink / raw)
  To: musl

On Wed, Nov 19, 2014 at 11:04:47AM -0800, Isaac Dunham wrote:
> On Wed, Nov 19, 2014 at 11:50:50AM -0500, Rich Felker wrote:
> > On Wed, Nov 19, 2014 at 08:44:15AM -0800, Isaac Dunham wrote:
> > > Hello,
> > > I've been trying to get WebkitFLTK[1] working on Alpine, and I have it
> > > building.
> > > But as usual, that's the easy part. The test program, 
> > > Source/WebKit/fltk/testapp/testapp, segfaults in do_relocs.
> > > I'm attaching the output of bt full.
> > 
> > Could you also provide a disassembly and register dump at the point of
> > crash?
> > 
> Attaching output of gdb disassemble and info all-registers.
> 
> It's segfaulting "at line 365 of src/ldso/dynlink.c", for what that's worth.
> 
> I'm providing the link command as well in case the problem is there.

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

Rich


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 19:13     ` Rich Felker
@ 2014-11-19 19:48       ` Isaac Dunham
  2014-11-19 19:58         ` Rich Felker
  0 siblings, 1 reply; 11+ messages in thread
From: Isaac Dunham @ 2014-11-19 19:48 UTC (permalink / raw)
  To: musl

On Wed, Nov 19, 2014 at 02:13:11PM -0500, Rich Felker wrote:
> On Wed, Nov 19, 2014 at 11:04:47AM -0800, Isaac Dunham wrote:
> > On Wed, Nov 19, 2014 at 11:50:50AM -0500, Rich Felker wrote:
> > > On Wed, Nov 19, 2014 at 08:44:15AM -0800, Isaac Dunham wrote:
> > > > Hello,
> > > > I've been trying to get WebkitFLTK[1] working on Alpine, and I have it
> > > > building.
> > > > But as usual, that's the easy part. The test program, 
> > > > Source/WebKit/fltk/testapp/testapp, segfaults in do_relocs.
> > > > I'm attaching the output of bt full.
> > > 
> > > Could you also provide a disassembly and register dump at the point of
> > > crash?
> > > 
> > Attaching output of gdb disassemble and info all-registers.
> > 
> > It's segfaulting "at line 365 of src/ldso/dynlink.c", for what that's worth.
> > 
> > I'm providing the link command as well in case the problem is there.
> 
> 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.

Thanks,
Isaac Dunham



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 19:48       ` Isaac Dunham
@ 2014-11-19 19:58         ` Rich Felker
  2014-11-19 20:20           ` Isaac Dunham
  0 siblings, 1 reply; 11+ messages in thread
From: Rich Felker @ 2014-11-19 19:58 UTC (permalink / raw)
  To: musl

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:
> > On Wed, Nov 19, 2014 at 11:04:47AM -0800, Isaac Dunham wrote:
> > > On Wed, Nov 19, 2014 at 11:50:50AM -0500, Rich Felker wrote:
> > > > On Wed, Nov 19, 2014 at 08:44:15AM -0800, Isaac Dunham wrote:
> > > > > Hello,
> > > > > I've been trying to get WebkitFLTK[1] working on Alpine, and I have it
> > > > > building.
> > > > > But as usual, that's the easy part. The test program, 
> > > > > Source/WebKit/fltk/testapp/testapp, segfaults in do_relocs.
> > > > > I'm attaching the output of bt full.
> > > > 
> > > > Could you also provide a disassembly and register dump at the point of
> > > > crash?
> > > > 
> > > Attaching output of gdb disassemble and info all-registers.
> > > 
> > > It's segfaulting "at line 365 of src/ldso/dynlink.c", for what that's worth.
> > > 
> > > I'm providing the link command as well in case the problem is there.
> > 
> > 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 19:58         ` Rich Felker
@ 2014-11-19 20:20           ` Isaac Dunham
  2014-11-19 20:56             ` Rich Felker
  0 siblings, 1 reply; 11+ messages in thread
From: Isaac Dunham @ 2014-11-19 20:20 UTC (permalink / raw)
  To: musl

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

Thanks,
Isaac Dunham


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 20:20           ` Isaac Dunham
@ 2014-11-19 20:56             ` Rich Felker
  2014-11-19 22:43               ` Isaac Dunham
  0 siblings, 1 reply; 11+ messages in thread
From: Rich Felker @ 2014-11-19 20:56 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 20:56             ` Rich Felker
@ 2014-11-19 22:43               ` Isaac Dunham
  2014-11-20  6:14                 ` Timo Teras
  0 siblings, 1 reply; 11+ messages in thread
From: Isaac Dunham @ 2014-11-19 22:43 UTC (permalink / raw)
  To: musl

On Wed, Nov 19, 2014 at 03:56:35PM -0500, Rich Felker wrote:
> 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.

All external libs are available in shared format, except perhaps -lgcc
But the whole library is built in static form only, without -fPIC.
 
> 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.

A couple dozen bits of C++ that seem to call those by way of templates.
I need to read up on the PIE-related options.

Thanks,
Isaac Dunham



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs
  2014-11-19 22:43               ` Isaac Dunham
@ 2014-11-20  6:14                 ` Timo Teras
  0 siblings, 0 replies; 11+ messages in thread
From: Timo Teras @ 2014-11-20  6:14 UTC (permalink / raw)
  To: Isaac Dunham; +Cc: musl

On Wed, 19 Nov 2014 14:43:40 -0800
Isaac Dunham <ibid.ag@gmail.com> wrote:

> On Wed, Nov 19, 2014 at 03:56:35PM -0500, Rich Felker wrote:
> > 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.

See also the following link on how to figure out where textrels come
from:
http://wiki.gentoo.org/wiki/Hardened/HOWTO_locate_and_fix_textrels

> > 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.
> 
> All external libs are available in shared format, except perhaps -lgcc
> But the whole library is built in static form only, without -fPIC.

You need -fPIC for PIE-linking. Missing -fPIC is likely cause for this.

If there's some weird reason to not use -fPIC, you probably also need
to link the executable with -fno-PIE, but this means the main DSO will
not be included in address space layout randomization.

/Timo


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: webkitfltk segfaults in do_relocs (partly solved)
  2014-11-19 16:44 webkitfltk segfaults in do_relocs Isaac Dunham
  2014-11-19 16:50 ` Rich Felker
@ 2014-11-22  5:24 ` Isaac Dunham
  1 sibling, 0 replies; 11+ messages in thread
From: Isaac Dunham @ 2014-11-22  5:24 UTC (permalink / raw)
  To: musl, alpine-devel

Hello,
Thanks for all the advice. Now it gets a lot further:
I built webkitfltk with -fno-pie, and the test program loaded, showed 
a window, and crashed somewhere in JavaScriptCore.

I tried running Source/JavaScriptCore/jsc, and it shows a problem that
was previously reported:

$ Source/JavaScriptCore/jsc
Error compiling builtin: 
ASSERTION FAILED: result
parser/Parser.h(970) : WTF::PassRefPtr<T> JSC::parse(JSC::VM*, const JSC::SourceCode&, JSC::FunctionParameters*, const JSC::Identifier&, JSC::JSParserStrictness, JSC::JSParserMode, JSC::ParserError&, JSC::JSTextPosition*) [with ParsedNode = JSC::ProgramNode]
Segmentation fault (core dumped)


Upstream has set thread stack size to 1 megabyte regardless of libc, 
figuring that 8 megabytes is too much.
I'm building with -DUSE_SYSTEM_MALLOC=1.
Looking through the old thread on Webkit javascript crashing, I found an 
excerpt of a diff, but could not figure out where it's supposed to apply
(grep -r didn't find anything pertinent that I could see).

Thanks,
Isaac Dunham



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-11-22  5:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 16:44 webkitfltk segfaults in do_relocs 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
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

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