[OpenIndiana-discuss] Setting LD_PRELOAD

Albert Lee trisk at opensolaris.org
Sat Nov 6 23:41:11 UTC 2010


On Sat, Nov 6, 2010 at 6:57 PM, Paul Johnston
<Paul.A.Johnston at manchester.ac.uk> wrote:
>  Under my thread about couchdb I was advised to set LD_PRELOAD.
> I thought this had not worked but is seems bigger than that :-)
>
>>    Then it appears that the LD_PRELOAD environment setting is not
>>    being passed onto the child. You need to try recompiling the
>>    executable beam.smp with '-LCrun'.
>>
>> Regards,
>> Moinak.

LD_PRELOAD is a workaround, the correct thing to do is the relink the
executable as suggested.

>
> Err!
> paulj at openindiana:~$ echo $LD_PRELOAD
> /usr/lib/libCrun.so.1
> paulj at openindiana:~$ ps
> ld.so.1: ps: fatal: /usr/lib/libCrun.so.1: wrong ELF class: ELFCLASS32
> Killed
> paulj at openindiana:~$ prstat
> ld.so.1: prstat: fatal: /usr/lib/libCrun.so.1: wrong ELF class: ELFCLASS32
> Killed
>

This is expected if you set LD_PRELOAD in your shell, only set it in
the environment of the specific application.

-Albert



More information about the OpenIndiana-discuss mailing list