| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
I have an AI agent that attempted to fix a crash in Python 3.13 and this is the report it gave me.
Components: Interpreter Core (Objects/dictobject.c, Include/internal/pycore_dict.h)
Version: Python 3.14.7 (main, Aug 10 2026, 07:46:56) [GCC 16.1.1 20260728]
OS: Linux (Arch Linux, x86-64)
Interpreter: /usr/bin/python3.14 (system package, python 3.14.7-1 from pacman, NOT a uv-built interpreter — debug symbols available via debuginfod)
Triplet: x86_64-linux-gnu
CPython 3.14.7 segfaults inside _DK_ENTRIES() in pycore_dict.h:252 during a dict
insertion via the split-keys lookup path (unicodekeys_lookup_unicode → insert_split_key
→ insertdict). The dk (keys table) pointer passed to _DK_ENTRIES is 0x64 — a tiny
non-zero offset from NULL — causing a SEGV_MAPERR (accessing unmapped memory at address
0x64). This is a corrupted dict internal pointer, likely from a use-after-free or memory
corruption in the split-keys dict implementation.
Reproducible by running the Hermes Agent CLI (hermes) under Python 3.14.7. The crash
occurs during startup, inside a class __init__ that performs a dict.__setitem__ call.
The exact Python-level trigger is unknown because the segfault prevents a Python traceback,
but the C-level backtrace is fully symbolized.
Command line that triggered the crash:
/usr/bin/python3 /home/zatt/.local/share/mise/installs/pipx-hermes-agent/latest/bin/hermes
Hermes version: 0.19.0 (pipx-installed, Python 3.14 site-packages)
Machine details:
dict.__setitem__ completes normally during class initialization. No crash.
Process receives SIGSEGV (signal 11, SEGV_MAPERR) at libpython3.14.so.1.0 offset
0x18a542. The crashing instruction dereferences dk->dk_log2_index_bytes where dk = 0x64.
#0 _DK_ENTRIES (dk=<optimized out>) at ./Include/internal/pycore_dict.h:252
252→ size_t index = (size_t)1 << dk->dk_log2_index_bytes;
#1 do_lookup (mp=0x0, dk=0x64, key=<optimized out>, hash=<optimized out>, check_lookup=<optimized out>) at Objects/dictobject.c:1005
#2 unicodekeys_lookup_unicode (dk=dk@entry=0x64, key=key@entry=0x7d8754ea62b0,
hash=-915039993034951925) at Objects/dictobject.c:1098
#3 insert_split_key (keys=0x64, key=0x7d8754ea62b0,
hash=-915039993034951925) at Objects/dictobject.c:1846
#4 insertdict.isra.0 (mp=mp@entry=0x7d8754ed50b0, key=0x7d8754ea62b0,
hash=-915039993034951925, value=0x7d8754e46100, interp=<optimized out>) at Objects/dictobject.c:1900
#5 setitem_take2_lock_held (mp=0x7d8754ed50b0, key=<optimized out>, value=<optimized out>) at Objects/dictobject.c:2699
#6 _PyDict_SetItem_Take2 (mp=0x7d8754ed50b0, key=<optimized out>, value=<optimized out>) at Objects/dictobject.c:2707
#7 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=0x7d8768014ac8, throwflag=<optimized out>) at Python/generated_cases.c.h:9988
→ calling _PyDict_SetItem_Take2
#8 _PyEval_EvalFrame (throwflag=0, tstate=0x576ec8f711b0, frame=0x7d8768014448) at ./Include/internal/pycore_ceval.h:120
#9–21 Python call chain: _PyEval_Vector → _PyFunction_Vectorcall → _PyObject_VectorcallDictTstate
→ _PyObject_Call_Prepend → call_method → slot_tp_init → type_call → _PyObject_MakeTpCall
→ ... more eval frames ...
The crashing frame (#0) has these notable registers:
rax = 0x64 (same as dk — the corrupted pointer) rbx = 0xf34d1ff973e0330b (hash value, -915039993034951925 as signed) rcx = 0x7d8754e46100 (value being inserted) rdx = 0xf34d1ff973e0330b (hash, duplicate in rdx) rdi = 0x64 (dk pointer — THIS IS THE BUG) rsi = 0x7d8754ea62b0 (key object) r10 = 0x64 (duplicate of dk) r15 = 0x64 (duplicate of dk)
Note that rdi, r10, and r15 all hold 0x64 — this is the corrupted dk pointer
being shuffled between registers before the dereference at _DK_ENTRIES.
The crashing thread (TID 5567, "Thread-5 (proce") is one of 7 threads in the process.
Other threads at crash time:
No other thread was in a dict operation. The crash is isolated to thread 5567 doing a
dict insertion during class __init__.
The dk pointer being 0x64 suggests either:
The split-keys path (unicodekeys_lookup_unicode → insert_split_key) is the
"split dict" optimization for dicts with all-Unicode keys. This is commonly used for
object __dict__ and for kwargs dicts. Frame #14 is slot_tp_init — a class __init__
— so the dict in question is likely either the object's __dict__ or a kwargs dict
passed to __init__.
I did not attach the core dump to this issue because it contains the process's full
memory (potentially including sensitive data). I can provide it privately to a core
developer if needed — let me know the secure channel.
type-bug, interpreter-core, 3.14, segfault, dict
# Add a code block here, if required3.14, 3.13
Linux
No response
| Back | FazBrowse Home | New Git URL |
Activity
gvanrossum commented on Sep 28, 2026
Is it fixed in main? (3.15c2)
hugovk commented on Sep 28, 2026
@ZattsPlace Please try and create a minimal reproducer with as few dependencies as necessary, that doesn't require installing and running a large app like Hermes Agent.
https://stackoverflow.com/help/minimal-reproducible-example
Claude can't repro in its sandbox. Hermes Agent has 70 dependencies, including 19 with compiled extensions, so we can't rule out a problem in one of those.
vstinner commented on Sep 30, 2026
If possible, try to run your application with a debug build of Python to enable additional debug checks.
StanFromIreland commented on Oct 18, 2026
Since there has been no reply, I will close this.