<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/108030>108030</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc] hermetic test failures
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          SchrodingerZhu
      </td>
    </tr>
</table>

<pre>
    ```
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) 
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcV11v2zYU_TX0y0UEitTngx-UOC6CZU0Rt8OwF4GiKIsLLRok5Tr99QP1Ybe1N-xhLbAwAkJd8_Cew3tJXTJr5bYTYoniWxSvFqx3rTbLDW-NrmW3FeaPtl9Uun5dogRPD14hXCh12N3sjf5TcIfIuuqlqkF3gO7vUUZQgUHJiiOyPtRW3xDwDkiIiHcDB8kA3ROUJ-iWwoEGFAcEkwjnOL7Z5jxukprc1NK4V3Bav0BmYXQ7oFaoWINSdQWIrF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