bob.sacamento bob.sacamento - 3 months ago 11
Linux Question

What could possibly cause a Linux "ls" command to return a seg fault?

I am installing some new software. It contains several libraries in a "Lib" directory. If I

ls Lib
from another directory, I get the usual list of files. I can issue
dir
and
file
commands and get reasonable results too. I can even copy files out of this directory to other directories. But if I cd to "Lib", it appears that any linux command I give returns a seg fault. I can't run
ls
,
file
, or
dir
in that directory. I can't even run
date
there without a seg fault. Much obliged if anyone can help me clear up this mystery.

Answer

Probably your LD_LIBRARY_PATH includes a dot / . and that Lib directory contains standard libraries like libc, so what ever command you issue, system picks a library from that path and something goes wrong.