Skip to content

Conversation

@cofibrant
Copy link
Contributor

@cofibrant cofibrant commented Nov 11, 2025

At present, the shrink wrapping pass misses opportunities to shrink wrap in the presence of machine basic blocks which exit the function without returning. Such cases arise from C++ functions like the following:

int foo(int err, void* ptr) {
    if (err == -1) {
         if (ptr == nullptr) {
             throw MyException("Received `nullptr`!", __FILE__, __LINE__);
         }
         
         handle(ptr);
    }
    
    return STATUS_OK;
}

In particular, assuming MyException's constructor is not marked noexcept, the above code will generate a trivial EH landing pad calling __cxa_free_exception() and rethrowing the unhandled internal exception, exiting the function without returning. As such, the shrink wrapping pass refuses to touch the above function, spilling to the stack on every call, even though no CSRs are clobbered on the hot path. This patch tweaks the shrink wrapping logic to enable the pass to fire in this and similar cases.

@llvmbot
Copy link
Member

llvmbot commented Nov 11, 2025

@llvm/pr-subscribers-backend-aarch64

Author: Nathan Corbyn (cofibrant)

Changes

At present, the shrink wrapping pass misses opportunities to shrink wrap in the presence of machine basic blocks which exit the function without returning. Such cases arise from C++ functions like the following:

int foo(int err, void* ptr) {
    if (err == -1) {
         if (ptr == nullptr) {
             throw MyException("Received `nullptr`!", __FILE__, __LINE__);
         }
         
         handle(ptr);
    }
    
    return STATUS_OK;
}

In particular, assuming MyException's constructor is not marked noexcept, the above code will generate a trivial EH landing pad calling __cxa_free_exception() and rethrowing the unhandled internal exception, exiting the function without returning. As such, at present, the shrink wrapping refuses to touch the above function, spilling to the stack on every call, even though no CSRs are touched on the hot path. This patch tweaks the shrink wrapping logic to enable the pass to fire in this and similar cases.


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

3 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/MachineBasicBlock.h (+7)
  • (modified) llvm/lib/CodeGen/ShrinkWrap.cpp (+5-7)
  • (added) llvm/test/CodeGen/AArch64/shrinkwrap-no-return.ll (+76)
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
index fcf7bab09fcff..a56cf56c81cd9 100644
--- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
@@ -988,6 +988,13 @@ class MachineBasicBlock
     return !empty() && back().isEHScopeReturn();
   }
 
