Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53237684.1070006@barfooze.de>
Date: Fri, 14 Mar 2014 22:37:08 +0100
From: John Spencer <maillist-musl@...fooze.de>
To:  musl@...ts.openwall.com
Subject: Re: Static linking of musl with code compiled using GNU header
 files

David Grothe wrote:
> I built a shim module that defined all the undefined "__" routines that 
> showed up in my link.  Then all my programs linked successfully.  But 
> when I went to run one of my daemon processes it got a segv in the 
> malloc code, as follows.

on which platform is this ? the linaro bit in your toolchain suggests 
that it is ARM. is that correct ? and which version of musl ?
limited ABI compat is only there for x86 platforms.

as for your problem below, it's possible that something else calls 
sbrk() messing up musl's allocator.
you should check strace output to see if sbrk(0) is called more than once.
also make sure that nothing pulls in glibc's libc.so.

btw did you check your code against the ABI checklist that was pointed 
out earlier ?

to me, it's not very surprising that your broken usage breaks and 
invokes UB somewhere..

> 
> Program terminated with signal 11, Segmentation fault.
> #0  0x0811cd5d in unbin (c=0x9b53898, i=8) at src/malloc/malloc.c:242
> #1  0x0811d266 in malloc (n=112) at src/malloc/malloc.c:371
> #2  0x0804b3ce in ssd_malloc_fcn (nbytes=16, file=0x81348e6 "../pi.c", 
> linenr=2398) at ../pi.c:632
> #3  0x0804b597 in ssd_zalloc_fcn (nbytes=12, file=0x81348e6 "../pi.c", 
> linenr=2398) at ../pi.c:687
> #4  0x0804b5e2 in ssd_calloc_fcn (n_memb=1, memb_size=12, file=0x81348e6 

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.