Skip to content

[llvm-dis] Fix non-deterministic disassembly across multiple inputs #110988

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

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

peterwaller-arm
Copy link
Contributor

Prior to this patch, the LLVMContext was shared across inputs to llvm-dis.

Consequently, NamedStructTypes was shared across inputs, which impacts StructType::setName - if a name was reused across inputs, it would get renamed during construction of the struct type, leading to tricky to diagnose confusion.

Copy link

github-actions bot commented Oct 3, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Prior to this patch, the LLVMContext was shared across inputs to
llvm-dis.

Consequently, NamedStructTypes was shared across inputs, which impacts
StructType::setName - if a name was reused across inputs, it would get
renamed during construction of the struct type, leading to tricky to
diagnose confusion.
@peterwaller-arm peterwaller-arm merged commit e0b24d9 into llvm:main Oct 7, 2024
9 checks passed
@peterwaller-arm peterwaller-arm deleted the llvm-dis-determinism branch October 7, 2024 10:23
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 7, 2024

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

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

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)
...
[1226/1238] Building CXX object libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/tzdb_list.cpp.o
[1227/1238] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_entry.cpp.o
[1228/1238] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/algorithm.cpp.o
[1229/1238] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/ios.instantiations.cpp.o
[1230/1238] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/filesystem/directory_iterator.cpp.o
[1231/1238] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/filesystem/operations.cpp.o
[1232/1238] Building CXX object libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_demangle.cpp.o
[1233/1238] Linking CXX static library lib/libc++abi.a
[1234/1238] Building CXX object libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/tzdb.cpp.o
[1235/1238] Building CXX object libcxx/src/CMakeFiles/cxx_experimental.dir/experimental/time_zone.cpp.o
[1236/1238] Building CXX object libcxx/src/CMakeFiles/cxx_static.dir/locale.cpp.o
[1237/1238] Linking CXX static library lib/libc++.a
[1238/1238] Linking CXX static library lib/libc++experimental.a
[1968/1999] Linking CXX shared library /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.asan.so
[1970/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerExtFunctionsDlsym.cpp.o
[1971/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerExtFunctionsWindows.cpp.o
[1972/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerIOWindows.cpp.o
[1973/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerUtilDarwin.cpp.o
[1974/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerUtilFuchsia.cpp.o
[1975/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerExtraCountersDarwin.cpp.o
[1976/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerUtilWindows.cpp.o
[1977/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerExtraCountersWindows.cpp.o
[1978/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerExtraCounters.cpp.o
[1979/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer_interceptors.aarch64.dir/FuzzerInterceptors.cpp.o
[1980/1999] Linking CXX static library /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.fuzzer_interceptors.a
[1981/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer_main.aarch64.dir/FuzzerMain.cpp.o
[1982/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerExtFunctionsWeak.cpp.o
[1983/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerSHA1.cpp.o
[1984/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerCrossOver.cpp.o
[1985/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerUtilLinux.cpp.o
[1986/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerIOPosix.cpp.o
[1987/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerUtil.cpp.o
[1988/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerUtilPosix.cpp.o
[1989/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerIO.cpp.o
[1990/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerMutate.cpp.o
[1991/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerTracePC.cpp.o
[1992/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerDataFlowTrace.cpp.o
[1993/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerFork.cpp.o
[1994/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerLoop.cpp.o
[1995/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerDriver.cpp.o
[1996/1999] Building CXX object compiler-rt/lib/fuzzer/CMakeFiles/RTfuzzer.aarch64.dir/FuzzerMerge.cpp.o
[1997/1999] Linking CXX static library compiler-rt/lib/fuzzer/tests/libRTFuzzerTest.aarch64.a
[1998/1999] Linking CXX static library /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.fuzzer_no_main.a
[1999/1999] Linking CXX static library /home/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/20/lib/aarch64-unknown-linux-gnu/libclang_rt.fuzzer.a
[748/750] No install step for 'runtimes'
[750/750] Completed 'runtimes'
0596e616e2f6be2ec021b0e43c078417  llvm_build0/bin/clang
@@@BUILD_STEP get fuzzer-test-suite @@@
Cloning into 'fuzzer-test-suite'...
fatal: unable to access 'https://github.com/google/fuzzer-test-suite.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
Step 8 (get fuzzer-test-suite) failure: get fuzzer-test-suite (failure)
@@@BUILD_STEP get fuzzer-test-suite @@@
Cloning into 'fuzzer-test-suite'...
fatal: unable to access 'https://github.com/google/fuzzer-test-suite.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
program finished with exit code 1
elapsedTime=248.387956

Kyvangka1610 added a commit to Kyvangka1610/llvm-project that referenced this pull request Oct 7, 2024
* commit 'FETCH_HEAD':
  [X86] getIntImmCostInst - pull out repeated Imm.getBitWidth() calls. NFC.
  [X86] Add test coverage for llvm#111323
  [Driver] Use empty multilib file in another test (llvm#111352)
  [clang][OpenMP][test] Use x86_64-linux-gnu triple for test referencing avx512f feature (llvm#111337)
  [doc] Fix Kaleidoscope tutorial chapter 3 code snippet and full listing discrepancies (llvm#111289)
  [Flang][OpenMP] Improve entry block argument creation and binding (llvm#110267)
  [x86] combineMul - handle 0/-1 KnownBits cases before MUL_IMM logic (REAPPLIED)
  [llvm-dis] Fix non-deterministic disassembly across multiple inputs (llvm#110988)
  [lldb][test] TestDataFormatterLibcxxOptionalSimulator.py: change order of ifdefs
  [lldb][test] Add libcxx-simulators test for std::optional (llvm#111133)
  [x86] combineMul - use computeKnownBits directly to find MUL_IMM constant splat. (REAPPLIED)
  Reland "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout" (llvm#111123)
  Revert "[x86] combineMul - use computeKnownBits directly to find MUL_IMM constant splat."
  update_test_checks: fix a simple regression  (llvm#111347)
  [LegalizeVectorTypes] Always widen fabs (llvm#111298)
  [lsan] Make ReportUnsuspendedThreads return bool also for Fuchsia
  [mlir][vector] Add more tests for ConvertVectorToLLVM (6/n) (llvm#111121)
  [bazel] port 9144fed
  [SystemZ] Remove inlining threshold multiplier. (llvm#106058)
  [LegalizeVectorTypes] When widening don't check for libcalls if promoted (llvm#111297)
  [clang][Driver] Improve multilib custom error reporting (llvm#110804)
  [clang][Driver] Rename "FatalError" key to "Error" in multilib.yaml (llvm#110804)
  [LLVM][Maintainers] Update release managers (llvm#111164)
  [Clang][Driver] Add option to provide path for multilib's YAML config file (llvm#109640)
  [LoopVectorize] Remove redundant code in emitSCEVChecks (llvm#111132)
  [AMDGPU] Only emit SCOPE_SYS global_wb (llvm#110636)
  [ELF] Change Ctx::target to unique_ptr (llvm#111260)
  [ELF] Pass Ctx & to some free functions
  [RISCV] Only disassemble fcvtmod.w.d if the rounding mode is rtz. (llvm#111308)
  [Clang] Remove the special-casing for RequiresExprBodyDecl in BuildResolvedCallExpr() after fd87d76 (llvm#111277)
  [ELF] Pass Ctx & to InputFile
  [clang-format] Add AlignFunctionDeclarations to AlignConsecutiveDeclarations (llvm#108241)
  [AMDGPU] Support preloading hidden kernel arguments (llvm#98861)
  [ELF] Move static nextGroupId isInGroup to LinkerDriver
  [clangd] Add ArgumentLists config option under Completion (llvm#111322)
  [ELF] Pass Ctx & to SyntheticSections
  [ELF] Pass Ctx & to Symbols
  [ELF] Pass Ctx & to Symbols
  [ELF] getRelocTargetVA: pass Ctx and Relocation. NFC
  [clang-tidy] Avoid capturing a local variable in a static lambda in UseRangesCheck (llvm#111282)
  [VPlan] Use pointer to member 0 as VPInterleaveRecipe's pointer arg. (llvm#106431)
  [clangd] Simplify ternary expressions with std::optional::value_or (NFC) (llvm#111309)
  [libc++][format][2/3] Optimizes c-string arguments. (llvm#101805)
  [RISCV] Combine RVBUnary and RVKUnary into classes that are more similar to ALU(W)_r(r/i). NFC (llvm#111279)
  [ELF] Pass Ctx & to InputFiles
  [libc] GPU RPC interface: add return value to `rpc_host_call` (llvm#111288)

Signed-off-by: kyvangka1610 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants