jemalloc/test
Azat Khuzhin c68b7b1cac test: add tcache_fiber_migration standalone LTO reproducer
Exercises the tsd thread-pointer hoisting bug: ucontext fibers do
free/swapcontext/malloc in one frame on a worker pool, so a fiber routinely
resumes on a different OS thread; under whole-program LTO the inlined fastpath
then frees/allocs against the previous thread's tcache and crashes.

It is a standalone program (no test harness, so it can be static-linked without
symbol clashes), calling jemalloc via JEMALLOC_MANGLE and linked statically with
--whole-archive so the allocator inlines next to the swapcontext.  Built only
when -flto is in the build flags -- without LTO the allocator is not inlined and
the bug cannot reproduce, so the test would be a meaningless always-pass -- and
gated on ELF + static + have_ucontext (a configure link test, since musl
declares but does not implement getcontext/makecontext/swapcontext).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 12:54:12 +02:00
..
analyze De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
include/test De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
integration test: add tcache_fiber_migration standalone LTO reproducer 2026-06-22 12:54:12 +02:00
src Remove safety check abort mallctl 2026-06-02 13:24:23 -04:00
stress Remove batch_alloc API 2026-05-22 23:34:10 -07:00
unit Replace JET_WRAP_ with JET_EXTERN_INLINE macro 2026-06-18 13:02:23 -04:00
test.sh.in Speculative fix for Windows tasks that sometime fail on aligned_alloc 2026-06-02 13:24:23 -04:00