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 aborts trying to load libcrypto.dylib
Type: crash Stage: resolved
Components: macOS Versions: Python 3.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: foldr, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2020-03-16 10:26 by foldr, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-crash.txt foldr, 2020-03-16 10:26
Messages (2)
msg364306 - (view) Author: foldr (foldr) Date: 2020-03-16 10:26
Good morning.

I recently updated my system to MacOS Catalina and python crashes if it tries to load libcrypto.dylib. I have attached the crash report generated by MacOS.

Steps to reproduce:

Calling a binary that loads the library causes the crash:
$ luigi
[1]    70375 abort      luigi
$ dex2call
[1]    70451 abort      dex2call

Loading the library from the interpreter triggers the crash too:

$ python
Python 3.7.6 (default, Dec 30 2019, 19:38:28)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dex2call
[1]    70536 abort      python

I have tested with https://pypi.org/project/luigi/ and https://pypi.org/project/dex2call/.

Invoking python without any script or with (I suppose) a script that does not require libcrypto works fine:

$ python
Python 3.7.6 (default, Dec 30 2019, 19:38:28)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

$ python ~/scripts/yt2nb.py
Traceback (most recent call last):
  File "/Users/foldr/scripts/yt2nb.py", line 6, in <module>
    e = xml.etree.ElementTree.parse(sys.argv[1]).getroot()
IndexError: list index out of range

The content of yt2nb.py is:
 
#!/usr/bin/env python3

import xml.etree.ElementTree
import sys

e = xml.etree.ElementTree.parse(sys.argv[1]).getroot()
for outline in e.iter('outline'):
	if "type" in outline.attrib and outline.attrib["type"] == "rss":
		url = outline.attrib['xmlUrl']
		name = outline.attrib['title']#.encode("utf-8")
		print("%s youtube \"~%s\"" % (url, str(name)))

I have Python installed from brew and the crash report has all the relevant version numbers.

Let me know if you need more information for testing or reproducibility.

Thank you.
Daniel.
msg364336 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-03-16 16:31
The crash report gives the reason for the crash:

Application Specific Information:
/usr/lib/libcrypto.dylib
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

This means something you are importing is trying to access the deprecated macOS system version of OpenSSL's libcrypto and not a newer, third-party version supplied in this case by Homebrew.

Try importing _hashlib directly in the interpreter:

>>> import _hashlib

If you see the error then, you know that your Python installation has been built and linked incorrectly with the system OpenSSL libraries.  If not, then almost certainly a third-party package installed with this Pyrhon instance was built incorrectly and is trying to link to the system libcryto.  In either case, you should try re-installing those items using their latest versions.  Good luck!
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84158
2020-03-16 16:31:38ned.deilysetstatus: open -> closed
resolution: third party
messages: + msg364336

stage: resolved
2020-03-16 10:26:37foldrcreate