-
Notifications
You must be signed in to change notification settings - Fork 13.6k
clang/test/Analysis/live-stmts.cpp frequently flaky on aarch64 #126619
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
Comments
@llvm/issue-subscribers-clang-static-analyzer Author: Nico Weber (nico)
I reported a failure of clang/test/Analysis/live-stmts.cpp here: https://github.com//pull/125840#issuecomment-2648420648
@nikic replied: > Pretty sure I see spurious failures of that test on aarch64 all the time. So I'm filing this, to make sure we have an issue for tracking the flaky test. Failure log, from #125840 (comment): <details>
</details> |
@llvm/issue-subscribers-clang-static-analyzer Author: Nico Weber (nico)
I reported a failure of clang/test/Analysis/live-stmts.cpp here: https://github.com//pull/125840#issuecomment-2648420648
@nikic replied: > Pretty sure I see spurious failures of that test on aarch64 all the time. So I'm filing this, to make sure we have an issue for tracking the flaky test. Failure log, from #125840 (comment): <details>
</details> |
See llvm#126619 and discussion on llvm#125840
Multiple people reported flaky bot failures tied to clang/test/Analysis/live-stmts.cpp I tried reproducing the flaky behavior on my Linux x86_64 system, but the tests appears to be stable in my context. Only by looking at the failures reported, I could formulate a potential diagnosis. The output always looked almost the same, except that the Exprs dumped per Basic block were shuffled compared to my expectation. This suggests to me some ordering issue. If you look at the backing storage of `blocksEndToLiveness[B].liveExprs`, it uses `llvm::ImmutableSet<const Expr *>`. That container likely uses the pointer values as keys, thus the runtime values of the addresses influence the iteration order. To fix this, before dumping, I sort the expressions by their "beginLocs". It should be efficient enough for a debug checker, where there is no performance constraint. This should hopefully fix the flaky behavior on systems where ASLR works differently than (my) Linux system. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804
…lvm#126913) Multiple people reported flaky bot failures tied to `clang/test/Analysis/live-stmts.cpp` I tried reproducing the flaky behavior on my Linux x86_64 system, but the tests appears to be stable in my context. Only by looking at the failures reported, I could formulate a potential diagnosis. The output always looked almost the same, except that the Exprs dumped per Basic block were shuffled compared to my expectation. This suggests to me some ordering issue. If you look at the backing storage of `blocksEndToLiveness[B].liveExprs`, it uses `llvm::ImmutableSet<const Expr *>`. That container likely uses the pointer values as keys, thus the runtime values of the addresses influence the iteration order. To fix this, before dumping, I sort the expressions by their "beginLocs". It should be efficient enough for a debug checker, where there is no performance constraint. This should hopefully fix the flaky behavior on systems where ASLR works differently than (my) Linux system. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804
See llvm#126619 and discussion on llvm#125840
…lvm#126913) Multiple people reported flaky bot failures tied to `clang/test/Analysis/live-stmts.cpp` I tried reproducing the flaky behavior on my Linux x86_64 system, but the tests appears to be stable in my context. Only by looking at the failures reported, I could formulate a potential diagnosis. The output always looked almost the same, except that the Exprs dumped per Basic block were shuffled compared to my expectation. This suggests to me some ordering issue. If you look at the backing storage of `blocksEndToLiveness[B].liveExprs`, it uses `llvm::ImmutableSet<const Expr *>`. That container likely uses the pointer values as keys, thus the runtime values of the addresses influence the iteration order. To fix this, before dumping, I sort the expressions by their "beginLocs". It should be efficient enough for a debug checker, where there is no performance constraint. This should hopefully fix the flaky behavior on systems where ASLR works differently than (my) Linux system. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804
…2nd attempt) In my previous attempt (llvm#126913) of fixing the flaky case was on a good track when I used the begin locations as a stable ordering. However, I forgot to consider the case when the begin locations are the same among the Exprs. In an `EXPENSIVE_CHECKS` build, arrays are randomly shuffled prior to sorting them. This exposed the flaky behavior much more often basically breaking the "stability" of the vector - as it should. To fix this, I I use this time `Expr::getID` for a stable ID for an Expr. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804
…2nd attempt) (#127406) In my previous attempt (#126913) of fixing the flaky case was on a good track when I used the begin locations as a stable ordering. However, I forgot to consider the case when the begin locations are the same among the Exprs. In an `EXPENSIVE_CHECKS` build, arrays are randomly shuffled prior to sorting them. This exposed the flaky behavior much more often basically breaking the "stability" of the vector - as it should. Because of this, I had to revert the previous fix attempt in #127034. To fix this, I use this time `Expr::getID` for a stable ID for an Expr. Hopefully fixes #126619 Hopefully fixes #126804
See llvm#126619 and discussion on llvm#125840
…lvm#126913) Multiple people reported flaky bot failures tied to `clang/test/Analysis/live-stmts.cpp` I tried reproducing the flaky behavior on my Linux x86_64 system, but the tests appears to be stable in my context. Only by looking at the failures reported, I could formulate a potential diagnosis. The output always looked almost the same, except that the Exprs dumped per Basic block were shuffled compared to my expectation. This suggests to me some ordering issue. If you look at the backing storage of `blocksEndToLiveness[B].liveExprs`, it uses `llvm::ImmutableSet<const Expr *>`. That container likely uses the pointer values as keys, thus the runtime values of the addresses influence the iteration order. To fix this, before dumping, I sort the expressions by their "beginLocs". It should be efficient enough for a debug checker, where there is no performance constraint. This should hopefully fix the flaky behavior on systems where ASLR works differently than (my) Linux system. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804
…2nd attempt) (llvm#127406) In my previous attempt (llvm#126913) of fixing the flaky case was on a good track when I used the begin locations as a stable ordering. However, I forgot to consider the case when the begin locations are the same among the Exprs. In an `EXPENSIVE_CHECKS` build, arrays are randomly shuffled prior to sorting them. This exposed the flaky behavior much more often basically breaking the "stability" of the vector - as it should. Because of this, I had to revert the previous fix attempt in llvm#127034. To fix this, I use this time `Expr::getID` for a stable ID for an Expr. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804
…2nd attempt) (llvm#127406) In my previous attempt (llvm#126913) of fixing the flaky case was on a good track when I used the begin locations as a stable ordering. However, I forgot to consider the case when the begin locations are the same among the Exprs. In an `EXPENSIVE_CHECKS` build, arrays are randomly shuffled prior to sorting them. This exposed the flaky behavior much more often basically breaking the "stability" of the vector - as it should. Because of this, I had to revert the previous fix attempt in llvm#127034. To fix this, I use this time `Expr::getID` for a stable ID for an Expr. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804 (cherry picked from commit f378e52)
…2nd attempt) (llvm#127406) In my previous attempt (llvm#126913) of fixing the flaky case was on a good track when I used the begin locations as a stable ordering. However, I forgot to consider the case when the begin locations are the same among the Exprs. In an `EXPENSIVE_CHECKS` build, arrays are randomly shuffled prior to sorting them. This exposed the flaky behavior much more often basically breaking the "stability" of the vector - as it should. Because of this, I had to revert the previous fix attempt in llvm#127034. To fix this, I use this time `Expr::getID` for a stable ID for an Expr. Hopefully fixes llvm#126619 Hopefully fixes llvm#126804 (cherry picked from commit f378e52)
I reported a failure of clang/test/Analysis/live-stmts.cpp here: #125840 (comment)
@nikic replied:
So I'm filing this, to make sure we have an issue for tracking the flaky test.
Failure log, from #125840 (comment):
failure log
-- Testing: 20876 tests, 8 workers -- Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90 FAIL: Clang :: Analysis/live-stmts.cpp (12643 of 20876) ******************** TEST 'Clang :: Analysis/live-stmts.cpp' FAILED ******************** Exit Code: 1 Command Output (stderr): -- RUN: at line 1: /Users/thakis/src/llvm-project/out/gn/bin/clang -cc1 -internal-isystem /Users/thakis/src/llvm-project/out/gn/lib/clang/21/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -w -analyzer-checker=debug.DumpLiveExprs /Users/thakis/src/llvm-project/clang/test/Analysis/live-stmts.cpp 2>&1 | /Users/thakis/src/llvm-project/out/gn/bin/FileCheck /Users/thakis/src/llvm-project/clang/test/Analysis/live-stmts.cpp + /Users/thakis/src/llvm-project/out/gn/bin/clang -cc1 -internal-isystem /Users/thakis/src/llvm-project/out/gn/lib/clang/21/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -w -analyzer-checker=debug.DumpLiveExprs /Users/thakis/src/llvm-project/clang/test/Analysis/live-stmts.cpp + /Users/thakis/src/llvm-project/out/gn/bin/FileCheck /Users/thakis/src/llvm-project/clang/test/Analysis/live-stmts.cpp /Users/thakis/src/llvm-project/clang/test/Analysis/live-stmts.cpp:239:16: error: CHECK-EMPTY: is not on the line after the previous match // CHECK-EMPTY: ^ <stdin>:180:1: note: 'next' match was here ^ <stdin>:177:1: note: previous match ended here ^ <stdin>:178:1: note: non-matching line after previous match is here ImplicitCastExpr 0x11280d178 '_Bool' <LValueToRValue> ^ Input file: <stdin> Check file: /Users/thakis/src/llvm-project/clang/test/Analysis/live-stmts.cpp -dump-input=help explains the following input dump. Input was: <<<<<< . . . 175: 176: IntegerLiteral 0x110810820 'int' 1 177: 178: ImplicitCastExpr 0x11280d178 '_Bool' <LValueToRValue> 179: `-DeclRefExpr 0x11280d138 '_Bool' lvalue ParmVar 0x11280cfb8 'b' '_Bool' 180: empty:239 ! error: match on wrong line 181: ImplicitCastExpr 0x11280d190 '_Bool' <LValueToRValue> 182: `-DeclRefExpr 0x11280d158 '_Bool' lvalue ParmVar 0x11280cfb8 'b' '_Bool' 183: 184: BinaryOperator 0x11280d1a8 '_Bool' '||' 185: |-ImplicitCastExpr 0x11280d178 '_Bool' <LValueToRValue> . . . >>>>>> -- ******************** Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. ******************** Failed Tests (1): Clang :: Analysis/live-stmts.cpp
The text was updated successfully, but these errors were encountered: