[New-bugs-announce] [issue13979] Automatic *libc.so loading behaviour
David Goulet
report at bugs.python.org
Thu Feb 9 22:10:08 CET 2012
New submission from David Goulet <dgoulet at efficios.com>:
I'm working with the LTTng (Linux Tracing) team and we came across a problem with our user-space tracer and Python default behaviour. We provide a libc wrapper that instrument free() and malloc() and is usable with a simple LD_PRELOAD.
This lib *was* named "liblttng-ust-libc.so" and we came across python software registering to our trace registry daemon (meaning that somehow the python binary is 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" with this kind of behaviour.
Thanks
----------
components: ctypes
messages: 152988
nosy: dgoulet
priority: normal
severity: normal
status: open
title: Automatic *libc.so loading behaviour
type: behavior
versions: Python 2.6, Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13979>
_______________________________________
More information about the New-bugs-announce
mailing list