I use Debian and I have a problem with executing arm-none-eabi-gdb as a user. I get the following message: arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory. The only way to run it is to type sudo arm-none-eabi-gdb . I have checked library libncurses.so.5 and found that there was no execute permission for users so I changed it with chmod. Now all users can execute it but I still get the error when calling arm-none-eabi-gdb without sudo.

Can anyone explain me what is the mechanism that is blocking me ?


It seems to be a permission problem. That would explain why with sudo (i.e. working as "root") has no problems finding and using the shared library but your normal user cannot.

I assume that you have a symbolic link from libncurses.so.5 to the actual version used in the system. The result of ls -l of that would be very helpful to know where the link points and its mode (permission), also check the permissions of the path.

Symbolic links on libraries work fine, as long as the final target they trace to exists and is accessible.

  • I have changed mod of all symbolic links and actual version, I have also checked permission of the path and it is executable for users. I still have not solved the issue. – Al Bundy Jul 6 '15 at 15:29
  • @AlBundy If the permissions are now discarded as source of the problem, maybe it is the environment. Check the contents of the environment variables PATH and LD_LIBRARY_PATH (the last one might not be set) and compare between your user and root. – dave_alcarin Jul 7 '15 at 10:14
  • arm-none-eabi-gdb is inside /opt/.../ , libncurses.so.5 inside /lib/.../ PATH for user: /home/mkru/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games LD_LIBRARY_PATH for user: ` ` . PATH for root: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin LD_LIBRARY_PATH for root: ` ` . – Al Bundy Jul 7 '15 at 10:29

Issue solved. It occurred that arm-none-eabi-gdb command was executing gdb program located in different directory than sudo arm-none-eabi-gdb (surprisingly I had 2 arm-none-eabi-gdbs). strace helped me to solve the puzzle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.