Open emilio opened 6 years ago
cc @michaelwoerister, since I recall he mentioned about parallelizing LLVM's execution under rustc.
Thanks for the detailed bug report, @emilio!
@alexcrichton, do you know if we are compiling LLVM with LLVM_ENABLE_THREADS
?
@alexcrichton, do you know if we are compiling LLVM with LLVM_ENABLE_THREADS?
We are. Also, the crashes I was seeing were due to the ordering of the passes I did, which broke some assumptions in LLVM. I managed to get #48346 working after all :)
Can this issue be closed then?
No, I meant the release crashes. The debug assertions and data race with -Z time-llvm-passes
are still present.
I hit this assertion today. It's reproducible when compiling a single file with a "hello world" main function. Adding -Ccodegen-units=1
stops the assertion from firing.
For context, I was trying to add PGO support to rustc, and I was adding a couple LLVM passes for profile info generation and usage, and the only thing I managed to do is crashing rustc under LLVM, or that my changes did nothing, so I built with debug LLVM to check whether I was doing something obviously wrong. Furthermore, I wanted to see if the passes I was adding were actually being executed, thus I tried
-Z time-llvm-passes
.~For the record, I am hitting release crashes under
llvm::SelectionDAGISel
with my changes (without-Z time-llvm-passes
), so I suspect this is a more serious issue than "LLVM uses a static hashmap to store timing info".~ These assertions reproduce without any change on 16362c737fe740f630ada06349fa9004e2a51bb7.On a rustc compiled with the following
config.toml
(comments stripped for brevity):Compiled from 16362c737fe740f630ada06349fa9004e2a51bb7, with:
Given a
t.rs
file like:Building it with:
Asserts with:
I need to compile a slightly more complex file to be able to catch it under rr, but the stack is:
The threads are doing:
Thread 1:
Thread 2:
Thread 3 is the crashing thread, with the first stack.
Thread 4:
Thread 5:
Thread 6 is running the same LLVM pass:
Thread 7:
Thread 8:
Thread 9: