Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TSan] ocamlrun should never be linked with -fsanitize=thread #13042

Open
OlivierNicole opened this issue Mar 21, 2024 · 0 comments
Open

[TSan] ocamlrun should never be linked with -fsanitize=thread #13042

OlivierNicole opened this issue Mar 21, 2024 · 0 comments

Comments

@OlivierNicole
Copy link
Contributor

Currently, when the compiler is configured with TSan enabled, only native programs are compiled with TSan instrumentation; bytecode programs produced by ocamlc are not. However, ocamlrun gets linked with the -fsanitize=thread flag. This is bad, because it causes some libc functions like mmap or memmove to be intercepted and replaced with special TSan versions, even though none of the OCaml nor C runtime is instrumented.

The consequences so far have been minor (we usually don’t use bytecode when TSan is enabled and vice versa), but it causes some occasional false alarms in the TSan CI, like lib-format/mc_pr586_par.ml, which has been flaky for a while. This false alarm is due to TSan seeing memory being accessed by the occasional memmove or strcpy, without any synchronization (because the synchronization operations are not instrumented).

Ideally, ocamlrun should not be linked with -fsanitize=thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant