I was figuring out a problem where starting the application from GDB results in a symbol lookup error, but starting it from the shell works.
It turns out that whenever you start a program from within GDB it will start a new shell and thus override all environment variables I had set before starting GDB (like LD_LIBRARY_PATH).
This is not really the behavior I want. Can someone explain the rationale behind this, or tell me how I can turn this off?
I am guessing that you unconditionally set
LD_LIBRARY_PATHin your~/.cshrcor the like. So if from a shell prompt you do this:the result is something other than
foo. Don’t do that.Usually this happens to CSH users, who neglected to protect their
~/.cshrcagainst non-interactive shells. It could also happen to BASH users who set theirBASH_ENV.