Title: test_repl's test_no_memory: AssertionError: -6 not found in (1, 120) · Issue #118331 · python/cpython · GitHub
Open Graph Title: test_repl's test_no_memory: AssertionError: -6 not found in (1, 120) · Issue #118331 · python/cpython
X Title: test_repl's test_no_memory: AssertionError: -6 not found in (1, 120) · Issue #118331 · python/cpython
Description: Bug report Bug description: One of my PRs (#118283) started failing (https://github.com/python/cpython/actions/runs/8843882336?pr=118283) with this. Investigating, I can reproduce it locally on main, although I don't know why the CI pass...
Open Graph Description: Bug report Bug description: One of my PRs (#118283) started failing (https://github.com/python/cpython/actions/runs/8843882336?pr=118283) with this. Investigating, I can reproduce it locally on mai...
X Description: Bug report Bug description: One of my PRs (#118283) started failing (https://github.com/python/cpython/actions/runs/8843882336?pr=118283) with this. Investigating, I can reproduce it locally on mai...
Opengraph URL: https://github.com/python/cpython/issues/118331
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_repl's test_no_memory: AssertionError: -6 not found in (1, 120)","articleBody":"# Bug report\n\n### Bug description:\n\nOne of my PRs (https://github.com/python/cpython/pull/118283) started failing (https://github.com/python/cpython/actions/runs/8843882336?pr=118283) with this. Investigating, I can reproduce it locally on `main`, although I don't know why the CI passes on `main`. \n\nOS: macOS Sonoma 14.4.1, M2.\n\n## To reproduce\n\n```sh\ngit clone https://github.com/python/cpython\ncd cpython\n./configure --with-pydebug \u0026\u0026 make -j10\n./python.exe Lib/test/test_repl.py\n```\n\n## Actual result\n\n```pytb\n.....F.\n======================================================================\nFAIL: test_no_memory (__main__.TestInteractiveInterpreter.test_no_memory)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/private/tmp/cpython/Lib/test/test_repl.py\", line 86, in test_no_memory\n self.assertIn(p.returncode, (1, 120))\n ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: -6 not found in (1, 120)\n```\n\nPrinting `output` from the test:\n\n```\nPython 3.13.0a5+ (bisect/good-e16062dd3428a5846344e0a8c6ee2f352d34ce1b-1-gdf73179048:df73179048, A) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e \u003e\u003e\u003e \u003e\u003e\u003e Traceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n 1/0\n ~^~\nZeroDivisionError: division by zero\n\u003e\u003e\u003e After the exception.\n\u003e\u003e\u003e object address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b9a0\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nobject address : 0x102f8b930\nobject refcount : 3\nobject type : 0x102b831a8\nobject type name: MemoryError\nobject repr :\nlost sys.stderr\nFatal Python error: _Py_Dealloc: Deallocator of type '_thread._localdummy' raised an exception\nPython runtime state: finalizing (tstate=0x0000000102bf3c40)\n\nCurrent thread 0x0000000201f77ac0 (most recent call first):\n \u003cno Python frame\u003e\n```\n\n## Expected result\n\nIt passes with `v3.13.0a5`, where `output` is:\n\n```\nPython 3.13.0a5 (tags/v3.13.0a5:076d169ebb, Apr 26 2024, 22:13:38) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e \u003e\u003e\u003e \u003e\u003e\u003e Traceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n 1/0\n ~^~\nZeroDivisionError: division by zero\n\u003e\u003e\u003e After the exception.\n\u003e\u003e\u003e object address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f63a10\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\nobject address : 0x100f639a0\nobject refcount : 3\nobject type : 0x100b5f1a8\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\n```\n\nThe main difference is the failure includes this:\n\n```\nFatal Python error: _Py_Dealloc: Deallocator of type '_thread._localdummy' raised an exception\nPython runtime state: finalizing (tstate=0x0000000102bf3c40)\n\nCurrent thread 0x0000000201f77ac0 (most recent call first):\n \u003cno Python frame\u003e\n```\n\n\n## Bisecting\n\n```\ndf7317904849a41d51db39d92c5d431a18e22637 is the first bad commit\ncommit df7317904849a41d51db39d92c5d431a18e22637\nAuthor: mpage \u003cmpage@meta.com\u003e\nDate: Mon Apr 8 07:58:38 2024 -0700\n\n gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168)\n\n Most mutable data is protected by a striped lock that is keyed on the\n referenced object's address. The weakref's hash is protected using the\n weakref's per-object lock.\n\n Note that this only affects free-threaded builds. Apart from some minor\n refactoring, the added code is all either gated by `ifdef`s or is a no-op\n (e.g. `Py_BEGIN_CRITICAL_SECTION`).\n\n Include/cpython/weakrefobject.h | 8 +\n Include/internal/pycore_interp.h | 7 +\n Include/internal/pycore_object.h | 40 +-\n Include/internal/pycore_pyatomic_ft_wrappers.h | 5 +\n Include/internal/pycore_weakref.h | 73 +++-\n Lib/test/test_sys.py | 8 +-\n Lib/test/test_weakref.py | 19 +\n Modules/_sqlite/blob.c | 5 +-\n Modules/_sqlite/connection.c | 4 +-\n Modules/_ssl.c | 13 +-\n Modules/_ssl/debughelpers.c | 6 +-\n Modules/_weakref.c | 42 +-\n Modules/clinic/_weakref.c.h | 20 +-\n Objects/dictobject.c | 8 +-\n Objects/typeobject.c | 12 +-\n Objects/weakrefobject.c | 537 ++++++++++++++-----------\n Python/pystate.c | 9 +\n 17 files changed, 490 insertions(+), 326 deletions(-)\nbisect found first bad commit\n```\n\nPR: https://github.com/python/cpython/pull/117168\nIssue: https://github.com/python/cpython/pull/111926\n\nThe PR was merged three weeks ago and the CI is passing.\n\n---\n\nOn my PR (https://github.com/python/cpython/actions/runs/8843882336?pr=118283), free-threaded builds pass, but regular ones fail. Ubuntu and macOS fail with:\n\n```pytb\nAssertionError: -6 not found in (1, 120)\n```\n\nWindows with:\n\n```pytb\nAssertionError: 3221225477 not found in (1, 120)\n```\n\n3221225477 seems to be 0xc0000005 `STATUS_ACCESS_VIOLATION`.\n\n\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-118334\n* gh-118338\n* gh-130811\n* gh-130921\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/hugovk","@type":"Person","name":"hugovk"},"datePublished":"2024-04-26T19:24:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/118331/cpython/issues/118331"}
| 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:27223099-bcb6-c9e5-9688-cde11ce522c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E602:3B458B:31C212:41B6E3:696B670B |
| html-safe-nonce | 8c19c8e0d2fc1102f1ba743d03d06135f290936a439b3930f0cc769058193103 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjAyOjNCNDU4QjozMUMyMTI6NDFCNkUzOjY5NkI2NzBCIiwidmlzaXRvcl9pZCI6IjEyNjI4NDI0MzY4NzgyOTY4NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 28bb4950d7f3dee6bf411d6a6aa3d0c6af2c48248f48979b6fe716d73b87d122 |
| hovercard-subject-tag | issue:2266382889 |
| 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/118331/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b691e2baca450f44fd65c5e2401e9f7a43f69c9c6d8e2aa7cc4a654fced03f44/python/cpython/issues/118331 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b691e2baca450f44fd65c5e2401e9f7a43f69c9c6d8e2aa7cc4a654fced03f44/python/cpython/issues/118331 |
| og:image:alt | Bug report Bug description: One of my PRs (#118283) started failing (https://github.com/python/cpython/actions/runs/8843882336?pr=118283) with this. Investigating, I can reproduce it locally on mai... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hugovk |
| 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