Skip to content

Segfault with greenlet 3.4.0 and gevent monkeypatches #507

@godlygeek

Description

@godlygeek

We've noticed segfaults after main with an atexit handler. A minimal reproducer is something like:

$ python3.12 -m venv .venv
$ source .venv/bin/activate
$ pip install greenlet==3.4.0 gevent
$ python -c 'import atexit; atexit.register(lambda: print(urllib.request.urlopen("http://example.com"))); from gevent import monkey; monkey.patch_all(); import urllib.request; print(urllib.request.urlopen("http://example.com"))'

This doesn't segfault with older versions of greenlet, and seems to be caused by greenlet switching to using atexit handlers for its cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions