Title: GC crash _PyObject_AssertFailed with pdb · Issue #94215 · python/cpython · GitHub
Open Graph Title: GC crash _PyObject_AssertFailed with pdb · Issue #94215 · python/cpython
X Title: GC crash _PyObject_AssertFailed with pdb · Issue #94215 · python/cpython
Description: Reproducer: def func(): print( 42 ) import pdb; pdb.set_trace() func() Crash: @kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python main.py > /workspaces/cpython/main.py(7)
Open Graph Description: Reproducer: def func(): print( 42 ) import pdb; pdb.set_trace() func() Crash: @kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python main.py > /workspaces/cpython/main.py(7)
X Description: Reproducer: def func(): print( 42 ) import pdb; pdb.set_trace() func() Crash: @kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python main.py > /workspaces/cpython/main.py(7)<module>() -...
Opengraph URL: https://github.com/python/cpython/issues/94215
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"GC crash _PyObject_AssertFailed with pdb","articleBody":"Reproducer:\r\n```py\r\ndef func():\r\n print(\r\n 42\r\n )\r\n\r\nimport pdb; pdb.set_trace()\r\nfunc()\r\n```\r\n\r\nCrash:\r\n```console\r\n@kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python main.py \r\n\u003e /workspaces/cpython/main.py(7)\u003cmodule\u003e()\r\n-\u003e func()\r\n(Pdb) s\r\n--Call--\r\n\u003e /workspaces/cpython/main.py(1)func()\r\n-\u003e def func():\r\n(Pdb) n\r\n\u003e /workspaces/cpython/main.py(2)func()\r\n-\u003e print(\r\n(Pdb) n\r\n\u003e /workspaces/cpython/main.py(3)func()\r\n-\u003e 42\r\n(Pdb) j 1\r\n\u003e /workspaces/cpython/main.py(1)func()\r\n-\u003e def func():\r\n(Pdb) exit\r\nTraceback (most recent call last):\r\n File \"/workspaces/cpython/main.py\", line 7, in \u003cmodule\u003e\r\n func()\r\n ^^^^^^\r\n File \"/workspaces/cpython/main.py\", line 1, in func\r\n def func():\r\n \r\n File \"/workspaces/cpython/main.py\", line 1, in func\r\n def func():\r\n \r\n File \"/workspaces/cpython/Lib/bdb.py\", line 90, in trace_dispatch\r\n return self.dispatch_line(frame)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/workspaces/cpython/Lib/bdb.py\", line 115, in dispatch_line\r\n if self.quitting: raise BdbQuit\r\n ^^^^^^^^^^^^^\r\nbdb.BdbQuit\r\nModules/gcmodule.c:113: gc_decref: Assertion \"gc_get_refs(g) \u003e 0\" failed: refcount is too small\r\nEnable tracemalloc to get the memory block allocation traceback\r\n\r\nobject address : 0x7f18ff3b81d0\r\nobject refcount : 2\r\nobject type : 0x55cfef2a6460\r\nobject type name: builtin_function_or_method\r\nobject repr : \u003cbuilt-in function print\u003e\r\n\r\nFatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed\r\nPython runtime state: finalizing (tstate=0x000055cfef3bca48)\r\n\r\nCurrent thread 0x00007f18ff707280 (most recent call first):\r\n Garbage-collecting\r\n \u003cno Python frame\u003e\r\nAborted (core dumped)\r\n```\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eGDB stack trace (main)\u003c/summary\u003e\r\n\r\n```console\r\n#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50\r\n#1 0x00007ffff7c71859 in __GI_abort () at abort.c:79\r\n#2 0x000055555585db52 in fatal_error_exit (status=-1) at Python/pylifecycle.c:2614\r\n#3 fatal_error (fd=2, header=header@entry=1, prefix=\u003coptimized out\u003e, \r\n prefix@entry=0x55555594cd70 \u003c__func__.19026\u003e \"_PyObject_AssertFailed\", msg=\u003coptimized out\u003e, \r\n msg@entry=0x55555594c575 \"_PyObject_AssertFailed\", status=status@entry=-1)\r\n at Python/pylifecycle.c:2795\r\n#4 0x000055555585dbb4 in _Py_FatalErrorFunc (\r\n func=func@entry=0x55555594cd70 \u003c__func__.19026\u003e \"_PyObject_AssertFailed\", \r\n msg=msg@entry=0x55555594c575 \"_PyObject_AssertFailed\") at Python/pylifecycle.c:2811\r\n#5 0x00005555557431d2 in _PyObject_AssertFailed (\r\n obj=obj@entry=\u003cbuilt-in method print of module object at remote 0x7ffff78f32f0\u003e, \r\n expr=expr@entry=0x5555559ab18c \"gc_get_refs(g) \u003e 0\", \r\n msg=msg@entry=0x55555594c5eb \"refcount is too small\", \r\n file=file@entry=0x5555559ab11c \"Modules/gcmodule.c\", line=line@entry=113, \r\n function=function@entry=0x5555559ab6c8 \u003c__func__.18373\u003e \"gc_decref\") at Objects/object.c:2360\r\n#6 0x000055555588ad50 in gc_decref (g=0x7ffff79001c0) at Modules/gcmodule.c:116\r\n#7 visit_decref (op=\u003cbuilt-in method print of module object at remote 0x7ffff78f32f0\u003e, \r\n parent=0x7ffff7900ad0) at Modules/gcmodule.c:459\r\n#8 0x00005555557249a5 in dict_traverse (op=\u003coptimized out\u003e, visit=0x55555588ac96 \u003cvisit_decref\u003e, \r\n arg=0x7ffff7900ad0) at Objects/dictobject.c:3547\r\n#9 0x000055555588a741 in subtract_refs (\r\n containers=containers@entry=0x555555b869a8 \u003c_PyRuntime+53896\u003e) at Modules/gcmodule.c:478\r\n#10 0x000055555588be95 in deduce_unreachable (unreachable=0x7fffffffc1d0, \r\n base=0x555555b869a8 \u003c_PyRuntime+53896\u003e) at Modules/gcmodule.c:1100\r\n#11 gc_collect_main (tstate=tstate@entry=0x555555ba0a48 \u003c_PyRuntime+160552\u003e, \r\n generation=generation@entry=2, n_collected=n_collected@entry=0x7fffffffc258, \r\n n_uncollectable=n_uncollectable@entry=0x7fffffffc260, nofail=nofail@entry=0)\r\n at Modules/gcmodule.c:1226\r\n```\r\n\u003c/details\u003e\r\n\r\nPython versions tested:\r\n- Python 3.11.0b3+ 41e4b426ce (remotes/upstream/3.11:41e4b426ce, Jun 24 2022, 11:58:10) [GCC 9.4.0] on linux\r\n- Python 3.12.0a0 51fd4de101 (heads/main:51fd4de101, Jun 24 2022, 12:02:08) [GCC 9.4.0] on linux\r\n\r\ncc @markshannon @pablogsal \r\n","author":{"url":"https://github.com/kumaraditya303","@type":"Person","name":"kumaraditya303"},"datePublished":"2022-06-24T12:09:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":24},"url":"https://github.com/94215/cpython/issues/94215"}
| 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:53e23f56-75c2-5c28-3422-5bf77c040ca7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA9A:236F3C:152CA46:1D2AF8C:696AA4F1 |
| html-safe-nonce | 69ee1e9171393f8bdbd1217367b8bdf55a0fb68c7d2d0db48435eb29fa76ad7d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTlBOjIzNkYzQzoxNTJDQTQ2OjFEMkFGOEM6Njk2QUE0RjEiLCJ2aXNpdG9yX2lkIjoiNTUwMzgzMTM1MjcwMTI2NTEzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 34a8e0013906109d691a85e218fc731ff167694d11016a3d588ec835cae09703 |
| hovercard-subject-tag | issue:1283671800 |
| 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/94215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/48566f97e25d957aef681cc03aca8a6a222fd5fbea56c3951da1def47990c24d/python/cpython/issues/94215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/48566f97e25d957aef681cc03aca8a6a222fd5fbea56c3951da1def47990c24d/python/cpython/issues/94215 |
| og:image:alt | Reproducer: def func(): print( 42 ) import pdb; pdb.set_trace() func() Crash: @kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python main.py > /workspaces/cpython/main.py(7) |
| 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 | a51f97dbb9326f71c08ecb61577457d543c602124d1a2672871258ef37ac5261 |
| 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 | 4bd0eac606c70914085176ef312ebdcd97a8cdf1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width