Repository navigation
Conversation
Close admission to thread-specific heap setters and drain in-flight users before invalidating and deleting the allocator's pthread key. Cover late thread initialization and a setter paused at pthread_setspecific with native exit regressions. Builds on the key-invalidation diagnosis in oven-sh#698 and closes the remaining in-flight setter window. Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. WalkthroughThe pthread TLS-key shutdown path now blocks new setters and waits for active setters before deleting the key. Two regression tests cover shutdown and thread-key association. CMake builds the tests, and CI runs them in eligible lanes. ChangesMimalloc TLS shutdown
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No demonstrated issue prevents merging, but the exit tests and CI integration should receive normal build and test checks before merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Comment |
jsccan enterexit()while a collector thread still allocates and parks. The vendored allocator deletes its pthread key, but late heap associations can still use the old number. ParkingLot can acquire that recycled key and then read ami_theap_t*as itsThreadSpecificdata: the heap'stldbecomes a fakeThreadData, andparkingLockpoints into allocator metadata. This explains the intermittent glibc mutex-type and priority-ceiling assertions at shell exit.Close admission to new setters and drain setters already in flight before invalidating and deleting the key. Add native regressions for a first allocation after shutdown and a setter paused at
pthread_setspecific. The latter uses an explicit handshake, with no timer-based success condition. The native CI jobs execute both tests when the shell uses mimalloc. Existing JSC stress configurations remain unchanged.This builds on Dylan Conway's diagnosis in #698, with contributor credit preserved. Invalidation alone leaves the already-loaded-key window open; the in-flight regression fails on that version as well as the original allocator.
Validation:
The matched diagnostic retains the same 1 ms post-teardown scheduling window and pre-glibc trap in both arms. Neither diagnostic change is in this PR.