ocaml-multicore/domainslib

Possible data races in Chan

OlivierNicole opened this issue · 0 comments

I'm currently experimenting with a ThreadSanitizer instrumentation pass for OCaml that allows to detect some data races in OCaml programs.

When running Domainslib's test suite, ThreadSanitizer reported two possible data races in lib/chan.ml:

Both have a similar pattern. After looking at it, I think they are indeed data races (an unsynchronised read and write), however it seems to me that they are benign in this library, assuming the OCaml memory model. That being said, I could use a confirmation from someone more experienced with the memory model to confirm.