+  /// Convenience function that returns true if the block exits the function
+  /// without returning.
+  bool isNoReturnBlock() const {
+    return !empty() && succ_empty() && !back().isReturn() &&
+           !back().isIndirectBranch();
+  }
+
   /// Split a basic block into 2 pieces at \p SplitPoint. A new block will be
   /// inserted after this block, and all instructions after \p SplitInst moved
   /// to it (\p SplitInst will be in the original block). If \p LIS is provided,
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp
index 83581052560cb..c2221cacc5bd5 100644
--- a/llvm/lib/CodeGen/ShrinkWrap.cpp
+++ b/llvm/lib/CodeGen/ShrinkWrap.cpp
@@ -697,14 +697,12 @@ void ShrinkWrapImpl::updateSaveRestorePoints(MachineBasicBlock &MBB,
 
   if (!Restore)
     Restore = &MBB;
-  else if (MPDT->getNode(&MBB)) // If the block is not in the post dom tree, it
-                                // means the block never returns. If that's the
-                                // case, we don't want to call
-                                // `findNearestCommonDominator`, which will
-                                // return `Restore`.
+  else if (MBB.isNoReturnBlock()) {
+    // MBB exits the function without returning, so we don't need an epilogue
+    // here. This is common for things like cleanup landing pads etc. In these
+    // cases, we can skip updating `Restore`.
+  } else
     Restore = MPDT->findNearestCommonDominator(Restore, &MBB);
-  else
-    Restore = nullptr; // Abort, we can't find a restore point in this case.
 
   // Make sure we would be able to insert the restore code before the
   // terminator.
diff --git a/llvm/test/CodeGen/AArch64/shrinkwrap-no-return.ll b/llvm/test/CodeGen/AArch64/shrinkwrap-no-return.ll
new file mode 100644
index 0000000000000..55e8b539e0a35
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/shrinkwrap-no-return.ll
@@ -0,0 +1,76 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=aarch64 -o - %s | FileCheck %s
+
+@exception = external hidden constant { ptr, ptr, ptr }
+
+define noundef i32 @early_exit_or_throw(i32 %in) personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: early_exit_or_throw:
+; CHECK:       .Lfunc_begin0:
+; CHECK-NEXT:    .cfi_startproc
+; CHECK-NEXT:    .cfi_personality 156, DW.ref.__gxx_personality_v0
+; CHECK-NEXT:    .cfi_lsda 28, .Lexception0
+; CHECK-NEXT:  // %bb.0: // %entry
+; CHECK-NEXT:    cmp w0, #1
+; CHECK-NEXT:    b.eq .LBB0_2
+; CHECK-NEXT:  // %bb.1: // %exit
+; CHECK-NEXT:    mov w0, wzr
+; CHECK-NEXT:    ret
+; CHECK-NEXT:  .LBB0_2: // %setup
+; CHECK-NEXT:    str x30, [sp, #-32]! // 8-byte Folded Spill
+; CHECK-NEXT:    stp x20, x19, [sp, #16] // 16-byte Folded Spill
+; CHECK-NEXT:    .cfi_def_cfa_offset 32
+; CHECK-NEXT:    .cfi_offset w19, -8
+; CHECK-NEXT:    .cfi_offset w20, -16
+; CHECK-NEXT:    .cfi_offset w30, -32
+; CHECK-NEXT:    mov w0, #32 // =0x20
+; CHECK-NEXT:    bl __cxa_allocate_exception
+; CHECK-NEXT:  .Ltmp0: // EH_LABEL
+; CHECK-NEXT:    bl construct_exception
+; CHECK-NEXT:  .Ltmp1: // EH_LABEL
+; CHECK-NEXT:    ldp x20, x19, [sp, #16] // 16-byte Folded Reload
+; CHECK-NEXT:    ldr x30, [sp], #32 // 8-byte Folded Reload
+; CHECK-NEXT:  // %bb.3: // %throw
+; CHECK-NEXT:    adrp x2, :got:destruct_exception
+; CHECK-NEXT:    adrp x1, exception
+; CHECK-NEXT:    add x1, x1, :lo12:exception
+; CHECK-NEXT:    ldr x2, [x2, :got_lo12:destruct_exception]
+; CHECK-NEXT:    mov x0, x19
+; CHECK-NEXT:    bl __cxa_throw
+; CHECK-NEXT:  .LBB0_4: // %teardown
+; CHECK-NEXT:  .Ltmp2: // EH_LABEL
+; CHECK-NEXT:    mov x20, x0
+; CHECK-NEXT:    mov x0, x19
+; CHECK-NEXT:    bl __cxa_free_exception
+; CHECK-NEXT:    mov x0, x20
+; CHECK-NEXT:    bl _Unwind_Resume
+entry:
+  %cmp = icmp eq i32 %in, 1
+  br i1 %cmp, label %setup, label %exit
+
+setup:
+  %exception = tail call ptr @__cxa_allocate_exception(i64 32) nounwind
+  %call = invoke noundef ptr @construct_exception(ptr noundef nonnull %exception) to label %throw unwind label %teardown
+
+throw:
+  tail call void @__cxa_throw(ptr nonnull %exception, ptr nonnull @exception, ptr nonnull @destruct_exception) noreturn
+  unreachable
+
+teardown:
+  %caught = landingpad { ptr, i32 } cleanup
+  tail call void @__cxa_free_exception(ptr nonnull %exception) nounwind
+  resume { ptr, i32 } %caught
+
+exit:
+  ret i32 0
+}
+
+declare i32 @__gxx_personality_v0(...)
+
+declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr
+declare void @__cxa_free_exception(ptr) local_unnamed_addr
+declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr cold noreturn
+
+declare noundef ptr @construct_exception(ptr noundef nonnull returned) unnamed_addr
+declare noundef ptr @destruct_exception(ptr noundef nonnull returned) unnamed_addr mustprogress nounwind ssp uwtable(sync)
+
+declare void @noreturn() noreturn

@cofibrant
Copy link
Contributor Author

I'm sure that I'm missing some good ideas for test cases, but wasn't sure what to add!

@cofibrant
Copy link
Contributor Author

Ping

Copy link
Contributor

@sushgokh sushgokh left a comment

Choose a reason for hiding this comment

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

I think LGTM

@cofibrant cofibrant merged commit 650eeb8 into llvm:main Nov 27, 2025
10 checks passed
@cofibrant cofibrant deleted the users/cofibrant/shrink-wrap-no-return branch November 27, 2025 10:17
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 27, 2025

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

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

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: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/main.py:74: 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: 89231 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70
FAIL: LLVM :: Object/archive-extract-dir.test (65781 of 89231)
******************** TEST 'LLVM :: Object/archive-extract-dir.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
mkdir -p /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: mkdir -p /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 2
cd /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: cd /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 3
rm -rf foo
# executed command: rm -rf foo
# note: command had no output on stdout or stderr
# RUN: at line 4
echo foo > foo
# executed command: echo foo
# note: command had no output on stdout or stderr
# RUN: at line 5
rm -f test.a
# executed command: rm -f test.a
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/llvm-ar rc          test.a foo
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/llvm-ar rc test.a foo
# note: command had no output on stdout or stderr
# RUN: at line 7
rm foo
# executed command: rm foo
# note: command had no output on stdout or stderr
# RUN: at line 8
mkdir foo
# executed command: mkdir foo
# note: command had no output on stdout or stderr
# RUN: at line 9
Step 14 (stage3/hwasan check) failure: stage3/hwasan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/utils/lit/lit/main.py:74: 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: 89231 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70
FAIL: LLVM :: Object/archive-extract-dir.test (65781 of 89231)
******************** TEST 'LLVM :: Object/archive-extract-dir.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
mkdir -p /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: mkdir -p /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 2
cd /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: cd /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 3
rm -rf foo
# executed command: rm -rf foo
# note: command had no output on stdout or stderr
# RUN: at line 4
echo foo > foo
# executed command: echo foo
# note: command had no output on stdout or stderr
# RUN: at line 5
rm -f test.a
# executed command: rm -f test.a
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/llvm-ar rc          test.a foo
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build2_hwasan/bin/llvm-ar rc test.a foo
# note: command had no output on stdout or stderr
# RUN: at line 7
rm foo
# executed command: rm foo
# note: command had no output on stdout or stderr
# RUN: at line 8
mkdir foo
# executed command: mkdir foo
# note: command had no output on stdout or stderr
# RUN: at line 9

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 27, 2025

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

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

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: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: 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: 90652 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70
FAIL: LLVM :: Object/archive-extract-dir.test (67203 of 90652)
******************** TEST 'LLVM :: Object/archive-extract-dir.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
mkdir -p /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: mkdir -p /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 2
cd /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: cd /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 3
rm -rf foo
# executed command: rm -rf foo
# note: command had no output on stdout or stderr
# RUN: at line 4
echo foo > foo
# executed command: echo foo
# note: command had no output on stdout or stderr
# RUN: at line 5
rm -f test.a
# executed command: rm -f test.a
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/llvm-ar rc          test.a foo
# executed command: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/llvm-ar rc test.a foo
# note: command had no output on stdout or stderr
# RUN: at line 7
rm foo
# executed command: rm foo
# note: command had no output on stdout or stderr
# RUN: at line 8
mkdir foo
# executed command: mkdir foo
# note: command had no output on stdout or stderr
# RUN: at line 9
Step 14 (stage3/msan check) failure: stage3/msan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: 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: 90652 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70
FAIL: LLVM :: Object/archive-extract-dir.test (67203 of 90652)
******************** TEST 'LLVM :: Object/archive-extract-dir.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
mkdir -p /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: mkdir -p /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 2
cd /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# executed command: cd /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/test/Object/Output/archive-extract-dir.test.tmp
# note: command had no output on stdout or stderr
# RUN: at line 3
rm -rf foo
# executed command: rm -rf foo
# note: command had no output on stdout or stderr
# RUN: at line 4
echo foo > foo
# executed command: echo foo
# note: command had no output on stdout or stderr
# RUN: at line 5
rm -f test.a
# executed command: rm -f test.a
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/llvm-ar rc          test.a foo
# executed command: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/llvm-ar rc test.a foo
# note: command had no output on stdout or stderr
# RUN: at line 7
rm foo
# executed command: rm foo
# note: command had no output on stdout or stderr
# RUN: at line 8
mkdir foo
# executed command: mkdir foo
# note: command had no output on stdout or stderr
# RUN: at line 9

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 27, 2025

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

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

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)
...
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-uar-realign.c (598 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-overflow.c (599 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-underflow.c (600 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/strip_path_prefix.c (601 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/tag-mismatch-border-address.c (602 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/register-dump-read.c (603 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/register-dump-no-fp.cpp (604 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-uar.c (605 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/test_shadow.c (606 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/halt-on-error.cpp (607 of 1778)
FAIL: HWAddressSanitizer-aarch64 :: TestCases/sizes.cpp (608 of 1778)
******************** TEST 'HWAddressSanitizer-aarch64 :: TestCases/sizes.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
==8520==WARNING: HWAddressSanitizer failed to allocate 0x10000000001 bytes
==9269==WARNING: HWAddressSanitizer failed to allocate 0xffffffffffffffff bytes

--
Command Output (stderr):
--
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++  --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp ||   /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++  --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp # RUN: at line 3
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc 2>&1          | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max # RUN: at line 4
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc 2>&1 # RUN: at line 5
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max 2>&1      | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max # RUN: at line 6
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max 2>&1 # RUN: at line 7
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc 2>&1          | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-calloc # RUN: at line 8
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-calloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc 2>&1 # RUN: at line 9
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp reallocarray 2>&1    | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-reallocarray # RUN: at line 10
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp reallocarray
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-reallocarray

--

********************
PASS: HWAddressSanitizer-aarch64 :: TestCases/thread-uaf.c (609 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/use-after-free-and-overflow.c (610 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/tag-ptr.cpp (611 of 1778)
Step 21 (run lit tests [aarch64/aosp_coral-userdebug/AOSP.MASTER]) failure: run lit tests [aarch64/aosp_coral-userdebug/AOSP.MASTER] (failure)
...
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-uar-realign.c (598 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-overflow.c (599 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-underflow.c (600 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/strip_path_prefix.c (601 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/tag-mismatch-border-address.c (602 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/register-dump-read.c (603 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/register-dump-no-fp.cpp (604 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/stack-uar.c (605 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/test_shadow.c (606 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/halt-on-error.cpp (607 of 1778)
FAIL: HWAddressSanitizer-aarch64 :: TestCases/sizes.cpp (608 of 1778)
******************** TEST 'HWAddressSanitizer-aarch64 :: TestCases/sizes.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
==8520==WARNING: HWAddressSanitizer failed to allocate 0x10000000001 bytes
==9269==WARNING: HWAddressSanitizer failed to allocate 0xffffffffffffffff bytes

--
Command Output (stderr):
--
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++  --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp ||   /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++  --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp # RUN: at line 3
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc 2>&1          | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max # RUN: at line 4
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc 2>&1 # RUN: at line 5
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max 2>&1      | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max # RUN: at line 6
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max 2>&1 # RUN: at line 7
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc 2>&1          | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-calloc # RUN: at line 8
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-calloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc 2>&1 # RUN: at line 9
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp reallocarray 2>&1    | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-reallocarray # RUN: at line 10
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp reallocarray
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-reallocarray

--

********************
PASS: HWAddressSanitizer-aarch64 :: TestCases/thread-uaf.c (609 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/use-after-free-and-overflow.c (610 of 1778)
PASS: HWAddressSanitizer-aarch64 :: TestCases/tag-ptr.cpp (611 of 1778)
Step 31 (run lit tests [aarch64/bluejay-userdebug/TQ3A.230805.001]) failure: run lit tests [aarch64/bluejay-userdebug/TQ3A.230805.001] (failure)
@@@BUILD_STEP run lit tests [aarch64/bluejay-userdebug/TQ3A.230805.001]@@@
[0/1] Running compiler_rt regression tests
llvm-lit: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/utils/lit/lit/main.py:74: 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: 1778 tests, 12 workers --
FAIL: HWAddressSanitizer-aarch64 :: TestCases/sizes.cpp (1 of 1778)
******************** TEST 'HWAddressSanitizer-aarch64 :: TestCases/sizes.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
==21594==WARNING: HWAddressSanitizer failed to allocate 0x10000000001 bytes
==21678==WARNING: HWAddressSanitizer failed to allocate 0xffffffffffffffff bytes

--
Command Output (stderr):
--
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++  --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp ||   /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++  --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp # RUN: at line 3
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc 2>&1          | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max # RUN: at line 4
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc 2>&1 # RUN: at line 5
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max 2>&1      | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max # RUN: at line 6
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max 2>&1 # RUN: at line 7
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp malloc max
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc 2>&1          | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-calloc # RUN: at line 8
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-calloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc 2>&1 # RUN: at line 9
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=1 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp calloc
env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp reallocarray 2>&1    | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-reallocarray # RUN: at line 10
+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:abort_on_error=0:allocator_may_return_null=0 not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/hwasan/AARCH64/TestCases/Output/sizes.cpp.tmp reallocarray
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp --check-prefix=CHECK-reallocarray

--

********************
PASS: cfi-standalone-aarch64 :: simple-fail.cpp (2 of 1778)
PASS: cfi-devirt-lld-thinlto-aarch64 :: simple-fail.cpp (3 of 1778)
PASS: cfi-standalone-lld-aarch64 :: simple-fail.cpp (4 of 1778)
PASS: cfi-devirt-thinlto-aarch64 :: simple-fail.cpp (5 of 1778)
PASS: cfi-devirt-lld-aarch64 :: simple-fail.cpp (6 of 1778)
PASS: cfi-devirt-aarch64 :: bad-cast.cpp (7 of 1778)
PASS: cfi-standalone-aarch64 :: bad-cast.cpp (8 of 1778)
PASS: cfi-devirt-lld-aarch64 :: bad-cast.cpp (9 of 1778)
PASS: cfi-standalone-lld-aarch64 :: bad-cast.cpp (10 of 1778)
PASS: cfi-devirt-lld-thinlto-aarch64 :: bad-cast.cpp (11 of 1778)

@asb
Copy link
Contributor

asb commented Nov 27, 2025

Heads up that this commit is causing failures on the various bootstrapping RISC-V builders (e.g. https://lab.llvm.org/buildbot/#/builders/87/builds/4328). We get test failures with various llvm-ar related tests. Here's an example direct llvm-ar invocation:

./build/stage2/bin/llvm-ar p bar
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: ./build/stage2/bin/llvm-ar p bar
#0 0x0000555557e9865a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./build/stage2/bin/llvm-ar+0x294265a)
#1 0x0000555557e96782 llvm::sys::RunSignalHandlers() (./build/stage2/bin/llvm-ar+0x2940782)
#2 0x0000555557e99160 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x0000799d904796cc (linux-vdso.so.1+0x799d904796cc)
#4 0x000055555782973a failIfError(std::error_code, llvm::Twine) llvm-ar.cpp:0:0
#5 0x0000555557829736 failIfError(std::error_code, llvm::Twine) llvm-ar.cpp:0:0

i.e. this appears to be a miscompile within LLVM itself. Sadly there are no failures in llvm-test-suite that would make this easier to narrow down. I have confirmed that we get this failure with a two-stage bootstrap build including this patch and note with its parent.

In line with our patch reversion policy I intend to revert this so that the issue can be properly narrowed down and addressed (and then hopefully the patch can reland). I will work to get something more actionable in terms of a minimised test case.

asb added a commit that referenced this pull request Nov 27, 2025
…terminated by no-return blocks" (#169852)

Reverts #167548

As commented at
#167548 (comment)
this is causing miscompiles in two-stage RISC-V Clang/LLVM builds that
result in test failures on the builders.
@cofibrant
Copy link
Contributor Author

cofibrant commented Nov 27, 2025

Thanks Alex--this is very good to know. (I'm quite surprised this triggers in LLVM as we don't have exceptions enabled!)

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Nov 27, 2025
… functions terminated by no-return blocks" (#169852)

Reverts llvm/llvm-project#167548

As commented at
llvm/llvm-project#167548 (comment)
this is causing miscompiles in two-stage RISC-V Clang/LLVM builds that
result in test failures on the builders.
@asb
Copy link
Contributor

asb commented Nov 27, 2025

I'll get a proper .ll reproducer tomorrow, but here's the .s diff for llvm-ar that is causing the issue:

--- ./tools/llvm-ar/CMakeFiles/llvm-ar.dir/llvm-ar.s    2025-11-27 19:02:12.188502784 +0000
+++ ../stage2.bad/./tools/llvm-ar/CMakeFiles/llvm-ar.dir/llvm-ar.s      2025-11-27 19:36:01.525297430 +00
00
@@ -6379,25 +6379,17 @@
 _ZL11failIfErrorSt10error_codeN4llvm5TwineE: # @_ZL11failIfErrorSt10error_codeN4llvm5TwineE
        .cfi_startproc
 # %bb.0:                                # %entry
+       sext.w  a0, a0
+       bnez    a0, .LBB24_2
+# %bb.1:                                # %if.then
+       ret
+.LBB24_2:                               # %if.end
        addi    sp, sp, -304
        .cfi_def_cfa_offset 304
        sd      ra, 296(sp)                     # 8-byte Folded Spill
        sd      s0, 288(sp)                     # 8-byte Folded Spill
        .cfi_offset ra, -8
        .cfi_offset s0, -16
-       .cfi_remember_state
-       sext.w  a0, a0
-       bnez    a0, .LBB24_2
-# %bb.1:                                # %if.then
-       ld      ra, 296(sp)                     # 8-byte Folded Reload
-       ld      s0, 288(sp)                     # 8-byte Folded Reload
-       .cfi_restore ra
-       .cfi_restore s0
-       addi    sp, sp, 304
-       .cfi_def_cfa_offset 0
-       ret
-.LBB24_2:                               # %if.end
-       .cfi_restore_state
        sd      a1, 8(sp)                       # 8-byte Folded Spill
        sd      a0, 16(sp)                      # 8-byte Folded Spill
        addi    a0, sp, 256
@@ -6405,6 +6397,12 @@
        mv      a1, a2
        call    _ZNK4llvm5Twine3strB5cxx11Ev
        ld      a0, 264(sp)
+       ld      ra, 296(sp)                     # 8-byte Folded Reload
+       ld      s0, 288(sp)                     # 8-byte Folded Reload
+       .cfi_restore ra
+       .cfi_restore s0
+       addi    sp, sp, 304
+       .cfi_def_cfa_offset 0
        bnez    a0, .LBB24_4
 # %bb.3:                                # %if.then2
        ld      a1, 8(sp)                       # 8-byte Folded Reload

At the end of LBB24_2 in the 'bad' version, the stack is deallocated but then it's accessed in the fallthrough to # %bb.3:

@asb
Copy link
Contributor

asb commented Nov 29, 2025

Here's a minimised test case:

; ModuleID = 'reduced.ll'
source_filename = "reduced.ll"
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-gnu"

declare void @widget()

declare i64 @baz()

define void @snork(ptr %arg, i1 %arg1) {
bb:
  br i1 %arg1, label %bb3, label %bb2

bb2:                                              ; preds = %bb
  ret void

bb3:                                              ; preds = %bb
  %call = call i64 @baz()
  %icmp = icmp eq i64 %call, 0
  br i1 %icmp, label %bb4, label %bb5

bb4:                                              ; preds = %bb3
  store volatile ptr %arg, ptr null, align 8
  call void @widget()
  unreachable

bb5:                                              ; preds = %bb3
  call void @widget()
  unreachable
}

@cofibrant
Copy link
Contributor Author

Thanks so much--I'll look at this as a priority on Monday

aahrun pushed a commit to aahrun/llvm-project that referenced this pull request Dec 1, 2025
…terminated by no-return blocks" (llvm#169852)

Reverts llvm#167548

As commented at
llvm#167548 (comment)
this is causing miscompiles in two-stage RISC-V Clang/LLVM builds that
result in test failures on the builders.
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this pull request Dec 3, 2025
…ed by no-return blocks (llvm#167548)

At present, the shrink wrapping pass misses opportunities to shrink wrap
in the presence of machine basic blocks which exit the function without
returning. Such cases arise from C++ functions like the following:
```cxx
int foo(int err, void* ptr) {
    if (err == -1) {
         if (ptr == nullptr) {
             throw MyException("Received `nullptr`!", __FILE__, __LINE__);
         }
         
         handle(ptr);
    }
    
    return STATUS_OK;
}
```
In particular, assuming `MyException`'s constructor is not marked
`noexcept`, the above code will generate a trivial EH landing pad
calling `__cxa_free_exception()` and rethrowing the unhandled internal
exception, exiting the function without returning. As such, the shrink
wrapping pass refuses to touch the above function, spilling to the stack
on every call, even though no CSRs are clobbered on the hot path. This
patch tweaks the shrink wrapping logic to enable the pass to fire in
this and similar cases.
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this pull request Dec 3, 2025
…terminated by no-return blocks" (llvm#169852)

Reverts llvm#167548

As commented at
llvm#167548 (comment)
this is causing miscompiles in two-stage RISC-V Clang/LLVM builds that
result in test failures on the builders.
kcloudy0717 pushed a commit to kcloudy0717/llvm-project that referenced this pull request Dec 4, 2025
…ed by no-return blocks (llvm#167548)

At present, the shrink wrapping pass misses opportunities to shrink wrap
in the presence of machine basic blocks which exit the function without
returning. Such cases arise from C++ functions like the following:
```cxx
int foo(int err, void* ptr) {
    if (err == -1) {
         if (ptr == nullptr) {
             throw MyException("Received `nullptr`!", __FILE__, __LINE__);
         }
         
         handle(ptr);
    }
    
    return STATUS_OK;
}
```
In particular, assuming `MyException`'s constructor is not marked
`noexcept`, the above code will generate a trivial EH landing pad
calling `__cxa_free_exception()` and rethrowing the unhandled internal
exception, exiting the function without returning. As such, the shrink
wrapping pass refuses to touch the above function, spilling to the stack
on every call, even though no CSRs are clobbered on the hot path. This
patch tweaks the shrink wrapping logic to enable the pass to fire in
this and similar cases.
kcloudy0717 pushed a commit to kcloudy0717/llvm-project that referenced this pull request Dec 4, 2025
…terminated by no-return blocks" (llvm#169852)

Reverts llvm#167548

As commented at
llvm#167548 (comment)
this is causing miscompiles in two-stage RISC-V Clang/LLVM builds that
result in test failures on the builders.
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