Movatterモバイル変換
[0]ホーム
[Python-Dev] ctypes/utils.py problem
David Gouletdgoulet at efficios.com
Thu Feb 9 00:03:29 CET 2012
-----BEGIN PGP SIGNED MESSAGE-----Hash: SHA1Hi everyone,I'm working with the LTTng (Linux Tracing) team and we came across a problemwith our user-space tracer and Python default behavior. We provide a libcwrapper that instrument free() and malloc() with a simple ld_preload of that lib.This lib *was* named "liblttng-ust-libc.so" and we came across python softwareregistering to our trace registry daemon (meaning that somehow the python binaryis using our in-process library). We dig a bit and found this:Lib/ctypes/utils.py:def _findLib_ldconfig(name):# XXX assuming GLIBC's ldconfig (with option -p) expr = r'/[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) res = re.search(expr, os.popen('/sbin/ldconfig -p 2>/dev/null').read())and, at least, also found in _findLib_gcc(name) and _findSoname_ldconfig(name).This cause Python to use any library ending with "libc.so" to be loaded....I don't know the reasons behind this but we are concerned about "future issues"that can occur with this kind of behavior.For now, we renamed our lib so everything is fine.Thanks a lot guys.David-----BEGIN PGP SIGNATURE-----Version: GnuPG v1.4.10 (GNU/Linux)iQEcBAEBAgAGBQJPMv9BAAoJEELoaioR9I02jwkIALmLg0esubJL+TrZFEahNwz785RUKSa/GKDx2sagsi62PWy5RfvRABs5Ij6ldtyQoszyuZuOlM5B7rMrpDvO588PWqO1lzT6rdO9uyq2B6vPZRjjAr++StLKyIBbQodQd8PJkEsdN0kJISdRgIrSFL/E0+2aUllrRgsVxc/oOF2LG+u7828iAYPfB71pC4euj2PgiwffZZ6J5gH4Q+mrUqt0KiYU5X+vCEzWLv+ZLtq+h2rVrLNk8cFTL5N092iMwFfooSC70urD5a0cTR6pf/iIUfFvuIVROsqiT2MwQxHApyChkrLnX0eWDPdeZZAFjnWVm4QPy8q09m6qX5eHloA==9wj8-----END PGP SIGNATURE-----
More information about the Python-Devmailing list
[8]ページ先頭