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: python 3.5.2 built from source fails to install completely on Mac OS X 10.11.6. Crashes subsequently.
Type: crash Stage: resolved
Components: Installation Versions: Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Mario Grgic, iritkatriel, ned.deily
Priority: normal Keywords:

Created on 2016-07-30 22:19 by Mario Grgic, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg271710 - (view) Author: Mario Grgic (Mario Grgic) Date: 2016-07-30 22:19
I am on Mac OS X 10.11.6 trying to build and install Python 3.5.2 from source. I only have system Python 2.7.10 , and no other instances of Python 3.x. 

I configure the build as follows:

./configure --prefix=/Volumes/ramdisk/python3.5.2

The code is built without errors, but when I issue 

make install

I get:

cd /Volumes/ramdisk/python3.5.2/share/man/man1; ln -s python3.5.1 python3.1)
if test "xupgrade" != "xno"  ; then \
	case upgrade in \
		upgrade) ensurepip="--upgrade" ;; \
		install|*) ensurepip="" ;; \
	esac; \
	 ./python.exe -E -m ensurepip \
		$ensurepip --root=/ ; \
fi
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
/bin/sh: line 7: 15831 Segmentation fault: 11  ./python.exe -E -m ensurepip $ensurepip --root=/
Makefile:1059: recipe for target 'install' failed
make: *** [install] Error 139

which crashes the system Python 2.7.10:


Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libcrypto.1.0.0.dylib         	0x0000000108c82d51 EVP_PKEY_CTX_free + 17
1   libcrypto.1.0.0.dylib         	0x0000000108c77742 EVP_MD_CTX_cleanup + 130
2   libcrypto.1.0.0.dylib         	0x0000000108c77a9d EVP_DigestFinal + 29
3   _hashlib.cpython-35m-darwin.so	0x0000000108c05d6b EVP_digest + 155 (_hashopenssl.c:148)
4   python.exe                    	0x000000010835493e PyEval_EvalFrameEx + 24110 (ceval.c:4684)
5   python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
6   python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
7   python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
8   python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
9   python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
10  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
11  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
12  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
13  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
14  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
15  python.exe                    	0x000000010834eaee PyEval_EvalCodeEx + 78 (ceval.c:4039)
16  python.exe                    	0x00000001082b743d function_call + 381 (funcobject.c:627)
17  python.exe                    	0x000000010828ddd5 PyObject_Call + 101 (abstract.c:2162)
18  python.exe                    	0x00000001083556a0 PyEval_EvalFrameEx + 27536 (ceval.c:5034)
19  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
20  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
21  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
22  python.exe                    	0x0000000108359ee2 fast_function + 338 (ceval.c:4803)
23  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
24  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
25  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
26  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
27  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
28  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
29  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
30  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
31  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
32  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
33  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
34  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
35  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
36  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
37  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
38  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
39  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
40  python.exe                    	0x000000010834ea91 PyEval_EvalCode + 81 (ceval.c:777)
41  python.exe                    	0x000000010834c2e0 builtin_exec + 528 (bltinmodule.c:957)
42  python.exe                    	0x00000001082d6ea5 PyCFunction_Call + 165 (methodobject.c:121)
43  python.exe                    	0x0000000108354f00 PyEval_EvalFrameEx + 25584 (ceval.c:4705)
44  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
45  python.exe                    	0x0000000108359f60 fast_function + 464 (ceval.c:4818)
46  python.exe                    	0x000000010835484f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
47  python.exe                    	0x00000001083596f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
48  python.exe                    	0x000000010834eaee PyEval_EvalCodeEx + 78 (ceval.c:4039)
49  python.exe                    	0x00000001082b743d function_call + 381 (funcobject.c:627)
50  python.exe                    	0x000000010828ddd5 PyObject_Call + 101 (abstract.c:2162)
51  python.exe                    	0x00000001083976e3 RunModule + 147 (main.c:208)
52  python.exe                    	0x00000001083970fe Py_Main + 2526 (main.c:709)
53  python.exe                    	0x00000001082831cd main + 237 (python.c:65)
54  libdyld.dylib                 	0x00007fff9523b5ad start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x149dd2af96bf4325  rcx: 0x00000000000fc080  rdx: 0x0000000000031db0
  rdi: 0x149dd2af96bf4325  rsi: 0x000000010856be00  rbp: 0x00007fff5797b130  rsp: 0x00007fff5797b120
   r8: 0x0000000000000003   r9: 0x00007fb96b5ba1f0  r10: 0x00000000072e2888  r11: 0x00007fb96b500000
  r12: 0x0a0061d3943a3792  r13: 0x0000000109a59fc0  r14: 0x0000000000000001  r15: 0x00007fff5797b1a0
  rip: 0x0000000108c82d51  rfl: 0x0000000000010202  cr2: 0x0000000108c82d40
  
