Runtime Detection of Data Races in OCaml with ThreadSanitizer
summary
ThreadSanitizer is integrated into the OCaml compiler and runtime via LLVM-style instrumentation and a runtime library that records vector clocks and shadow memory for each word so it can report true happens‑before violations and backtraces. The port handles exceptions and effects by emitting function‑entry/exit events, runs on x86_64 Linux 64‑bit only, and is merged upstream (backport to 5.1 RC3, mainline in 5.2). Expect 2x–7x slowdown, higher memory use, and missed races on unexecuted paths or evicted shadow entries.
AI-written summary · about
chapters (5)
- 0:00ThreadSanitizer for OCaml
- 3:35How ThreadSanitizer detects races
- 8:11Instrumenting OCaml
- 13:13OCaml memory model
- 16:22Performance impact and status
related talks
22mData race detection
44m"go test -race" Under the Hood
01h 04mDebugging data races
15mSound and partially-complete static analysis of data-races in GPU programs
48mThreadSanitizer and Heap Sampling
19mEfficient Timestamping for Sampling-Based Race Detection
16mFast Atomicity Monitoring
24mRacerD - Compositional Static Race Detection
