[issue13580] Pre-linkage of CPython >=2.6 binary on Linux too fat (libssl, libcrypto)

Jesús Cea Avión report at bugs.python.org
Sun Dec 11 17:21:11 CET 2011


Jesús Cea Avión <jcea at jcea.es> added the comment:

I see this effect in the stock ubuntu 10.04 python 2.6.

I can't see it in my selfcompiled binaries for Solaris 10 and 2.7 ubuntu.

The reason seems to be that my compilated code uses the python shared libs, while the stock Ubuntu 10.04 python 2.6 is statically linked.

In any case, the shared lib version doesn't link against ssl:

"""
jcea at ubuntu:~$ ldd /usr/local/lib/libpython2.7.so.1.0
	linux-vdso.so.1 =>  (0x00007fff715ff000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007f5ec3079000)
	libdl.so.2 => /lib/libdl.so.2 (0x00007f5ec2e75000)
	libutil.so.1 => /lib/libutil.so.1 (0x00007f5ec2c71000)
	libm.so.6 => /lib/libm.so.6 (0x00007f5ec29ee000)
	libc.so.6 => /lib/libc.so.6 (0x00007f5ec266b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5ec3698000)
"""

Of course, as soon as we use sockets, we will bring SSL in:

"""
Python 2.7.2 (default, Jul 14 2011, 00:30:51) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getpid()
5701
>>> import socket
[...]
jcea at ubuntu:~$ cat /proc/5701/maps|grep -i ssl
7f2f467cd000-7f2f46818000 r-xp 00000000 fc:0a 131554                     /lib/libssl.so.0.9.8
7f2f46818000-7f2f46a17000 ---p 0004b000 fc:0a 131554                     /lib/libssl.so.0.9.8
7f2f46a17000-7f2f46a19000 r--p 0004a000 fc:0a 131554                     /lib/libssl.so.0.9.8
7f2f46a19000-7f2f46a1e000 rw-p 0004c000 fc:0a 131554                     /lib/libssl.so.0.9.8
7f2f46a47000-7f2f46a4f000 r-xp 00000000 fc:0a 403582                     /usr/local/lib/python2.7/lib-dynload/_ssl.so
7f2f46a4f000-7f2f46c4e000 ---p 00008000 fc:0a 403582                     /usr/local/lib/python2.7/lib-dynload/_ssl.so
7f2f46c4e000-7f2f46c4f000 r--p 00007000 fc:0a 403582                     /usr/local/lib/python2.7/lib-dynload/_ssl.so
7f2f46c4f000-7f2f46c50000 rw-p 00008000 fc:0a 403582                     /usr/local/lib/python2.7/lib-dynload/_ssl.so
"""

Importing "socket" will bring SSL in with any python at least since 2.3 (the older version I can try now).

In any case Python 2.6 is closed. Any change will need to address 2.7 and up. I would say that 3.1 is off too, and possibly 3.2 too.

PS: Can you try to compile python using the shared lib?.

----------
nosy: +jcea
versions:  -Python 2.6, Python 3.1, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13580>
_______________________________________


More information about the Python-bugs-list mailing list