Archive

How to Find the Shared Libraries in use by a UNIX process

When troubleshooting shared library version conflicts for some UNIX applications you might find the need to find out exactly what libraries a particular app is using.

 First you will need the process ID.

Run: ps -ef | grep <process name>

IE. ps -ef | grep bash

root     30195 30193  0 12:34 pts/2    00:00:00 -bash
root      2337 30195  0 14:04 pts/2    00:00:00 grep bash

Now you can view the  shared libraries using the PID

 less /proc/30195/maps

result:

08048000-080d5000 r-xp 00000000 08:08 229388     /bin/bash
080d5000-080db000 rw-p 0008c000 08:08 229388     /bin/bash
080db000-08100000 rw-p 00000000 00:00 0
b7289000-b728b000 rw-p 00001000 00:00 0
b728b000-b7291000 r--s 00000000 08:05 65138      /usr/lib/gconv/gconv-modules.cache
b7291000-b7491000 r--p 00000000 08:05 470555     /usr/lib/locale/locale-archive
b7491000-b749c000 r-xp 00000000 08:08 180262     /lib/libnss_files-2.3.2.so
b749c000-b749d000 rw-p 0000a000 08:08 180262     /lib/libnss_files-2.3.2.so
b749d000-b749e000 rw-p 00000000 00:00 0
b749e000-b75cf000 r-xp 00000000 08:08 98310      /lib/tls/libc-2.3.2.so
b75cf000-b75d2000 rw-p 00130000 08:08 98310      /lib/tls/libc-2.3.2.so
b75d2000-b75d5000 rw-p 00000000 00:00 0
b75d5000-b75d7000 r-xp 00000000 08:08 180242     /lib/libdl-2.3.2.so
b75d7000-b75d8000 rw-p 00001000 08:08 180242     /lib/libdl-2.3.2.so
b75d8000-b75db000 r-xp 00000000 08:08 180298     /lib/libtermcap.so.2.0.8
b75db000-b75dc000 rw-p 00002000 08:08 180298     /lib/libtermcap.so.2.0.8
b75dc000-b75dd000 rw-p 00000000 00:00 0
b75eb000-b7600000 r-xp 00000000 08:08 180229     /lib/ld-2.3.2.so
b7600000-b7601000 rw-p 00015000 08:08 180229     /lib/ld-2.3.2.so
bfff7000-c0000000 rwxp ffffa000 00:00 0
080d5000-080db000 rw-p 0008c000 08:08 229388     /bin/bash
080db000-08100000 rw-p 00000000 00:00 0
b7289000-b728b000 rw-p 00001000 00:00 0
b728b000-b7291000 r--s 00000000 08:05 65138      /usr/lib/gconv/gconv-modules.cache
b7291000-b7491000 r--p 00000000 08:05 470555     /usr/lib/locale/locale-archive
b7491000-b749c000 r-xp 00000000 08:08 180262     /lib/libnss_files-2.3.2.so
b749c000-b749d000 rw-p 0000a000 08:08 180262     /lib/libnss_files-2.3.2.so
b749d000-b749e000 rw-p 00000000 00:00 0
b749e000-b75cf000 r-xp 00000000 08:08 98310      /lib/tls/libc-2.3.2.so
b75cf000-b75d2000 rw-p 00130000 08:08 98310      /lib/tls/libc-2.3.2.so