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

Fatal Python error: Segmentation fault with Python Free Threading (nogil) #506

Open
dan-glass opened this issue Nov 13, 2024 · 4 comments
Open
Labels
question Further information is requested

Comments

@dan-glass
Copy link

Python3.13t Free Threading / nogil:

Fatal Python error: Segmentation fault

Current thread 0x00007f7a40c70740 (most recent call first):
  File "/usr/local/lib/python3.13t/dist-packages/viztracer/tracer.py", line 261 in stop
  File "/usr/local/lib/python3.13t/dist-packages/viztracer/viztracer.py", line 189 in stop
...
  File "/usr/lib/python3.13/threading.py", line 363 in wait
  File "/usr/lib/python3.13/threading.py", line 659 in wait

Extension modules: viztracer.snaptrace, viztracer.vcompressor (total: 2)

Can reproduce every time, but not with debug version of Python, nor with valgrind. Unfortunately I have not had time to create a small repro to share.

@gaogaotiantian
Copy link
Owner

Thank you for the report. I wouldn't be surprised if viztracer fails on 3.13t - we do not have a test environment set up for it. I built the 3.13t wheels because it could be useful for some experimenters. Even 3.13t itself is not officially supported - it has plenty of issues itself. That being said, I can take a look at the issue if there's a repro, but there's not a lot that I can do without any code. Hopefully github actions can support 3.13t so I can at least run my test suites with it.

@dan-glass
Copy link
Author

I hit a similar issue with Yappi and developed a simple repro here: sumerc/yappi#179

@gaogaotiantian
Copy link
Owner

I'm not able to repro the issue with the example given.

@gaogaotiantian gaogaotiantian added the question Further information is requested label Nov 20, 2024
@dan-glass
Copy link
Author

dan-glass commented Nov 20, 2024

That repro was for yappi, I hadn't tested on viztracer, but thank you. I was able to work around the issue by completely shutting down all the threads in the process before calling stop().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants