Title: SIGSEGV with generators in free-threaded build · Issue #120321 · python/cpython · GitHub
Open Graph Title: SIGSEGV with generators in free-threaded build · Issue #120321 · python/cpython
X Title: SIGSEGV with generators in free-threaded build · Issue #120321 · python/cpython
Description: Crash report What happened? Trying to iterate on a generator from multiple threads under the free-threaded build results in a segmentation fault. Here is a minimal repro: import concurrent.futures def gen(): while True: yield it = gen() ...
Open Graph Description: Crash report What happened? Trying to iterate on a generator from multiple threads under the free-threaded build results in a segmentation fault. Here is a minimal repro: import concurrent.futures ...
X Description: Crash report What happened? Trying to iterate on a generator from multiple threads under the free-threaded build results in a segmentation fault. Here is a minimal repro: import concurrent.futures ...
Opengraph URL: https://github.com/python/cpython/issues/120321
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SIGSEGV with generators in free-threaded build","articleBody":"# Crash report\r\n\r\n### What happened?\r\n\r\nTrying to iterate on a generator from multiple threads under the free-threaded build results in a segmentation fault.\r\n\r\nHere is a minimal repro:\r\n```python\r\nimport concurrent.futures\r\n\r\n\r\ndef gen():\r\n while True:\r\n yield\r\n\r\n\r\nit = gen()\r\nwith concurrent.futures.ThreadPoolExecutor() as executor:\r\n while True:\r\n _ = executor.submit(lambda: next(it))\r\n```\r\n\r\nThe issue seems to be specific to generators as other kinds of iterators work well in parallel.\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nLinux\r\n\r\n### Output from running 'python -VV' on the command line:\r\n\r\nPython 3.14.0a0 experimental free-threading build (heads/main:c3b6dbff2c, Jun 10 2024, 16:54:16) [GCC 11.4.0]\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-120327\r\n* gh-142599\n* gh-142995\n* gh-143022\n* gh-143112\n* gh-143128\n* gh-144291\n* gh-144292\n* gh-144409\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/rostan-t","@type":"Person","name":"rostan-t"},"datePublished":"2024-06-10T14:59:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/120321/cpython/issues/120321"}
| 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:c4b6c2ce-ed40-8b37-45ca-e20b2b1f5e6d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C08A:813E7:4E5B70:6A0110:6A56F2F0 |
| html-safe-nonce | c3b3bda5164f6d682b0205993cd0e5abe922f70822d74c0c598e7dd5ac7b53b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDhBOjgxM0U3OjRFNUI3MDo2QTAxMTA6NkE1NkYyRjAiLCJ2aXNpdG9yX2lkIjoiNjc4MTEwNzc0Njk3OTExNTc2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1293bb0d7442e190ce9d586f8d6c14ba0ddbbd08cc4d23d4bc9b60b584f87c07 |
| hovercard-subject-tag | issue:2344146887 |
| 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/120321/issue_layout |
| twitter:image | https://opengraph.githubassets.com/56d52b5e2cf4fc9c79ec9fe922e3cfbfb66a4edd1a37d21de20375ea1e8b0995/python/cpython/issues/120321 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/56d52b5e2cf4fc9c79ec9fe922e3cfbfb66a4edd1a37d21de20375ea1e8b0995/python/cpython/issues/120321 |
| og:image:alt | Crash report What happened? Trying to iterate on a generator from multiple threads under the free-threaded build results in a segmentation fault. Here is a minimal repro: import concurrent.futures ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rostan-t |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb29e5f807bd95e41196adfbc6d28f9af12d89830d8b684f3e871774ddff2fc |
| 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 | b056788a129fb0194b61f2ebb4c43f6a9f4dfd27 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width