pyqt - Conflict between two linux shared objects defining the same function name -
my problem deals python, qt, pyqt , other stuff, question how linux's ld.so
works.
the question
if program loads 2 different shared libraries both have same entry point name (i.e. both define function same name , signature) how can tell version calling?
my problem
i have third party, proprietary linux application written in c++ (though original language irrelevant) , it's linked dynamically qt3.3. application embeds python interpreter can used write scripts it.
you can use application's embedded python instead of original 1 using command such as:
/path/to/the/program/python
and shows following:
python 2.7.1 (r271:86832, sep 16 2011, 18:16:32) [gcc 4.1.2 20080704 (red hat 4.1.2-46)] on linux2 type "help", "copyright", "credits" or "license" more information. >>>
using gcc 4.1.2 have built , installed pyqt4 sources, against qt4 libraries system has. believe build successful because can run small pyqt4 application using:
/path/to/the/program/python mypyqtapp.py
however, if load program gui , load same script, crashes @ first pyqt4
call, instantiation of qapplication
class.
since python environment same, suspect might kind of shared library conflict between qt3 , qt4. however, command strace -e trace=file
reveals python locating , loading right qt4 libraries in both cases.
so, question if program loads 2 shared different libraries define same function, how know it's calling right one? linux loader ld.so
somehow qualify entry points file name or something? suspect problem might lie there, app has loaded 2 different instances of qapplication
, it's calling wrong one, how ld.so
works internally escapes me.
it might problem caused different.
thank you.
conflict symbol detected on linkage(ld) stage, loader(ld-linux.so) don't check conflict symbol.
when multiple library providing duplicated symbol, 1 first loaded used.
actually can make use of feature. providing ld_preload=overwrite.so, overwrite.so can overwrite function program needed.
Comments
Post a Comment