Logical CPU:     2
Error Code:      0x00000000
Trap Number:     13
--------------------------------------------------------


If I add partially installed python 3.5.2 on the system PATH and add 

alias python=python3 

so the makefile calls python3 instead, then installation completes successfully.

However, if I now try running pip3 from python3.5.2/bin installation I get another crash in python3 now


Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000011

VM Regions Near 0x11:
--> 
    __TEXT                 00000001025cd000-0000000102778000 [ 1708K] r-x/rwx SM=COW  /Volumes/VOLUME/*/*.5

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libcrypto.1.0.0.dylib         	0x0000000103301f79 EVP_PKEY_CTX_dup + 25
1   libcrypto.1.0.0.dylib         	0x00000001032f692a EVP_MD_CTX_copy_ex + 282
2   _hashlib.cpython-35m-darwin.so	0x0000000103284e03 EVP_hexdigest + 99 (_hashopenssl.c:113)
3   python3.5                     	0x000000010269f93e PyEval_EvalFrameEx + 24110 (ceval.c:4684)
4   python3.5                     	0x00000001026a4ee2 fast_function + 338 (ceval.c:4803)
5   python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
6   python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
7   python3.5                     	0x00000001026a4f60 fast_function + 464 (ceval.c:4818)
8   python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
9   python3.5                     	0x00000001026a4ee2 fast_function + 338 (ceval.c:4803)
10  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
11  python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
12  python3.5                     	0x00000001026a4f60 fast_function + 464 (ceval.c:4818)
13  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
14  python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
15  python3.5                     	0x00000001026a4f60 fast_function + 464 (ceval.c:4818)
16  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
17  python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
18  python3.5                     	0x00000001026a4f60 fast_function + 464 (ceval.c:4818)
19  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
20  python3.5                     	0x00000001026a4ee2 fast_function + 338 (ceval.c:4803)
21  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
22  python3.5                     	0x00000001026a4ee2 fast_function + 338 (ceval.c:4803)
23  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
24  python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
25  python3.5                     	0x00000001026a4f60 fast_function + 464 (ceval.c:4818)
26  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
27  python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
28  python3.5                     	0x00000001026a4f60 fast_function + 464 (ceval.c:4818)
29  python3.5                     	0x000000010269f84f PyEval_EvalFrameEx + 23871 (ceval.c:4730)
30  python3.5                     	0x00000001026a46f2 _PyEval_EvalCodeWithName + 4194 (ceval.c:4018)
31  python3.5                     	0x0000000102699a91 PyEval_EvalCode + 81 (ceval.c:777)
32  python3.5                     	0x00000001026ca581 PyRun_FileExFlags + 209 (pythonrun.c:976)
33  python3.5                     	0x00000001026c9c7c PyRun_SimpleFileExFlags + 668 (pythonrun.c:396)
34  python3.5                     	0x00000001026e23f4 Py_Main + 3284 (main.c:318)
35  python3.5                     	0x00000001025ce1cd main + 237 (python.c:65)
36  libdyld.dylib                 	0x00007fff9523b5ad start + 1

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff83afb5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff95a85578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib       	0x00007fff95a83341 start_wqthread + 13

Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib        	0x00007fff83afbefa kevent_qos + 10
1   libdispatch.dylib             	0x00007fff956af165 _dispatch_mgr_invoke + 216
2   libdispatch.dylib             	0x00007fff956aedcd _dispatch_mgr_thread + 52

Thread 3:
0   libsystem_kernel.dylib        	0x00007fff83afb5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff95a85578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib       	0x00007fff95a83341 start_wqthread + 13

Thread 4:
0   libsystem_kernel.dylib        	0x00007fff83afb5e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff95a85578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib       	0x00007fff95a83341 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000001  rbx: 0x0000000103b75f48  rcx: 0x0000000000000010  rdx: 0xffffffffffffffd4
  rdi: 0x00007fdb83c51140  rsi: 0x00007fdb83ca1410  rbp: 0x00007fff5d630c40  rsp: 0x00007fff5d630c30
   r8: 0x0000000000000006   r9: 0x0000000000000000  r10: 0x00000000ffffffff  r11: 0x00000000000027c0
  r12: 0x990018d2e679ec80  r13: 0x0000000103c78288  r14: 0x00007fff5d630c80  r15: 0x00007fdb83ca3b80
  rip: 0x0000000103301f79  rfl: 0x0000000000010202  cr2: 0x0000000000000011
  
Logical CPU:     2
Error Code:      0x00000004
Trap Number:     14
msg271711 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-07-30 23:27
The crash is in libcrypto but Apple doesn't supply a libcrypto.1.0.0 with OS X 10.11, only 0.9.7 and 0.9.8.  Check the rest of the crash log to see where you're picking it up from and make sure you have an up-to-date version.  If you have a version from MacPorts or Homebrew, see the Developer's Guide for more information on how to configure a build to use libraries from them.

https://docs.python.org/devguide/setup.html#build-dependencies
msg271713 - (view) Author: Mario Grgic (Mario Grgic) Date: 2016-07-30 23:54
It looks like it is picking up libcrypto.1.0.0.dylib from /usr/local/lib which I installed there as dependency for other binaries. 

Is there a minimal version of libcrypto that Python 3.5.2 needs?
msg271715 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-07-31 00:38
libcrypto is part of OpenSSL which is famous for not maintaining ABI compatibility across versions and generally you should be using the most recent version of OpenSSL.  Depending what and where you have your copy installed, it's also possible the build picked up the wrong set of include files for that version of libcrypto and libssl.  You may be able to see that in the output of the build of _ssl.so.  Python's top-level setup.py file contains the code that tries to find the include files and lib files for various extension modules; for _ssl.so, see setup.py:810 and beyond.  Apple has deprecated the use of the system-supplied OpenSSL libraries and, in 10.11, the include files for OpenSSL are no longer included in Xcode or the Command Line Tools so you need to use a third-party copy of OpenSSL anyway.  If you aren't using a MacPorts or Homebrew, you can adapt the recipes in the Developer's Guide as necessary.  (Or you could use a pre-built Python 3.5, like that downloadable from python.org or MacPorts or Homebrew).
msg271716 - (view) Author: Mario Grgic (Mario Grgic) Date: 2016-07-31 01:31
OK, after installing OpenSSL in /usr/local/ssl and even after copying libssl.pc, libcrypt.pc and openssl.pc over to /usr/local/lib/pkgconfig (which is where my pkg-config is looking or *.pc files) the configure script is still not finding the correct libcrypto.

Only when I explicitly set CLFLAGS=-I/usr/local/ssl/include and LDFLAGS=-L/usr/local/ssl/lib 

does the configure script pick the correct libcrypto, notwithstanding the logic in top level setup.py which does have /usr/local/ssl/include on line 812 and /usr/local/ssl/lib on line 824?

Not sure at what point is setup.py used, but it doesn't seem to pick up the include and lib directories for ssl correctly.
msg401276 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-07 13:55
3.5 is long out of maintenance. I suggest we close this and look into it if the problem is reported for a newer version.
History
Date User Action Args
2022-04-11 14:58:34adminsetgithub: 71845
2021-09-07 14:47:36ned.deilysetstatus: pending -> closed
stage: resolved
2021-09-07 13:55:50iritkatrielsetstatus: open -> pending

nosy: + iritkatriel
messages: + msg401276

resolution: third party
2016-07-31 01:31:19Mario Grgicsetmessages: + msg271716
2016-07-31 00:38:52ned.deilysetmessages: + msg271715
2016-07-30 23:54:43Mario Grgicsetmessages: + msg271713
2016-07-30 23:27:00ned.deilysetmessages: + msg271711
2016-07-30 23:15:16ned.deilysetnosy: + ned.deily
2016-07-30 22:19:49Mario Grgiccreate