Title: test_opcache fails randomly (failure or crash) · Issue #132942 · python/cpython · GitHub
Open Graph Title: test_opcache fails randomly (failure or crash) · Issue #132942 · python/cpython
X Title: test_opcache fails randomly (failure or crash) · Issue #132942 · python/cpython
Description: On a Free Threaded build: $ ./configure --with-pydebug --disable-gil $ make $ ./python -m test test_opcache --forever -v Error 1 (easy to reproduce): FAIL: test_load_global_module (test.test_opcache.TestRacesDoNotCrash.test_load_global_m...
Open Graph Description: On a Free Threaded build: $ ./configure --with-pydebug --disable-gil $ make $ ./python -m test test_opcache --forever -v Error 1 (easy to reproduce): FAIL: test_load_global_module (test.test_opcach...
X Description: On a Free Threaded build: $ ./configure --with-pydebug --disable-gil $ make $ ./python -m test test_opcache --forever -v Error 1 (easy to reproduce): FAIL: test_load_global_module (test.test_opcach...
Opengraph URL: https://github.com/python/cpython/issues/132942
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_opcache fails randomly (failure or crash)","articleBody":"On a Free Threaded build:\n\n```\n$ ./configure --with-pydebug --disable-gil\n$ make\n$ ./python -m test test_opcache --forever -v\n```\n\nError 1 (easy to reproduce):\n\n```\nFAIL: test_load_global_module (test.test_opcache.TestRacesDoNotCrash.test_load_global_module)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/home/vstinner/python/main/Lib/test/test_opcache.py\", line 1048, in test_load_global_module\n self.assert_races_do_not_crash(\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^\n opname, get_items, read, write, check_items=True\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n )\n ^\n File \"/home/vstinner/python/main/Lib/test/test_opcache.py\", line 590, in assert_races_do_not_crash\n self.assert_specialized(item, opname)\n ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n File \"/home/vstinner/python/main/Lib/test/test_opcache.py\", line 23, in assert_specialized\n self.assertIn(opname, opnames)\n ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^\nAssertionError: 'LOAD_GLOBAL_MODULE' not found in {'LOAD_GLOBAL', 'RESUME_CHECK', 'RETURN_VALUE'}\n```\n\nError 2 (crash, harder to reproduce):\n\n```\ntest_load_attr_method_with_values (test.test_opcache.TestRacesDoNotCrash.test_load_attr_method_with_values) ...\n\nFatal Python error: Segmentation fault\n\n\u003cCannot show all threads while the GIL is disabled\u003e\nStack (most recent call first):\n File \"/home/vstinner/python/main/Lib/test/test_opcache.py\", line 913 in write\n File \"/home/vstinner/python/main/Lib/threading.py\", line 1021 in run\n File \"/home/vstinner/python/main/Lib/threading.py\", line 1079 in _bootstrap_inner\n File \"/home/vstinner/python/main/Lib/threading.py\", line 1041 in _bootstrap\n\nCurrent thread's C stack trace (most recent call first):\n Binary file \"./python\", at _Py_DumpStack+0x31 [0x6715c7]\n Binary file \"./python\" [0x684547]\n Binary file \"./python\" [0x6847bd]\n Binary file \"/lib64/libc.so.6\", at +0x19df0 [0x7f95d056bdf0]\n Binary file \"./python\", at _Py_Dealloc+0x18 [0x4e7a28]\n Binary file \"./python\", at _Py_MergeZeroLocalRefcount+0x58 [0x4e7b3e]\n Binary file \"./python\" [0x50f410]\n Binary file \"./python\" [0x51db0a]\n Binary file \"./python\", at _PyObject_GenericSetAttrWithDict+0xa3 [0x4e9e77]\n Binary file \"./python\", at PyObject_GenericSetAttr+0xe [0x4ea0dd]\n Binary file \"./python\", at PyObject_SetAttr+0x60 [0x4e8f5f]\n Binary file \"./python\", at PyObject_DelAttr+0xe [0x4e92fb]\n Binary file \"./python\", at _PyEval_EvalFrameDefault+0xed7b [0x5ce860]\n (...)\n \u003ctruncated rest of calls\u003e\n\nExtension modules: _testinternalcapi (total: 1)\n```\n\ncc @colesbury @nascheme \n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-133032\n* gh-133114\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2025-04-25T14:10:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/132942/cpython/issues/132942"}
| 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:3df7b4fa-dba5-d4b7-9baa-9f7276e273fb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E876:346DF2:BC8F64:1111E1B:6A5761C1 |
| html-safe-nonce | 93807dab3475e2c355165a40085ba9a021bb809dcbacd73734d9ddaf4c5865a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODc2OjM0NkRGMjpCQzhGNjQ6MTExMUUxQjo2QTU3NjFDMSIsInZpc2l0b3JfaWQiOiI1NjY4MTU4ODc1OTMwOTQzOTM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9544d9995848276e17afe8e4393b5a5d255066814d9248e8a312e5d49f0880e7 |
| hovercard-subject-tag | issue:3020181923 |
| 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/132942/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1d98384c889f446d4e2f14c0dbbf86b1ccb4c7884d79a0fe2aa87e49642b2630/python/cpython/issues/132942 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1d98384c889f446d4e2f14c0dbbf86b1ccb4c7884d79a0fe2aa87e49642b2630/python/cpython/issues/132942 |
| og:image:alt | On a Free Threaded build: $ ./configure --with-pydebug --disable-gil $ make $ ./python -m test test_opcache --forever -v Error 1 (easy to reproduce): FAIL: test_load_global_module (test.test_opcach... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 87685a1c739dbf97e95760413799bb0221799457 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width