Skip to content

shulaoda/mimalloc-v3-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mimalloc-safe v3 macOS TLS reproduction

Reproduces two SIGABRT failure modes on macOS when using mimalloc-safe with the v3 feature in napi addons.

Structure

crates/
  addon-a/         — napi addon with mimalloc v3
  addon-b/         — another napi addon with mimalloc v3
  addon-mode-b/    — single addon with background threads
scripts/
  switch-deps.sh   — rewrite all Cargo.toml to a specific version
  build.sh         — cargo build all crates + copy .node files
test.mjs           — Mode A test (load two addons in one process)
test-mode-b.mjs    — Mode B test (background threads + process exit)

Quick start

# Test with the fix (0.1.62) — should pass both modes
npm run switch:thread-local

# Reproduce Mode A crash (FIXED_SLOT, two addons share TCB[108])
npm run switch:fixed-slot

# Reproduce Mode B crash (DYNAMIC_PTHREADS, key deleted on exit)
npm run switch:dynamic

Commands

Command What it does
npm run build Build all three crates, copy .node files
npm test Run Mode A + Mode B
npm run test:a Run Mode A only
npm run test:b Run Mode B only
npm run switch:fixed-slot Switch to 0.1.58 (FIXED_SLOT) → build → test
npm run switch:dynamic Switch to 0.1.61 (DYNAMIC_PTHREADS) → build → test
npm run switch:thread-local Switch to 0.1.62 (THREAD_LOCAL) → build → test

Expected results

Version TLS model Mode A Mode B
0.1.58 (libmimalloc-sys2 0.1.55) FIXED_SLOT 💥 100% crash ✅ pass
0.1.61 DYNAMIC_PTHREADS ✅ pass 💥 crash
0.1.62 THREAD_LOCAL + RECURSE_GUARD ✅ pass ✅ pass

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors