René's URL Explorer Experiment


Title: heap overflow in set_dealloc (setobject.c) · Issue #139071 · python/cpython · GitHub

Open Graph Title: heap overflow in set_dealloc (setobject.c) · Issue #139071 · python/cpython

X Title: heap overflow in set_dealloc (setobject.c) · Issue #139071 · python/cpython

Description: Crash report What happened? heap overflow by corrupted PySetObject internal data(used) Version Python 3.13.7 (main, Sep 14 2025, 14:06:10) [GCC 13.3.0] Root Cause CPython PySetObject entry states: Python sets maintain three types of entr...

Open Graph Description: Crash report What happened? heap overflow by corrupted PySetObject internal data(used) Version Python 3.13.7 (main, Sep 14 2025, 14:06:10) [GCC 13.3.0] Root Cause CPython PySetObject entry states: ...

X Description: Crash report What happened? heap overflow by corrupted PySetObject internal data(used) Version Python 3.13.7 (main, Sep 14 2025, 14:06:10) [GCC 13.3.0] Root Cause CPython PySetObject entry states: ...

Opengraph URL: https://github.com/python/cpython/issues/139071

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"heap overflow in set_dealloc (setobject.c)","articleBody":"# Crash report\n\n### What happened?\nheap overflow by corrupted PySetObject internal data(`used`)\n### Version\nPython 3.13.7 (main, Sep 14 2025, 14:06:10) [GCC 13.3.0]\n\n\n### Root Cause \n\n\n\n1. **CPython PySetObject entry states**: Python sets maintain three types of entries:\n    - active: successfully inserted entries\n    - dummy: entries that were inserted but subsequently deleted\n    - unused(null): uninitialized/empty entries\n\n    https://github.com/python/cpython/blob/3.13/Include/cpython/setobject.h#L7-L9\n\n2. **Hash collision exploitation**: The hash value is used for both table indexing in set_add_entry and entry comparison. Setting hash to 0 causes deterministic traversal starting from index 0, creating intentional hash collisions between entries.\n\n    https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L144\n\n3. **Dummy entry setup**: Two dummy objects that return hash 0 are inserted into the set, then deleted, leaving behind dummy entries.\n\n4. **Recursive eq calls and exception handling**: The __eq__ method is the callback executed when set entries have identical hashes to resolve hash collisions. Adding a corruption object triggers recursive calls that eventually hit Python's maximum recursion depth, causing an error return and raising an exception.\n\n    https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L165\n\n4. **Freeslot handling logic**: When Python set encounters a dummy entry, it stores the location in freeslot. When it subsequently encounters a null entry, it moves to the dummy_or_freeslot location.\n\n    https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L175-L177\n\n    https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L152-L153\n\n5. **Entry overwrite at dummy_or_freeslot**: If an entry's hash matches a dummy's hash, Python writes the key and hash to that dummy entry at the dummy_or_freeslot location.\n\n    https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L185-L191\n\n6. **Exception handling and recursion unwind corruption**: Even though the exception is caught and handled with try-except, as the recursion stack unwinds, each recursive call attempts to complete its add_entry operation. Since freeslot was determined deterministically, all recursive calls reference the same memory address. During the unwind process, each level overwrites the same freeslot location and incorrectly increments used += 1, as the function determines the insertion was successful.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003erecusively overwrite same freeslot location \u003c/b\u003e\u003c/summary\u003e\n\n```\nBreakpoint 3, set_add_entry (so=so@entry=0x5110001dcd20, key=key@entry=\u003cweakref.ReferenceType at remote 0x50b00015e640\u003e, hash=0) at Objects/setobject.c:191\n191         return 0;\n1: freeslot = (setentry *) 0x5110001dcd60  // same freeslot location\n2: x/2xg freeslot\n0x5110001dcd60: 0x000050b00015e640      0x0000000000000000\n(gdb) py-bt\nTraceback (most recent call first):\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 23, in \u003cmodule\u003e\n    _asyncio._register_task(a[1])\n(gdb) c\nContinuing.\n\nBreakpoint 3, set_add_entry (so=so@entry=0x5110001dcd20, key=key@entry=\u003cweakref.ReferenceType at remote 0x50b00015e590\u003e, hash=0) at Objects/setobject.c:191\n191         return 0;\n1: freeslot = (setentry *) 0x5110001dcd60    // same freeslot location\n2: x/2xg freeslot  \n0x5110001dcd60: 0x000050b00015e590      0x0000000000000000\n(gdb) py-bt // different python stack\nTraceback (most recent call first):\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 23, in \u003cmodule\u003e\n    _asyncio._register_task(a[1])\n(gdb) c\nContinuing.\n\nBreakpoint 3, set_add_entry (so=so@entry=0x5110001dcd20, key=key@entry=\u003cweakref.ReferenceType at remote 0x50b00015e4e0\u003e, hash=0) at Objects/setobject.c:191\n191         return 0;\n1: freeslot = (setentry *) 0x5110001dcd60  // same freeslot location\n2: x/2xg freeslot\n0x5110001dcd60: 0x000050b00015e4e0      0x0000000000000000\n(gdb) py-bt // different python stack\nTraceback (most recent call first):\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 23, in \u003cmodule\u003e\n    _asyncio._register_task(a[1])\n(gdb) c\nContinuing.\n\nBreakpoint 3, set_add_entry (so=so@entry=0x5110001dcd20, key=key@entry=\u003cweakref.ReferenceType at remote 0x50b00015e430\u003e, hash=0) at Objects/setobject.c:191\n191         return 0;\n1: freeslot = (setentry *) 0x5110001dcd60  // same freeslot location\n2: x/2xg freeslot\n0x5110001dcd60: 0x000050b00015e430      0x0000000000000000\n(gdb) py-bt // different python stack\nTraceback (most recent call first):\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 11, in __eq__\n    _asyncio._register_task(self)\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 23, in \u003cmodule\u003e\n    _asyncio._register_task(a[1])\n(gdb) c\nContinuing.\n\nBreakpoint 3, set_add_entry (so=so@entry=0x5110001dcd20, key=key@entry=\u003cweakref.ReferenceType at remote 0x50b00015e380\u003e, hash=0) at Objects/setobject.c:191\n191         return 0;\n1: freeslot = (setentry *) 0x5110001dcd60  // same freeslot location\n2: x/2xg freeslot\n0x5110001dcd60: 0x000050b00015e380      0x0000000000000000\n(gdb) py-bt // different python stack\nTraceback (most recent call first):\n  File \"/home/ubuntu/Python-3.13.7/Lib/_weakrefset.py\", line 88, in add\n    self.data.add(ref(item, self._remove))\n  \u003cbuilt-in method _register_task of module object at remote 0x5080000de5c0\u003e\n  File \"/home/ubuntu/Python-3.13.7/test.py\", line 23, in \u003cmodule\u003e\n    _asyncio._register_task(a[1])\n(gdb) c\n\n```\n\u003c/details\u003e\n\n7. **Entry counter bug**: This results in the set's used counter being incremented multiple times for what is essentially a single memory location, leading to incorrect set size tracking and potential memory corruption.\n\n\u003cdetails\u003e\n        \u003csummary\u003e\u003cb\u003e entry counter(used : 70 ) bug \u003c/b\u003e\u003c/summary\u003e\n\n```\nBreakpoint 4, set_dealloc (so=0x5110001dcd20) at Objects/setobject.c:495\n495     {\n1: *(PySetObject *)so = {ob_base = {{ob_refcnt = 0, ob_refcnt_split = {0, 0}}, ob_type = 0x555556228520 \u003cPySet_Type\u003e}, fill = 2, used = 70 //\u003c-- \n, mask = 7,   table = 0x5110001dcd60, hash = -1, finger = 0, smalltable = {{key = 0x555556228f40 \u003c_dummy_struct\u003e, hash = -1}, {key = 0x555556228f40 \u003c_dummy_struct\u003e,\n      hash = -1}, {key = 0x0, hash = 0}, {key = 0x0, hash = 0}, {key = 0x0, hash = 0}, {key = 0x0, hash = 0}, {key = 0x0, hash = 0}, {key = 0x0,\n      hash = 0}}, weakreflist = 0x0}\n\n(gdb) x/8gx 0x5110001dcd60 \u003c-- PySetObject internal table address\n\n0x5110001dcd60: 0x0000555556228f40      0xffffffffffffffff\n0x5110001dcd70: 0x0000555556228f40      0xffffffffffffffff\n0x5110001dcd80: 0x0000000000000000      0x0000000000000000\n0x5110001dcd90: 0x0000000000000000      0x0000000000000000\n0x5110001dcda0: 0x0000000000000000      0x0000000000000000\n0x5110001dcdb0: 0x0000000000000000      0x0000000000000000\n0x5110001dcdc0: 0x0000000000000000      0x0000000000000000\n0x5110001dcdd0: 0x0000000000000000      0x0000000000000000\n\n```\n\u003c/details\u003e\n\n\n\n8. **Memory corruption during deallocation**: In set_dealloc, the deallocation routine iterates through the table by incrementing addresses sequentially. When it encounters non-dummy entries, it performs cleanup and decrements used--. However, since used is now greater than the actual (fill - dummy) count due to the previous corruption, the deallocation process accesses invalid memory addresses beyond the allocated table bounds, leading to memory corruption or segmentation faults.\n\n    https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L494-L514\n\n### POC\n\n```python\nimport _asyncio\n\nclass dummy(object):\n    def __hash__(self):\n        return 0\nclass CorrupTrigger():\n    def __hash__(self):\n        return 0\n    def __eq__(self,other):\n        try:\n            _asyncio._register_task(self)\n        except:\n            pass\n        return False\na = [dummy(),dummy()]\n_asyncio._register_task(a[0])\n_asyncio._register_task(a[1])\ndel a # make dummy entries in set \nprint (_asyncio._scheduled_tasks)\na = [CorrupTrigger() for i in range(2)]\n_asyncio._register_task(a[0])\n_asyncio._register_task(a[1]) # make recursive comparision\n\n```\n\n\n\n\n\n### ASAN\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003easan\u003c/b\u003e\u003c/summary\u003e\n\n```\n==4613==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x5110001dcdf0 at pc 0x555555a458a5 bp 0x7fffffffdb20 sp 0x7fffffffdb10\nREAD of size 8 at 0x5110001dcdf0 thread T0\n    #0 0x555555a458a4 in set_dealloc Objects/setobject.c:505\n    #1 0x555555a0c1dc in _Py_Dealloc Objects/object.c:2939\n    #2 0x5555559d8d5a in Py_DECREF Include/object.h:934\n    #3 0x5555559d9787 in set_dict_inline_values Objects/dictobject.c:7151\n    #4 0x5555559e55ad in _PyObject_SetManagedDict Objects/dictobject.c:7180\n    #5 0x5555559e5667 in PyObject_ClearManagedDict Objects/dictobject.c:7222\n    #6 0x555555a746da in subtype_dealloc Objects/typeobject.c:2359\n    #7 0x555555a0c1dc in _Py_Dealloc Objects/object.c:2939\n    #8 0x7ffff6ff7dd8 in Py_DECREF Include/object.h:934\n    #9 0x7ffff6ff83a7 in module_clear Modules/_asynciomodule.c:3584\n    #10 0x555555a05030 in module_clear Objects/moduleobject.c:1103\n    #11 0x555555c3a017 in delete_garbage Python/gc.c:1015\n    #12 0x555555c3b4f9 in gc_collect_main Python/gc.c:1421\n    #13 0x555555c3c05f in _PyGC_CollectNoFail Python/gc.c:1657\n    #14 0x555555ca8fdb in finalize_modules Python/pylifecycle.c:1797\n    #15 0x555555cb2079 in _Py_Finalize Python/pylifecycle.c:2134\n    #16 0x555555cb21ad in Py_FinalizeEx Python/pylifecycle.c:2261\n    #17 0x555555d15c05 in Py_RunMain Modules/main.c:777\n    #18 0x555555d15de7 in pymain_main Modules/main.c:805\n    #19 0x555555d1616c in Py_BytesMain Modules/main.c:829\n    #20 0x5555557de445 in main Programs/python.c:15\n    #21 0x7ffff742a1c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n    #22 0x7ffff742a28a in __libc_start_main_impl ../csu/libc-start.c:360\n    #23 0x5555557de374 in _start (/home/ubuntu/Python-3.13.7/python+0x28a374) (BuildId: c1408b7ecd69be204d23a50df1288230bd9ca6bd)\n\n0x5110001dcdf0 is located 0 bytes after 240-byte region [0x5110001dcd00,0x5110001dcdf0)\nallocated by thread T0 here:\n    #0 0x7ffff78fd9c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69\n    #1 0x555555a15097 in _PyMem_RawMalloc Objects/obmalloc.c:62\n    #2 0x555555a14468 in _PyMem_DebugRawAlloc Objects/obmalloc.c:2792\n    #3 0x555555a144d0 in _PyMem_DebugRawMalloc Objects/obmalloc.c:2825\n    #4 0x555555a16a0a in _PyMem_DebugMalloc Objects/obmalloc.c:2982\n    #5 0x555555a3e147 in PyObject_Malloc Objects/obmalloc.c:1400\n    #6 0x555555a6ea6f in _PyObject_MallocWithType Include/internal/pycore_object_alloc.h:46\n    #7 0x555555a6ea6f in _PyType_AllocNoTrack Objects/typeobject.c:2041\n    #8 0x555555a6ebf8 in PyType_GenericAlloc Objects/typeobject.c:2070\n    #9 0x555555a47924 in make_new_set Objects/setobject.c:1086\n    #10 0x555555a4964c in set_vectorcall Objects/setobject.c:2379\n    #11 0x555555bb4e2c in _PyEval_EvalFrameDefault Python/generated_cases.c.h:1123\n    #12 0x555555bdc0ae in _PyEval_EvalFrame Include/internal/pycore_ceval.h:119\n    #13 0x555555bdc28b in _PyEval_Vector Python/ceval.c:1816\n    #14 0x55555595a39b in _PyFunction_Vectorcall Objects/call.c:413\n    #15 0x55555595d4eb in _PyObject_VectorcallDictTstate Objects/call.c:135\n    #16 0x55555595d910 in _PyObject_Call_Prepend Objects/call.c:504\n    #17 0x555555a7debc in slot_tp_init Objects/typeobject.c:9816\n    #18 0x555555a719e0 in type_call Objects/typeobject.c:1997\n    #19 0x55555595a659 in _PyObject_MakeTpCall Objects/call.c:242\n    #20 0x55555595a93a in _PyObject_VectorcallTstate Include/internal/pycore_call.h:166\n    #21 0x55555595a96a in PyObject_CallNoArgs Objects/call.c:106\n    #22 0x7ffff7004bcc in module_init Modules/_asynciomodule.c:3665\n    #23 0x7ffff7004fb8 in module_exec Modules/_asynciomodule.c:3734\n    #24 0x555555a06fa6 in PyModule_ExecDef Objects/moduleobject.c:491\n    #25 0x555555c5d45a in exec_builtin_or_dynamic Python/import.c:815\n    #26 0x555555c5d47d in _imp_exec_dynamic_impl Python/import.c:4770\n    #27 0x555555c5de55 in _imp_exec_dynamic Python/clinic/import.c.h:513\n    #28 0x555555a02aeb in cfunction_vectorcall_O Objects/methodobject.c:511\n    #29 0x55555595db69 in _PyVectorcall_Call Objects/call.c:273\n    #30 0x55555595e1a8 in _PyObject_Call Objects/call.c:348\n\nSUMMARY: AddressSanitizer: heap-buffer-overflow Objects/setobject.c:505 in set_dealloc\nShadow bytes around the buggy address:\n  0x5110001dcb00: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa\n  0x5110001dcb80: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00\n  0x5110001dcc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x5110001dcc80: 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa fa\n  0x5110001dcd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n=\u003e0x5110001dcd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[fa]fa\n  0x5110001dce00: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00\n  0x5110001dce80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x5110001dcf00: 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa fa\n  0x5110001dcf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  0x5110001dd000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07\n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==4613==ABORTING\n```\n\u003c/details\u003e\n\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\nPython 3.13.7 (main, Sep 14 2025, 14:06:10) [GCC 13.3.0]\n","author":{"url":"https://github.com/kcatss","@type":"Person","name":"kcatss"},"datePublished":"2025-09-17T17:24:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/139071/cpython/issues/139071"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:014e91f5-9196-3c28-deae-f9c65ef0423f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9618:1FFDC1:21B3B8:2F5729:696A0621
html-safe-noncef31362c2bd3dc4b0eb4a6e84f49dc4fb834a7256a8f1718950c68c2f382d95b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjE4OjFGRkRDMToyMUIzQjg6MkY1NzI5OjY5NkEwNjIxIiwidmlzaXRvcl9pZCI6IjU2NTI1NjA4NTE3NzY0Mzk4NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac97540e8db3c5be9b898451822e03acb0febb36ce3b5dd92809f321a14800fa20
hovercard-subject-tagissue:3427168935
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/139071/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b2d387004be412d42fccb43c110dc7162df4f32b46109303478fb8128fcdbc22/python/cpython/issues/139071
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b2d387004be412d42fccb43c110dc7162df4f32b46109303478fb8128fcdbc22/python/cpython/issues/139071
og:image:altCrash report What happened? heap overflow by corrupted PySetObject internal data(used) Version Python 3.13.7 (main, Sep 14 2025, 14:06:10) [GCC 13.3.0] Root Cause CPython PySetObject entry states: ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekcatss
hostnamegithub.com
expected-hostnamegithub.com
None578c119ff0247c8b2f2491fbf4fc0395cdf909d4df66598cebdc96ddfc4418dc
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release671c2f67171dbced24284331f3133a613d08c366
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/139071#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F139071
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F139071
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/139071
Reloadhttps://github.com/python/cpython/issues/139071
Reloadhttps://github.com/python/cpython/issues/139071
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/139071
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/139071
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/139071
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/139071
heap overflow in set_dealloc (setobject.c)https://github.com/python/cpython/issues/139071#top
https://github.com/rhettinger
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
https://github.com/kcatss
https://github.com/kcatss
kcatsshttps://github.com/kcatss
on Sep 17, 2025https://github.com/python/cpython/issues/139071#issue-3427168935
https://github.com/python/cpython/blob/3.13/Include/cpython/setobject.h#L7-L9https://github.com/python/cpython/blob/3.13/Include/cpython/setobject.h#L7-L9
https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L144https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L144
https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L165https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L165
https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L175-L177https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L175-L177
https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L152-L153https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L152-L153
https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L185-L191https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L185-L191
https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L494-L514https://github.com/python/cpython/blob/3.13/Objects/setobject.c#L494-L514
rhettingerhttps://github.com/rhettinger
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.