Operating System - HP-UX
1819794 Members
3192 Online
109607 Solutions
New Discussion юеВ

LD_PRELOAD and Bus error (core dumped)

 
DD-OTS
Occasional Contributor

LD_PRELOAD and Bus error (core dumped)

Hi Folks

I hope that someone can help me.

My problem is as follows :

I need to preload a shared libary as follows:

setenv LD_PRELOAD ="/usr/local/lib32/libsrfc.sl"

When i have done that it is not possible to either switch shell to a ksh or to do an ldd on an other shared libary.

both results in a Bus error (core dumped)

does anyone have an idea what the the problem could be?

Thanks in advance

Best Regards

Niels Goosmann, Denmark.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: LD_PRELOAD and Bus error (core dumped)

>setenv LD_PRELOAD ="/usr/local/lib32/libsrfc.sl"

Note: there is no "=" in the scummy csh for setenv. This may be your problem?

You never ever want to export LD_PRELOAD or UNIX_95. They are too dangerous to leave on for more than one command.

Since you are using the scummy csh, you must change to a real shell (ksh/sh) and do this:
LD_PRELOAD=/usr/local/lib32/libsrfc.sl command args ...
DD-OTS
Occasional Contributor

Re: LD_PRELOAD and Bus error (core dumped)

Hi again

Sorry....

I wrote the wrong command...

it has ofcourse to be :

setenv LD_PRELOAD "/usr/local/lib32/libsrfc.sl"

My problem here ia that the all scripts in the application is written in csh.

So I have to live with the csh... I will rather like to use sh or ksh.
But it is not possible for me to switch from a csh env to a ksh env.
Dennis Handly
Acclaimed Contributor

Re: LD_PRELOAD and Bus error (core dumped)

>... But it is not possible for me to switch from a csh env to a ksh env.

Then you have your scummy csh script invoke a real shell script that temporarily exports LD_PRELOAD, to do only one command:
% setenv KSH_LD_PRELOAD /usr/local/lib32/libsrfc.sl
% do_ksh command args

And do the dangerous part in a real shell:
#!/usr/bin/ksh
LD_PRELOAD=$KSH_LD_PRELOAD "$@"