incorrect shared library being used at runtime for my c Program

99 Views Asked by At

i have complied my program with new version of a shared libary (vertex ) and when i do ldd on my executable i see it is linked to correct version (STQ_8_1_ISAM)

ldd /pathtoexe/mytaxprg|grep vertex
        libvst.so => /usr/local/vertex/STQ_8_1_ISAM/32bit/lib/libvst.so (0x00ce8000)
        libloc.so => /usr/local/vertex/STQ_8_1_ISAM/32bit/lib/libloc.so (0x0034e000)
        libcb65.so => /usr/local/vertex/STQ_8_1_ISAM/32bit/lib/libcb65.so (0x00c15000)

but when i run the program it picks up the old library (STQ_6_0_ISAM) i can see by both gdb and lsof on the pid

> lsof -p 2856 | grep vertex
mytaxprg 2856   mem    REG    253,26   980508     386333 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libvst.so
mytaxprg 2856   mem    REG    253,26    20588     386330 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libqutil.so
mytaxprg 2856   mem    REG    253,26    62049     386334 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libloc.so
mytaxprg 2856   mem    REG    253,26   460620     386331 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libcb65.so

also i did env|grep vertex to check that i dont have old library on my path variable.

/usr/local/vertex/STQ_8_1_ISAM/32bit/lib --> path to new version

> env | grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/usr/local/vertex/STQ_8_1_ISAM/32bit/lib:/opt/mqm/lib:/usr/local/g1_4.2_gtx_7.2/g1rts/lib:/usr/local/g1_4.2_gtx_7.2/gtx/lib:/usr/local/g1_4.2_gtx_7.2/c1p/lib:/usr/local/g1_4.2_gtx_7.2/c1p/rts/lib:/usr/local/g1_4.2_gtx_7.2/gtx/stubs:/mtr/test/local_tlg/lib:/mtr/test/tlg_home/lib:/lib64:/usr/lib:/lib:/mtr/test/tlg_home/bin:/oravl01/oracle/11.2.0.4/lib32/stubs:/opt/syncsort/lib:/opt/qsel1.9_32/lib:/usr/local/icu4c-3_8_1/lib:/usr/local/icu-4.0/lib:/usr/local/vertex/commtax_3_1/32bit/lib:/usr/local/vertex/commtax_3_1/32bit/bin/odbc:/usr/local/vertex/commtax_3_1/32bit/bin/odbc/lib:/usr/java/jdk1.6.0_26_32/jre/lib/i386/server:/mtr/test/tlg_home/lib:/usr/local/axis2c/lib:/usr/local/xerces-c-2_8_0_icu/lib:/usr/local/xerces_2_8_0_32bit/lib:/ace-6.2_32b/:/opt/intel/Compiler/11.0/074/lib/ia32:/opt/intel/13.1.3_5.192/composer_xe_2013.5.192/debugger/mic/lib

how is the library loaded at runtime and what could be the cause of this problem?

0

There are 0 best solutions below