[compiler-rt] Fix prctl to handle PR_GET_PDEATHSIG. (PR #101749)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 18:16:48 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `compiler-rt` at step 7 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference:
```
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'SanitizerCommon-asan-x86_64-Linux :: Linux/prctl.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /build/buildbot/premerge-monolithic-linux/build/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=address  -m64 -funwind-tables  -I/build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test -ldl /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp -o /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/prctl.cpp.tmp &&  /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/prctl.cpp.tmp /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux
+ /build/buildbot/premerge-monolithic-linux/build/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=address -m64 -funwind-tables -I/build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test -ldl /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp -o /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/prctl.cpp.tmp
+ /build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/prctl.cpp.tmp /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux
=================================================================
==388695==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7d7c14900044 at pc 0x5912ff3bfb05 bp 0x7ffc65a6bbd0 sp 0x7ffc65a6b380
WRITE of size 8 at 0x7d7c14900044 thread T0
    #0 0x5912ff3bfb04 in prctl /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc
    #1 0x5912ff480f47 in main /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp:45:9
    #2 0x7d7c16464d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: a43bfc8428df6623cd498c9c0caeb91aec9be4f9)
    #3 0x7d7c16464e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: a43bfc8428df6623cd498c9c0caeb91aec9be4f9)
    #4 0x5912ff39e344 in _start (/build/buildbot/premerge-monolithic-linux/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/Output/prctl.cpp.tmp+0x2c344)

Address 0x7d7c14900044 is located in stack of thread T0 at offset 68 in frame
    #0 0x5912ff480bff in main /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp:27

  This frame has 5 object(s):
    [32, 40) 'cookie' (line 36)
    [64, 68) 'signum' (line 44) <== Memory access at offset 68 overflows this variable
    [80, 161) 'invname' (line 52)
    [208, 214) 'vlname' (line 52)
    [240, 256) 'name' (line 74)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /build/buildbot/premerge-monolithic-linux/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp:45:9 in main
Shadow bytes around the buggy address:
  0x7d7c148ffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c148ffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c148ffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c148fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c148fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x7d7c14900000: f1 f1 f1 f1 00 f2 f2 f2[04]f2 f8 f8 f8 f8 f8 f8
  0x7d7c14900080: f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f8 f2 f2 f2 f8 f8
  0x7d7c14900100: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c14900180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c14900200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7d7c14900280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
...

```

https://github.com/llvm/llvm-project/pull/101749


More information about the llvm-commits mailing list