Title: Assertion failure in Python/optimizer.c _PyOptimizer_Optimize in JIT · Issue #140936 · python/cpython · GitHub
Open Graph Title: Assertion failure in Python/optimizer.c _PyOptimizer_Optimize in JIT · Issue #140936 · python/cpython
X Title: Assertion failure in Python/optimizer.c _PyOptimizer_Optimize in JIT · Issue #140936 · python/cpython
Description: Crash report What happened? import sys import unittest from unittest import TestCase class InstrumentationMultiThreadedMixin: thread_count = 10 func_count = 50 def after_threads(self): pass def test_instrumentation(self): for i in range(...
Open Graph Description: Crash report What happened? import sys import unittest from unittest import TestCase class InstrumentationMultiThreadedMixin: thread_count = 10 func_count = 50 def after_threads(self): pass def tes...
X Description: Crash report What happened? import sys import unittest from unittest import TestCase class InstrumentationMultiThreadedMixin: thread_count = 10 func_count = 50 def after_threads(self): pass def tes...
Opengraph URL: https://github.com/python/cpython/issues/140936
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assertion failure in Python/optimizer.c _PyOptimizer_Optimize in JIT","articleBody":"# Crash report\n\n### What happened?\n\n```python\nimport sys\nimport unittest\nfrom unittest import TestCase\nclass InstrumentationMultiThreadedMixin:\n thread_count = 10\n func_count = 50\n def after_threads(self):\n pass\n def test_instrumentation(self):\n for i in range(self.func_count):\n x = {}\n threads = []\n for i in range(self.thread_count):\n for t in threads:\n break\n self.during_threads()\nclass SetTraceMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):\n def setUp(self):\n self.set = 2**31-1\n def after_test(self):\n self.assertTrue(self.called)\n def tearDown(self):\n sys.settrace(1023)\n def trace_func(self, frame, event, arg):\n return self.trace_func\n def during_threads(self):\n if self.set:\n sys.settrace(self.trace_func)\n t.join()\nif __name__ == \"__main__\":\n unittest.main()\n```\n\n```\n...\nTypeError: 'int' object is not callable\npython: ../Python/optimizer.c:121: _PyOptimizer_Optimize: Assertion `interp-\u003ejit' failed.\nAborted (core dumped)\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-140969\n* gh-141494\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/YuanchengJiang","@type":"Person","name":"YuanchengJiang"},"datePublished":"2025-11-03T08:14:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/140936/cpython/issues/140936"}
| 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:59dd7f5f-a4c0-58ad-17d9-94f22f51d412 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BACA:2F21B4:A19C7E:D15076:696B21D8 |
| html-safe-nonce | d908783b199a3b511aae606eed2042a7662fe39cb65124277c41770c546669c4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUNBOjJGMjFCNDpBMTlDN0U6RDE1MDc2OjY5NkIyMUQ4IiwidmlzaXRvcl9pZCI6IjIxMDQ5NjA2OTQ2OTQzODgxODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6cfe712d17c4c4a743f927bf37208e66d1b8aeff0cad958383eeaacaed2f7256 |
| hovercard-subject-tag | issue:3581017019 |
| 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/140936/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17c6d1d26940f3f685c070a3e5f7fe55c91c1b6ac742d33b430e0e6f3084c47a/python/cpython/issues/140936 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17c6d1d26940f3f685c070a3e5f7fe55c91c1b6ac742d33b430e0e6f3084c47a/python/cpython/issues/140936 |
| og:image:alt | Crash report What happened? import sys import unittest from unittest import TestCase class InstrumentationMultiThreadedMixin: thread_count = 10 func_count = 50 def after_threads(self): pass def tes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YuanchengJiang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width