Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SIGSEGV on macOS when calling ssl.SSLContext.load_verify_location during a shutdown  #114653

Copy link
Copy link
Open
@orf

Description

@orf
Issue body actions

Crash report

What happened?

On MacOS, calling ssl.SSLContext.load_verify_locations from multiple threads causes a SIGSEGV during process termination when an unhandled exception is raised.

I was able to create a repoduction case and I've attached the five MacOS crash reports here.

Reproduction

from multiprocessing.pool import ThreadPool
import ssl
import certifi

ctx = ssl.create_default_context()
location = certifi.where()


def test_func(_):
    ctx.load_verify_locations(location)


with ThreadPool(processes=100) as pool:
    for idx, item in enumerate(pool.imap_unordered(test_func, range(1000), chunksize=1)):
        if idx == 100:
            raise RuntimeError()
Traceback (most recent call last):
  File "/Users/tomforbes/tmp/scanner/repo.py", line 16, in <module>
    raise RuntimeError()
RuntimeError
fish: Job 1, 'python repo.py' terminated by signal SIGSEGV (Address boundary error)

MacOS crash reports:

five.txt
four.txt
one.txt
three.txt
two.txt

CPython versions tested on:

3.11

Operating systems tested on:

macOS

Output from running 'python -VV' on the command line:

Python 3.11.7 (v3.11.7:fa7a6f2303, Dec 4 2023, 15:22:56) [Clang 13.0.0 (clang-1300.0.29.30)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-mactopic-SSLtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.