llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.07k stars 11.99k forks source link

[libc] hermetic test failures #108030

Closed SchrodingerZhu closed 2 months ago

SchrodingerZhu commented 2 months ago
llvm-project/build on  libc/vdso-2 [!+] via △ v3.30.20240905-g9c5f6d2-dirty took 8s 
❯ lldb /home/schrodingerzy/Documents/llvm-project/build/libc/test/src/__support/OSUtil/linux/x86_64/libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__
(lldb) target create "/home/schrodingerzy/Documents/llvm-project/build/libc/test/src/__support/OSUtil/linux/x86_64/libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__"
Current executable set to '/home/schrodingerzy/Documents/llvm-project/build/libc/test/src/__support/OSUtil/linux/x86_64/libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__' (x86_64).
(lldb) r
Process 2534484 launched: '/home/schrodingerzy/Documents/llvm-project/build/libc/test/src/__support/OSUtil/linux/x86_64/libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__' (x86_64)
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcX86_64_SyscallTest.APITest
[       OK ] LlvmLibcX86_64_SyscallTest.APITest (2 us)
Ran 1 tests.  PASS: 1  FAIL: 0
Process 2534484 stopped
* thread #1, name = 'libc.test.src._', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x7ffff7ff8058)
    frame #0: 0x0000000000218b48 libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`__llvm_libc_20_0_0_git::Mutex::lock(this=0x0000000000000001) at mutex.h:60
   57     }
   58  
   59     // TODO: record owner and lock count.
-> 60     LIBC_INLINE MutexError lock() {
   61       // Since timeout is not specified, we do not need to check the return value.
   62       this->RawMutex::lock(
   63           /* timeout=*/cpp::nullopt, this->pshared);
(lldb) bt
* thread #1, name = 'libc.test.src._', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x7ffff7ff8058)
  * frame #0: 0x0000000000218b48 libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`__llvm_libc_20_0_0_git::Mutex::lock(this=0x0000000000000001) at mutex.h:60
    frame #1: 0x000000000021a88d libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`__llvm_libc_20_0_0_git::call_exit_callbacks(callbacks=0x0000000000231b18) at exit_handler.h:55:22
    frame #2: 0x000000000021a6b3 libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`__cxa_finalize(dso=0x0000000000000000) at atexit.cpp:28:5
    frame #3: 0x000000000021aa74 libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`__llvm_libc_20_0_0_git::exit(status=0) at exit.cpp:19:3
    frame #4: 0x0000000000201ef0 libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`__llvm_libc_20_0_0_git::do_start() at do_start.cpp:151:3
    frame #5: 0x0000000000201893 libc.test.src.__support.OSUtil.linux.x86_64.syscall_test.__hermetic__.__build__`::_start() at start.cpp:32:3
(lldb) 
SchrodingerZhu commented 2 months ago

this is due to stack protector