Files
Azat KhuzhinandClaude Fable 5 40b4b13bed Update jemalloc: guard TSD thread-locals against LTO hoisting
Under whole-program LTO the address of the TSD thread-local is hoisted
out of the inlined malloc/free and kept across a user-space context
switch (fibers/coroutines), so a fiber resumed on another OS thread
keeps using the old thread's tcache, corrupting the heap. jemalloc now
takes TSD addresses via JEMALLOC_TLS_ADDR (an opaque accessor with an
inline initial-exec fast path), so re-enable LTO for jemalloc.

Add JEMALLOC_TLS_MODEL_INITIAL_EXEC to the preconfigured headers: it
gates the fast path and is defined on every platform that uses the
initial-exec TLS model (everything except e2k, where tls_model is
unsupported), matching the configure output.

Refs: https://github.com/ClickHouse/jemalloc/pull/7
Refs: https://github.com/ClickHouse/ClickHouse/issues/102460

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-22 13:25:20 +02:00
..