mailing list of musl libc
 help / color / mirror / code / Atom feed
From: u-igbb@aetey.se
To: Rich Felker <dalias@aerifal.cx>
Cc: musl@lists.openwall.com
Subject: Re: malloc not behaving well when brk space is limited?
Date: Sat, 29 Mar 2014 18:02:29 +0000	[thread overview]
Message-ID: <20140329180229.GL8221@example.net> (raw)
In-Reply-To: <20140329172212.GW26358@brightrain.aerifal.cx>

On Sat, Mar 29, 2014 at 01:22:12PM -0400, Rich Felker wrote:
> On Sat, Mar 29, 2014 at 07:15:02PM +0200, Timo Teras wrote:
> > musl does not support external malloc. musl internal calls to
> > malloc() are not overridable.

Ok.

> > I think you need to fix kernel. Rewrite allocator in musl. Or add the

Too bad I can not choose the kernel on all the computers where I want my
applications to run. To the contrary I am building as portable applications
as possible. Hardly this situation is out of scope of musl (?)

> > fallback code to mmap - but dalias said it's "hard". Perhaps still
> > should be still reconsidered.
> 
> Unfortunately the approach I want to use with mmap seems to be what
> glibc uses for its thread-local arenas, and it performs something like
> 2 to 10 times worse than brk... So unless we can solve that, I don't
> think it's a good option. It could be a fallback, but I still don't
> want PIE binaries running that much slower just because the kernel is
> doing something wacky and wrong.

It is a _lot_ better to run an order of magnitude slower than to fail
totally, isn't it? If you have any code doing mmap-fallback, I would be
willing to test it and hopefully use.

> We need a good solution for this problem but I don't have one yet.

This looks like a showstopper. The applications do not work properly
as-is and replacing malloc or adding mmap support from scratch by myself
is a threshold too high, given the time constraints. :(

In other words, a bad solution would be much better than no solution.

Otherwise my impression from musl until now is excellent. Thanks
for your work on it.

Regards,
Rune



  reply	other threads:[~2014-03-29 18:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-29 17:00 u-igbb
2014-03-29 17:15 ` Timo Teras
2014-03-29 17:22   ` Rich Felker
2014-03-29 18:02     ` u-igbb [this message]
2014-03-29 18:56       ` Rich Felker
2014-03-29 19:54         ` u-igbb
2014-03-29 20:25           ` Rich Felker
2014-03-29 20:54             ` u-igbb
2014-03-31  4:51               ` 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=20140329180229.GL8221@example.net \
    --to=u-igbb@aetey.se \
    --cc=dalias@aerifal.cx \
    --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).