Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
The following code segfaults the interpreter on Linux. Tested on current main.
importgcimport_threadgc.set_threshold(1,0,0)defcb(*args):_thread.interrupt_main()gc.callbacks.append(cb)defgen():yield1g=gen()g.__next__()
Exception ignored in: <function cb at 0x7f7f4f6fe200>Traceback (most recent call last): File "/workspaces/cpython/main.py", line 7, in cb _thread.interrupt_main()KeyboardInterrupt:Exception ignored in: <function cb at 0x7f7f4f6fe200>Traceback (most recent call last): File "/workspaces/cpython/main.py", line 7, in cb _thread.interrupt_main()KeyboardInterrupt:Exception ignored in: <function cb at 0x7f7f4f6fe200>Traceback (most recent call last): File "/workspaces/cpython/main.py", line 7, in cb _thread.interrupt_main()KeyboardInterrupt:Exception ignored in: <function cb at 0x7f7f4f6fe200>Traceback (most recent call last): File "/workspaces/cpython/main.py", line 7, in cb _thread.interrupt_main()KeyboardInterrupt:Segmentation fault (core dumped)