This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cannot compile _ssl.c using openssl > 1.0
Type: compile error Stage: resolved
Components: Build, Extension Modules Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: trent Nosy List: James Matthews, christian.heimes, dmitry.zotikov, janssen, pitrou, python-dev, trent, vmurashev
Priority: low Keywords: patch

Created on 2013-08-19 05:31 by vmurashev, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ssl.patch vmurashev, 2013-08-19 05:31
18777.patch christian.heimes, 2013-08-19 15:17 review
Messages (11)
msg195602 - (view) Author: Vitaly Murashev (vmurashev) * Date: 2013-08-19 05:31
Cannot compile _ssl module when openssl version > 1.0 and it is configured with turned on macro OPENSSL_NO_DEPRECATED

Everything looks like in recent versions of openssl routine 'CRYPTO_set_id_callback' has gone away.

Patch suggested.
msg195613 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-08-19 09:25
Rather than removing the call to CRYPTO_set_id_callback, it seems we should replace it with CRYPTO_THREADID_set_callback:

« CRYPTO_THREADID and associated functions were introduced in OpenSSL 1.0.0 to replace (actually, deprecate) the previous CRYPTO_set_id_callback(), CRYPTO_get_id_callback(), and CRYPTO_thread_id() functions which assumed thread IDs to always be represented by 'unsigned long'. »

http://www.openssl.org/docs/crypto/threads.html
msg195614 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-08-19 09:27
Something like that:

static void
_ssl_threadid_callback(CRYPTO_THREADID *id)
{
    CRYPTO_THREADID_set_numeric(id, PyThread_get_thread_ident());
}

CRYPTO_THREADID_set_callback(_ssl_threadid_callback);
msg195615 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-08-19 09:28
I'm going to work on a modified patch.
msg195616 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-08-19 09:30
Indeed, only with the proper #ifdef's :-)
msg195639 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-08-19 15:17
patch
msg195642 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-08-19 15:37
New changeset f967ded6f9dd by Christian Heimes in branch '3.3':
Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
http://hg.python.org/cpython/rev/f967ded6f9dd

New changeset 28e68f4807a2 by Christian Heimes in branch 'default':
Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
http://hg.python.org/cpython/rev/28e68f4807a2

New changeset 5d691723bfbd by Christian Heimes in branch '2.7':
Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
http://hg.python.org/cpython/rev/5d691723bfbd
msg200237 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2013-10-18 10:03
The hpux bot fails at the compile stage:

http://buildbot.python.org/all/builders/IA64%20HP-UX%2011iv3%20%5BSB%5D%203.x/builds/2152/steps/compile/logs/stdio


ld -b build/temp.hp-ux-B.11.31-ia64-3.4-pydebug/home/cpython/buildslave/3.x.snakebite-hpux11iv3-ia64-1/build/Modules/_ssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.hp-ux-B.11.31-ia64-3.4-pydebug/_ssl.so
/usr/lib/hpux32/dld.so: Unsatisfied code symbol 'CRYPTO_THREADID_set_callback' in load module 'build/lib.hp-ux-B.11.31-ia64-3.4-pydebug/_ssl.so'.
sh[5]: 7508 Killed
*** Error exit code 137
msg200406 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-19 11:50
Trent, can you have a look? There seems to be a hickup with the linker and dynamic loader. Python picks up the ssl libraries from /usr/lib instead of /usr/local/lib

ld -b build/temp.hp-ux-B.11.31-ia64-3.4/home/cpython/cpython/Modules/_ssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.hp-ux-B.11.31-ia64-3.4/_ssl.so
/usr/lib/hpux32/dld.so: Unsatisfied code symbol 'CRYPTO_THREADID_set_callback' in load module 'build/lib.hp-ux-B.11.31-ia64-3.4/_ssl.so'.
% ldd build/lib.hp-ux-B.11.31-ia64-3.4/_ssl.so
        libssl.so.1 =>  /usr/lib/hpux32/libssl.so.1
        libcrypto.so.1 =>       /usr/lib/hpux32/libcrypto.so.1
        libdl.so.1 =>   /usr/lib/hpux32/libdl.so.1
        libc.so.1 =>    /usr/lib/hpux32/libc.so.1
        libdl.so.1 =>   /usr/lib/hpux32/libdl.so.1
% strings /usr/lib/hpux32/libcrypto.so.1 | grep -i thread 
__thread_specific_seg
BN_BLINDING_get_thread_id
BN_BLINDING_set_thread_id
CRYPTO_thread_id

----
But:

% strings /usr/local/lib/hpux32/libcrypto.so | grep -i thread 
__thread_specific_seg
BN_BLINDING_get_thread_id
BN_BLINDING_set_thread_id
CRYPTO_THREADID_current
CRYPTO_THREADID_set_numeric
CRYPTO_THREADID_get_callback
CRYPTO_THREADID_set_callback



Christian
msg282083 - (view) Author: James Matthews (James Matthews) Date: 2016-11-30 14:29
This is marked as fixed but am still seeing this error in 2.7.12 on HP-UX 11.31.

/opt/hp-gcc64-4.7.1/bin/gcc -pthread -shared build/temp.hp-ux-B.11.31-9000-800-2.7/root/build/Python-2.7.12/Modules/_ssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.hp-ux-B.11.31-9000-800-2.7/_ssl.sl
/usr/lib/pa20_64/dld.sl: Unsatisfied code symbol 'CRYPTO_THREADID_set_callback' in load module 'build/lib.hp-ux-B.11.31-9000-800-2.7/_ssl.sl'.
/bin/sh: 23510 Killed
gmake: *** [sharedmods] Error 137
msg312489 - (view) Author: Dmitry Zotikov (dmitry.zotikov) Date: 2018-02-21 10:58
James, double check you specify the right path to the local system libraries.  If the system is multilib, libssl resides in /usr/local/lib/hpux32 (64) and not in /usr/local/lib directly.
History
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62977
2018-02-21 10:58:39dmitry.zotikovsetnosy: + dmitry.zotikov
messages: + msg312489
2016-11-30 14:29:26James Matthewssetnosy: + James Matthews
messages: + msg282083
2015-04-13 18:33:02pitrousetstatus: open -> closed
resolution: fixed
2014-05-14 15:23:27skrahsetnosy: - skrah
2013-10-19 13:15:39giampaolo.rodolasetnosy: - giampaolo.rodola
2013-10-19 11:50:02christian.heimessetpriority: critical -> low

nosy: + trent
messages: + msg200406

assignee: christian.heimes -> trent
2013-10-19 10:41:50christian.heimessetstatus: closed -> open
resolution: fixed -> (no value)
2013-10-18 10:03:28skrahsetnosy: + skrah
messages: + msg200237
2013-08-19 15:39:54christian.heimessetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-08-19 15:37:17python-devsetnosy: + python-dev
messages: + msg195642
2013-08-19 15:17:54christian.heimessetfiles: + 18777.patch

messages: + msg195639
2013-08-19 09:30:21pitrousetmessages: + msg195616
2013-08-19 09:28:53christian.heimessetassignee: christian.heimes
messages: + msg195615
components: + Extension Modules
2013-08-19 09:27:12christian.heimessetmessages: + msg195614
components: - Extension Modules
stage: needs patch -> patch review
2013-08-19 09:25:40pitrousetpriority: normal -> critical

components: + Extension Modules
versions: + Python 2.7, Python 3.4
nosy: + janssen, pitrou, giampaolo.rodola, christian.heimes

messages: + msg195613
stage: needs patch
2013-08-19 05:31:27vmurashevcreate