[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Symbols with the same name from different shared objects



On Wed, Sep 12, 2018 at 10:17:13AM +0500, Andrey Rahmatullin wrote:
> On Wed, Sep 12, 2018 at 04:38:05AM +0000, Mo Zhou wrote:
> > I'm confused about which symbol would be eventually loaded when
> > different shared objects provides different implementation for
> > the same function signature, e.g. (glibc)malloc and (jemalloc)malloc .
> Loading order usually. You can consult DSO Howto 1.5.4 for more thorough
> explanation.

Thanks for the hint.
I found the howto here: https://www.akkadia.org/drepper/dsohowto.pdf
 
> > It shows that this shared object is linked against to both
> > jemalloc and libc6. Both of them provide the symbol "malloc".
> > The question is, how can I make sure TensorFlow will alwasy load
> > and use jemalloc's malloc implementation instead of libc's?
> The only answer I can think of is "don't do that". 

TF upstream uses jemalloc as default malloc implementation for linux
(see configure.py) but upstream is not sure about the status of
jemalloc build, strange...
https://github.com/tensorflow/tensorflow/issues/21272

I think I should drop jemalloc and let user do LD_PRELOAD by themselves,
if they want.


Reply to: