Skip to content

Hardware ASAN deep-recursion.c test is flaky on AArch64 Linux #69221

Closed
@DavidSpickett

Description

@DavidSpickett

As seen in:
https://lab.llvm.org/buildbot/#/builders/184/builds/8047
https://lab.llvm.org/buildbot/#/builders/184/builds/7993

This test case sometimes fails with:

+ env HWASAN_OPTIONS=disable_allocator_tagging=1:random_tags=0:fail_without_syscall_abi=0:stack_history_size=5 not /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/runtimes/runtimes-bins/compiler-rt/test/hwasan/AARCH64/TestCases/Output/deep-recursion.c.tmp
+ FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/compiler-rt/test/hwasan/TestCases/deep-recursion.c --check-prefix=D5
FileCheck error: '<stdin>' is empty.
FileCheck command line:  FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/compiler-rt/test/hwasan/TestCases/deep-recursion.c --check-prefix=D5

This bot runs on a Graviton 3 instance, I reproduced it on an Ampere server by doing the following:

$ ./bin/clang -fsanitize=hwaddress -O1 ../llvm-project/compiler-rt/test/hwasan/TestCases/deep-recursion.c -o /tmp/test.o -mllvm -hwasan-record-stack-history=libcall

Then running this shell script:

num=0
while [ true ]
do
  /tmp/test.o
  retcode=$?
  num=$(($num + 1))
  if [[ $retcode == '0' ]]
  then
    echo "Found bug with retcode $retcode on run $num"
    exit 1
  fi
done

Results:

Found bug with retcode 0 on run 946
Found bug with retcode 0 on run 163
Found bug with retcode 0 on run 11
Found bug with retcode 0 on run 224
Found bug with retcode 0 on run 10
Found bug with retcode 0 on run 469
Found bug with retcode 0 on run 1095

From what I gather, the fault should always be found. These results also prove that it isn't some sort of pipefail issue in the RUN line.

I tried removing -hwasan-record-stack-history=libcall and:

Found bug with retcode 0 on run 47
Found bug with retcode 0 on run 128
Found bug with retcode 0 on run 197

Clearly that's not enough to say if one is failing to find it more frequently, but you get the idea. Something is going on here.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions