mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Spencer <maillist-musl@barfooze.de>
To: musl@lists.openwall.com
Subject: Re: Static linking of musl with code compiled using GNU header files
Date: Fri, 14 Mar 2014 22:37:08 +0100	[thread overview]
Message-ID: <53237684.1070006@barfooze.de> (raw)
In-Reply-To: <53236EF2.4030606@gcom.com>

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 


  reply	other threads:[~2014-03-14 21:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 15:47 David Grothe
2014-03-14 16:09 ` Luca Barbato
2014-03-14 16:29 ` Szabolcs Nagy
2014-03-14 18:52   ` David Grothe
2014-03-14 19:25     ` Kurt H Maier
2014-03-14 19:35       ` David Grothe
2014-03-14 21:04     ` David Grothe
2014-03-14 21:37       ` John Spencer [this message]
2014-03-15  0:09         ` Rich Felker
2014-03-15  0:22       ` Rich Felker
2014-03-14 16:47 ` Rich Felker

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=53237684.1070006@barfooze.de \
    --to=maillist-musl@barfooze.de \
    --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).