Actors and characters unregister under a different key than they register #38

Open
opened 2026-08-02 18:33:22 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md, "Found while writing the manual" -> "Defects with no prior entry", item 3 (at bbb7b8f)

akgl_actor_initialize (src/actor.c:46) and akgl_character_initialize
(src/character.c:39) register under the caller's untruncated name, while
akgl_heap_release_actor (src/heap.c:132) and akgl_heap_release_character
(src/heap.c:165) clear using the object's truncated 128-byte field.

Past 127 bytes those are different keys, so releasing leaves a live registry
entry pointing at a zeroed pool slot
-- a dangling lookup that returns a
recycled object.

Distinct from the "truncated registry keys can collide" issue, which describes
sprites and spritesheets, where the truncated name genuinely is the key. Here
the two sides simply disagree about which spelling to use, and either would work
as long as both used it.

Files: src/actor.c:46, src/character.c:39, src/heap.c:132, src/heap.c:165


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md, "Found while writing the manual" -> "Defects with no prior entry", item 3 (at bbb7b8f) `akgl_actor_initialize` (`src/actor.c:46`) and `akgl_character_initialize` (`src/character.c:39`) register under the caller's untruncated `name`, while `akgl_heap_release_actor` (`src/heap.c:132`) and `akgl_heap_release_character` (`src/heap.c:165`) clear using the object's truncated 128-byte field. Past 127 bytes those are different keys, so **releasing leaves a live registry entry pointing at a zeroed pool slot** -- a dangling lookup that returns a recycled object. Distinct from the "truncated registry keys can collide" issue, which describes sprites and spritesheets, where the truncated name genuinely *is* the key. Here the two sides simply disagree about which spelling to use, and either would work as long as both used it. **Files:** `src/actor.c:46`, `src/character.c:39`, `src/heap.c:132`, `src/heap.c:165` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.9.x milestone 2026-08-02 18:33:22 -04:00
tachikoma added the defectblast-radius:medium labels 2026-08-02 18:33:22 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:19 -04:00
Sign in to join this conversation.