Closed VoxSciurorum closed 3 years ago
This code has a race in the loop()
function between the spawned execution of work()
, which uses the VLA vla
, and the implicit free of vla
at the end of the loop body. Those races could certainly lead to stack corruption during parallel execution.
Yes, the code has a bug but I want to keep this open to figure out why I didn't get a report out of the race detector.
Yes, let's keep this issue open to investigate that issue.
I suspect we're missing some necessary instrumentation for Cilksan to find this race. Since Cilksan uses compiler instrumentation, we should be able to spot such an issue at the LLVM IR level. That's good news, since LLVM IR is generally easier to read than assembly, especially when using debug builds of the compiler.
For reference, you can ask the compiler to generate LLVM IR for the instrumented code by adding the compiler flags -S -emit-llvm -ftapir=none
to the normal clang command for compiling the test case. Broadly speaking, in the LLVM IR, the Cilksan instrumentation within a function shows up as calls to functions that start with __csan
or __csi
.
By the way, in case you need it, there are Emacs and Vim modes for LLVM IR in the opencilk-project repo, in the subdirectory llvm/utils
.
This issue has been resolved in version 1.0.
This crashes with various forms of stack corruption when not run serially.