-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Reapply "[ORC] Replace ORC's baked-in dependence ... (#163027)" with … #164340
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
Conversation
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
ff8e0fb to
1cf8ffd
Compare
This fixes the following error we're getting internally, perhaps only with the latest clang: llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h:136:24: error: missing '#include <__fwd/vector.h>'; default argument of 'vector' must be defined before it is used This is a fix for llvm#164340.
This fixes the following error we're getting internally, perhaps only with the latest clang: llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h:136:24: error: missing '#include <__fwd/vector.h>'; default argument of 'vector' must be defined before it is used This is a fix for #164340.
This fixes a potentially unused variable that's only used in an assert. This is a fix for llvm#164340.
This fixes a potentially unused variable that's only used in an assert. This is a fix for #164340.
|
We're seeing test failures when tsan is enabled. Attached is a scrubbed backtrace with the relevant information: test.log. Can you please take a look? |
Hi @googlewalt. I'm traveling at the moment and not in a position to reproduce, but I suspect this is caused by the assert at the top of diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 8d413a35f5a9..b82d27b096e6 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -230,8 +230,12 @@ void AsynchronousSymbolQuery::notifySymbolMetRequiredState(
}
void AsynchronousSymbolQuery::handleComplete(ExecutionSession &ES) {
- assert(OutstandingSymbolsCount == 0 &&
+#ifndef NDEBUG
+ ES.runSessionLocked([this]() {
+ assert(OutstandingSymbolsCount == 0 &&
"Symbols remain, handleComplete called prematurely");
+ });
+#endif // NDEBUG
class RunQueryCompleteTask : public Task {
public: |
|
The race is from decrementing
Which happens after a different thread reads it as part of llvm-project/llvm/lib/ExecutionEngine/Orc/Core.cpp Lines 3046 to 3048 in 8c29bce
Previously, that call to |
Nope. Prior to this change, tsan tests pass even with that assert changed to this: for (auto &Q : *CompletedQueries) {
if (!Q->isComplete())
dbgs() << "Q is not complete";
Q->handleComplete(*this);
}So this seems like a new race somehow. Anyway, at trunk, this fix seems to make the tsan errors go away, although I have no clue if it's a good change: runSessionLocked([&]() {
for (auto &UQ : EmitQueries->Updated)
if (UQ->isComplete())
UQ->handleComplete(*this);
});WDYT? |
Ahh. Thanks for identifying that!
We don't want that -- query handlers need to be run outside the session lock. I think we'll just need to filter the for (auto &CQ : EmitQueries->CompletedQueries)
CQ->handleComplete(*this); |
I didn't think so, but it was worth a shot ;)
Created #165063 to do that, and it fixes the tsan issues. |
|
Thanks very much for the fix! |
After #164340 there is a tsan race on `OutstandingSymbolsCount` when decrementing it in `notifySymbolMetRequiredState` vs reading it in `isComplete()`. Fix this by having `IL_emit` filter out non-completed queries when it has the lock to do so, and that way we avoid needing to call `isComplete()` later.
After llvm#164340 there is a tsan race on `OutstandingSymbolsCount` when decrementing it in `notifySymbolMetRequiredState` vs reading it in `isComplete()`. Fix this by having `IL_emit` filter out non-completed queries when it has the lock to do so, and that way we avoid needing to call `isComplete()` later.
…ith … (llvm#164340) …fixes. This reapplies c8c86ef, which was reverted in 13ca872 due to bot failures. Those failures were compilation errors exposed when LLVM is built with LLVM_ENABLE_EXPENSIVE_CHECKS=On. They have been fixed in this commit.
This fixes the following error we're getting internally, perhaps only with the latest clang: llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h:136:24: error: missing '#include <__fwd/vector.h>'; default argument of 'vector' must be defined before it is used This is a fix for llvm#164340.
This fixes a potentially unused variable that's only used in an assert. This is a fix for llvm#164340.
After llvm#164340 there is a tsan race on `OutstandingSymbolsCount` when decrementing it in `notifySymbolMetRequiredState` vs reading it in `isComplete()`. Fix this by having `IL_emit` filter out non-completed queries when it has the lock to do so, and that way we avoid needing to call `isComplete()` later.
…ith … (llvm#164340) …fixes. This reapplies c8c86ef, which was reverted in 13ca872 due to bot failures. Those failures were compilation errors exposed when LLVM is built with LLVM_ENABLE_EXPENSIVE_CHECKS=On. They have been fixed in this commit.
This fixes the following error we're getting internally, perhaps only with the latest clang: llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h:136:24: error: missing '#include <__fwd/vector.h>'; default argument of 'vector' must be defined before it is used This is a fix for llvm#164340.
This fixes a potentially unused variable that's only used in an assert. This is a fix for llvm#164340.
After llvm#164340 there is a tsan race on `OutstandingSymbolsCount` when decrementing it in `notifySymbolMetRequiredState` vs reading it in `isComplete()`. Fix this by having `IL_emit` filter out non-completed queries when it has the lock to do so, and that way we avoid needing to call `isComplete()` later.
…fixes.
This reapplies c8c86ef, which was reverted in 13ca872 due to bot failures. Those failures were compilation errors exposed when LLVM is built with LLVM_ENABLE_EXPENSIVE_CHECKS=On. They have been fixed in this commit.