Closed wheatman closed 9 months ago
I looked into this issue. Long story short, the reported races are not on memory accesses in the program itself, but on memory accesses from ASan's instrumentation. In this sense, the sanitizers are working, but Cilksan ends up checking ASan (to some extent) in addition to the program itself.
Here are some more details of what I've determined so far.
I'll need to think more about how to get Cilksan to clearly attribute these races to ASan's instrumentation, rather than the user program. Because the relevant memory accesses come from compiler-inserted instrumentation, there are no debug symbols for those memory accesses, nor is there any other attribution information attached to those accesses.
Was this fixed in the most recent version, it seems to to me. If so this issue can be closed. I'm not doing it myself in case the larger issue you see wasn't fixed and its just a change in optimizations and layout which no longer make the errors show up.
I agree, this issue seems to be fixed in the latest release.
Describe the bug
I have some code which I am compiling with multiple sanitizers (cilk, undefined, and address) and if I use any one individually, or any pair of them no issues are reported, but if I use all three than races are detected. While I think it is possible that these are true races since I don't know how the sanitizers work that well, if that is the case I feel like some warning should be given that states that is a possible, or known issue.
Another thing is that I rewrote my code in what I believe to be a equivalent way, just without some encapsulation and no issues are reported with the sanitizers.
Expected behavior
Either no races, a warning when compiling with sanitizers that won't work together, or a warning in the race detection that points me to the cause of the issue being inside of another sanitizer.
OpenCilk version
clang version 14.0.6 (https://github.com/OpenCilk/opencilk-project fc90ded2b090672f84c58d12d8d85cd999eb6c1a)
Steps to reproduce (include relevant output)
The following code causes the issue when compiled with
clang++ -Og -fopencilk -fsanitize=cilk,address,undefined -o basic test.cpp
The following code does basically the same thing, but does not cause the issue
The output is