|
Message-ID: <CA+689BV7Ukgvdgudmz0gxzbEf-ubZ18WztS51zP0x0TvfhYEyw@mail.gmail.com>
Date: Tue, 10 Mar 2020 12:08:57 +0100
From: "Kaisrlík, Jan" <jan.kaisrlik@...st.com>
To: musl@...ts.openwall.com, Kaisrlík@...t70.net, Jan <jan.kaisrlik@...st.com>
Subject: Re: musl and jemalloc support
On Tue, Mar 10, 2020 at 10:59 AM Szabolcs Nagy <nsz@...t70.net> wrote:
> * Kaisrlík, Jan <jan.kaisrlik@...st.com> [2020-03-10 10:32:08 +0100]:
> > I would like to ask about the support of external malloc and jemalloc.
> > I find an old mail in ML claiming that support is not there and using
> > external malloc function can potentially cause problems[1] and a
> > thread[2] on jemalloc saying the same. On the other hand, I find a lot
> > of pages comparing speed like pages [3] and also I noticed that Musl
> > claims "replacement of malloc is now allowed/supported" statement in
> > changelog [4]. So, my expectation is Musl from version 1.1.20 supports
> > the loading of external malloc function and it is working. Is my
> > assumption correct? Does it have any limitations, e.g., it has to be
> > done in compilation time, is LD_PRELOAD supported?
>
> yes, it just works.
>
Thank you for your answer. Glad to hear that.
>
> >
> > The reason why I'm asking is that some apps started crashing with a
> > weird coredump from the moment I used
> > LD_PRELOAD=/usr/lib/libjemalloc.so.2:/usr/lib/libpthread.so.
>
> the preloaded libraries obviously have to be built against musl.
> (in some cases a glibc linked library would work, i would expect
> a glibc linked malloc library to work with musl on x86_64, but
> there is no guarantee)
>
All my components are built against musl for armv7 architecture.
>
> the fact that you have libpthread.so means it's not a musl system
> and preloading a libpthread.so from another libc is expected to
> crash. (even on other systems you should not just preload libpthread,
> but libjemalloc should have it in its dependencies if needed.)
>
Sorry, I kept libpthread from one of my previous tests which is slightly
misleading in this case. My system has only one libpthread library coming
from musl.
>
> >
> > Thank you for your answer.
> >
> > The best,
> > Jan
> >
> > [1]: https://www.openwall.com/lists/musl/2014/08/08/11
> > [2]: https://github.com/jemalloc/jemalloc/issues/1443
> > [3]:
> https://users.rust-lang.org/t/optimizing-rust-binaries-observation-of-musl-versus-glibc-and-jemalloc-versus-system-alloc/8499/7
> > [4]: https://git.musl-libc.org/cgit/musl/tree/WHATSNEW#n1916
>
Content of type "text/html" skipped
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.