taurus v0.11.3
Fix — benchmark-ips segfault with 15,000+ alive documents (#261)
direct_parse used a shared thread-local overflow hash table for
compact pointer encoding of next_sibling and attribute edges.
Under benchmark-ips (which keeps every return value alive), the
table accumulated entries from 15,000+ simultaneously-alive
documents. Combined with malloc address reuse, this caused
cross-document pointer corruption and a segfault in
taurus_node_freeze.
Three-part fix (all in direct_parse.c):
-
Overflow-table-free wiring: all compact pointer edges
(parent, child, sibling, attribute) now use direct offset
arithmetic.direct_parsenever touches the thread-local
overflow state — it's fully self-contained. -
Contiguous elem+attr allocation:
elem_blockand
attr_blockare now ONE combinedpool_alloccall. Offsets
between elements and attributes are bounded by the allocation
size (<4MB), always fitting in int32. -
Right-sized pool pages:
page_sizeis set to
elem_bytes + attr_bytes + text_headroom(capped at 4MB).
This keeps the bulk allocation and text/comment/CDATA nodes
on the same pool page, within int32 offset range.
Verified: 15,000 simultaneously-alive 38KB documents parsed,
child_count-verified, and freed — zero crashes, zero corruption
(both plain and ASAN).