Skip to content
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

[AArch64] Fix scheduling model issue #96394 #97047

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Conversation

david-arm
Copy link
Contributor

The NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first.

The NeoverseZeroMove predicate assumes that the first operand
is always an immediate, which isn't always true. For example,
it could be a stack offset, etc. This patch fixes that by
checking if the operand is an immediate first.
@llvmbot
Copy link
Member

llvmbot commented Jun 28, 2024

@llvm/pr-subscribers-backend-aarch64

Author: David Sherwood (david-arm)

Changes

The NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first.


Full diff: https://github.com/llvm/llvm-project/pull/97047.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td (+3-2)
diff --git a/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td b/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
index 97abec10f7942..33b76a4f65f05 100644
--- a/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
+++ b/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
@@ -60,8 +60,9 @@ def NeoverseZeroMove : MCSchedPredicate<
                            // MOV Wd, #0
                            // MOV Xd, #0
                            CheckAll<[CheckOpcode<[MOVZWi, MOVZXi]>,
-                                     CheckAll<[CheckImmOperand<1, 0>,
-                                               CheckImmOperand<2, 0>]>]>,
+                                     CheckIsImmOperand<1>,
+                                     CheckImmOperand<1, 0>,
+                                     CheckImmOperand<2, 0>]>,
                            // MOV Wd, WZR
                            // MOV Xd, XZR
                            // MOV Wd, Wn

@davemgreen davemgreen requested a review from rj-jesus June 28, 2024 12:33
@davemgreen
Copy link
Collaborator

Is it possible to add a quick test to make sure we don't hit the same thing again? Otherwise it LGTM

@david-arm
Copy link
Contributor Author

Is it possible to add a quick test to make sure we don't hit the same thing again? Otherwise it LGTM

Done! I've tried to add the simplest mir file test I could think of and verified it crashes without this patch.

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

Copy link
Contributor

@rj-jesus rj-jesus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, LGTM!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 1, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux running on sanitizer-buildbot2 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/830

Here is the relevant piece of the build log for the reference:

Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/i386-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m32', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-Wthread-safety', '-Wthread-safety-reference', '-Wthread-safety-beta', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 9980 tests, 80 workers --
Testing: 
FAIL: libFuzzer-x86_64-libcxx-Linux :: fuzzer-leak.test (1 of 9980)
******************** TEST 'libFuzzer-x86_64-libcxx-Linux :: fuzzer-leak.test' FAILED ********************
Exit Code: 77

Command Output (stderr):
--
RUN: at line 3: /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest
+ /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest
RUN: at line 4: /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ThreadedLeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-ThreadedLeakTest
+ /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ThreadedLeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-ThreadedLeakTest
RUN: at line 5: /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTimeoutTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTimeoutTest
+ /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTimeoutTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTimeoutTest
RUN: at line 7: rm -rf /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus && mkdir -p /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
+ rm -rf /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
+ mkdir -p /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
RUN: at line 8: not  /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=100000 -detect_leaks=1 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus 2>&1 | FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/fuzzer-leak.test --check-prefix=LEAK_DURING
+ FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/fuzzer-leak.test --check-prefix=LEAK_DURING
+ not /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=100000 -detect_leaks=1 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
RUN: at line 17: /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=0 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
+ /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=0 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1189928568
INFO: Loaded 1 modules   (4 inline 8-bit counters): 4 [0x55d5015da1d8, 0x55d5015da1dc), 
INFO: Loaded 1 PC tables (4 PCs): 4 [0x55d5015da1e0,0x55d5015da220), 
INFO:        1 files found in /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: seed corpus: files: 1 min: 1b max: 1b total: 1b rss: 31Mb

=================================================================
==1128730==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x55d5015cc4ed in operator new(unsigned long) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55d5015ce954 in LLVMFuzzerTestOneInput /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp:13:12
    #2 0x55d501478e46 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13
    #3 0x55d5014785b5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7
    #4 0x55d50147a5c2 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:829:7
    #5 0x55d50147a8e8 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:867:3
    #6 0x55d50146851b in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:915:6
Step 9 (test compiler-rt gcc) failure: test compiler-rt gcc (failure)
...
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/i386-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m32', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-Wthread-safety', '-Wthread-safety-reference', '-Wthread-safety-beta', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/b/sanitizer-x86_64-linux/build/build_gcc/lib/clang/19/lib/x86_64-unknown-linux-gnu". This path was found by running ['/b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-print-runtime-dir'].
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 9980 tests, 80 workers --
Testing: 
FAIL: libFuzzer-x86_64-libcxx-Linux :: fuzzer-leak.test (1 of 9980)
******************** TEST 'libFuzzer-x86_64-libcxx-Linux :: fuzzer-leak.test' FAILED ********************
Exit Code: 77

Command Output (stderr):
--
RUN: at line 3: /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest
+ /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest
RUN: at line 4: /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ThreadedLeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-ThreadedLeakTest
+ /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ThreadedLeakTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-ThreadedLeakTest
RUN: at line 5: /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTimeoutTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTimeoutTest
+ /b/sanitizer-x86_64-linux/build/build_gcc/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTimeoutTest.cpp -o /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTimeoutTest
RUN: at line 7: rm -rf /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus && mkdir -p /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
+ rm -rf /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
+ mkdir -p /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
RUN: at line 8: not  /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=100000 -detect_leaks=1 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus 2>&1 | FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/fuzzer-leak.test --check-prefix=LEAK_DURING
+ FileCheck /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/fuzzer-leak.test --check-prefix=LEAK_DURING
+ not /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=100000 -detect_leaks=1 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
RUN: at line 17: /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=0 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
+ /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest -runs=0 /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1189928568
INFO: Loaded 1 modules   (4 inline 8-bit counters): 4 [0x55d5015da1d8, 0x55d5015da1dc), 
INFO: Loaded 1 PC tables (4 PCs): 4 [0x55d5015da1e0,0x55d5015da220), 
INFO:        1 files found in /b/sanitizer-x86_64-linux/build/build_gcc/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/fuzzer-leak.test.tmp-corpus
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: seed corpus: files: 1 min: 1b max: 1b total: 1b rss: 31Mb

=================================================================
==1128730==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x55d5015cc4ed in operator new(unsigned long) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55d5015ce954 in LLVMFuzzerTestOneInput /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp:13:12
    #2 0x55d501478e46 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:614:13
    #3 0x55d5014785b5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7
    #4 0x55d50147a5c2 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:829:7
    #5 0x55d50147a8e8 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:867:3
    #6 0x55d50146851b in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:915:6

@david-arm david-arm deleted the fix_96394 branch July 1, 2024 13:35
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
The NeoverseZeroMove predicate assumes that the first operand is always
an immediate, which isn't always true. For example, it could be a stack
offset, etc. This patch fixes that by checking if the operand is an
immediate first.
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
The NeoverseZeroMove predicate assumes that the first operand is always
an immediate, which isn't always true. For example, it could be a stack
offset, etc. This patch fixes that by checking if the operand is an
immediate first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants