Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when running under free-threaded Python #299

Open
dairiki opened this issue Aug 23, 2024 · 0 comments
Open

Segfault when running under free-threaded Python #299

dairiki opened this issue Aug 23, 2024 · 0 comments
Labels

Comments

@dairiki
Copy link

dairiki commented Aug 23, 2024

Description

I am starting to play with the new GIL-less python.

When importing watchfiles, Python 3.13.0rc0t (installed using pyenv on Ubuntu 22.0) segfaults immediately.

It does this if either PYTHON_GIL=0 or PYTHON_GIL=1 is set, so it doesn't explicitly have to do with the GIL being disabled.

It does not segfault under the standard (non-free-threading) build of Python 3.13.0rc0 (even when I install from sdist rather than wheel).

Sadly, I do not have enough familiarity with rust to debug further.

Example Code

$ python -m watchfiles
Segmentation fault (core dumped)

$ python -c 'import watchfiles'
Segmentation fault (core dumped)

$ PYTHON_GIL=1 python -c 'import watchfiles'
Segmentation fault (core dumped)

$ PYTHON_GIL=0 python -c 'import watchfiles'
Segmentation fault (core dumped)

Watchfiles Output

No response

Operating System & Architecture

$ python -c 'import platform; print(platform.platform()); print(platform.version())'
Linux-6.8.0-40-generic-x86_64-with-glibc2.35
#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2

Environment

No response

Python & Watchfiles Version

python: 3.13.0rc1 experimental free-threading build (main, Aug 21 2024, 13:10:59) [GCC 11.4.0], watchfiles: 0.23.0

Rust & Cargo Version

cargo 1.75.0, rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)

@dairiki dairiki added the bug label Aug 23, 2024
dairiki added a commit to dairiki/lektor that referenced this issue Aug 27, 2024
Currently, watchfiles segfaults on import on the free-threading
build of python 3.13.0rc0t.

Here, we disable the use of watchfiles on nogil pythons.

This totally breaks. lektor.watcher.

See samuelcolvin/watchfiles#299
dairiki added a commit to dairiki/lektor that referenced this issue Aug 29, 2024
Currently, watchfiles segfaults on import on the free-threading
build of python 3.13.0rc0t.

Here, we disable the use of watchfiles on nogil pythons.

This totally breaks. lektor.watcher.

See samuelcolvin/watchfiles#299
dairiki added a commit to dairiki/lektor that referenced this issue Sep 2, 2024
Currently, watchfiles segfaults on import on the free-threading
build of python 3.13.0rc0t.

Here, we disable the use of watchfiles on nogil pythons.

This totally breaks. lektor.watcher.

See samuelcolvin/watchfiles#299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant