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

Weird segfault with library



Can anybody help me with this?  I'm trying to build bash 2.2.  The old
bash works fine with the new libreadline when I use LD_PRELOAD:

femto[~/debian/bash/lib/readline]$ LD_PRELOAD=./libreadline.so /bin/bash
readline version 2.2-bash
femto[~/debian/bash/lib/readline]$ exit
(I added the version print just as a sanity check)

but:

Running with PRELOAD works for root:

RoOt@femto[/home/maor/debian/bash/lib/readline]$ LD_PRELOAD=./libreadline.so /bin/bash 
readline version 2.2-bash
RoOt@femto[/home/maor/debian/bash/lib/readline]$ exit

So copy the new libreadline in, and core dump!
(My system is pretty unstable at this point)

RoOt@femto[/home/maor/debian/bash/lib/readline]$ rm /lib/libreadline.so.2.1 
RoOt@femto[/home/maor/debian/bash/lib/readline]$ cp ./libreadline.so $_
RoOt@femto[/home/maor/debian/bash/lib/readline]$ bash
Segmentation fault (core dumped)
[status 139]

Put the old one back in:

RoOt@femto[/home/maor/debian/bash/lib/readline]$ rm /lib/libreadline.so.2.1 
RoOt@femto[/home/maor/debian/bash/lib/readline]$ cp /lib/backup/libreadline.so.2.1 /lib/

And all is fine again:

RoOt@femto[/home/maor/debian/bash/lib/readline]$ bash
RoOt@femto[/home/maor/debian/bash/lib/readline]$ exit
RoOt@femto[/home/maor/debian/bash/lib/readline]$ LD_PRELOAD=./libreadline.so /bin/bash 
readline version 2.2-bash
RoOt@femto[/home/maor/debian/bash/lib/readline]$ exit

I don't understand why it setfaults with the library in /lib but not
with LD_PRELOAD.  Any clues?


Guy


Reply to: