Title: Possible race condition in signal handling · Issue #102397 · python/cpython · GitHub
Open Graph Title: Possible race condition in signal handling · Issue #102397 · python/cpython
X Title: Possible race condition in signal handling · Issue #102397 · python/cpython
Description: The following code segfaults the interpreter on Linux. Tested on current main. import gc import _thread gc.set_threshold(1, 0, 0) def cb(*args): _thread.interrupt_main() gc.callbacks.append(cb) def gen(): yield 1 g = gen() g.__next__() E...
Open Graph Description: The following code segfaults the interpreter on Linux. Tested on current main. import gc import _thread gc.set_threshold(1, 0, 0) def cb(*args): _thread.interrupt_main() gc.callbacks.append(cb) def...
X Description: The following code segfaults the interpreter on Linux. Tested on current main. import gc import _thread gc.set_threshold(1, 0, 0) def cb(*args): _thread.interrupt_main() gc.callbacks.append(cb) def...
Opengraph URL: https://github.com/python/cpython/issues/102397
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible race condition in signal handling","articleBody":"The following code segfaults the interpreter on Linux. Tested on current main. \r\n\r\n```py\r\nimport gc\r\nimport _thread\r\n\r\ngc.set_threshold(1, 0, 0)\r\n\r\ndef cb(*args):\r\n _thread.interrupt_main()\r\n\r\n\r\ngc.callbacks.append(cb)\r\n\r\ndef gen():\r\n yield 1\r\n\r\ng = gen()\r\ng.__next__()\r\n```\r\n\r\n```console \r\nException ignored in: \u003cfunction cb at 0x7f7f4f6fe200\u003e\r\nTraceback (most recent call last):\r\n File \"/workspaces/cpython/main.py\", line 7, in cb\r\n _thread.interrupt_main()\r\nKeyboardInterrupt: \r\nException ignored in: \u003cfunction cb at 0x7f7f4f6fe200\u003e\r\nTraceback (most recent call last):\r\n File \"/workspaces/cpython/main.py\", line 7, in cb\r\n _thread.interrupt_main()\r\nKeyboardInterrupt: \r\nException ignored in: \u003cfunction cb at 0x7f7f4f6fe200\u003e\r\nTraceback (most recent call last):\r\n File \"/workspaces/cpython/main.py\", line 7, in cb\r\n _thread.interrupt_main()\r\nKeyboardInterrupt: \r\nException ignored in: \u003cfunction cb at 0x7f7f4f6fe200\u003e\r\nTraceback (most recent call last):\r\n File \"/workspaces/cpython/main.py\", line 7, in cb\r\n _thread.interrupt_main()\r\nKeyboardInterrupt: \r\nSegmentation fault (core dumped)\r\n```\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102399\n* gh-102527\n* gh-102528\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/kumaraditya303","@type":"Person","name":"kumaraditya303"},"datePublished":"2023-03-03T13:33:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/102397/cpython/issues/102397"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e999edf7-2f3c-1ccc-d021-f674a4173354 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2E6:347527:404464:59E2E1:696A0B34 |
| html-safe-nonce | 43b801cb341178e26e99c1e520aca4da41342e4903e7bee045c64fc4d1f802c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkU2OjM0NzUyNzo0MDQ0NjQ6NTlFMkUxOjY5NkEwQjM0IiwidmlzaXRvcl9pZCI6IjY3MDk0NDQwNTcyNjEyODAwNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6319ab290914462cf9231f836dcc52e7250a29bed062e582cb69e19521220c4d |
| hovercard-subject-tag | issue:1608648111 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/102397/issue_layout |
| twitter:image | https://opengraph.githubassets.com/753ad4b434c37dc8a43e01fc4dc7b2e2528795f9396907ebbc912416bc90616c/python/cpython/issues/102397 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/753ad4b434c37dc8a43e01fc4dc7b2e2528795f9396907ebbc912416bc90616c/python/cpython/issues/102397 |
| og:image:alt | The following code segfaults the interpreter on Linux. Tested on current main. import gc import _thread gc.set_threshold(1, 0, 0) def cb(*args): _thread.interrupt_main() gc.callbacks.append(cb) def... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kumaraditya303 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width