[libc-commits] [libc] [libc] Implement basename and dirname in libgen.h (PR #204554)
LLVM Continuous Integration via libc-commits
libc-commits at lists.llvm.org
Fri Jun 19 08:57:01 PDT 2026
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `libc-x86_64-debian-fullbuild-dbg-asan` running on `libc-x86_64-debian-fullbuild` while building `libc` at step 4 "annotate".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/171/builds/48867
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[2176/6370] Linking CXX executable libc/test/src/fenv/libc.test.src.fenv.feclearexcept_test.__build__
[2177/6370] Building CXX object libc/test/src/__support/wctype/CMakeFiles/libc.test.src.__support.wctype.wctype_perfect_hash_test.__unit__.__build__.dir/wctype_perfect_hash_test.cpp.o
[2178/6370] Building CXX object libc/test/src/math/CMakeFiles/libc.test.src.math.copysignf_test.__unit__.__NO_MISC_MATH_BASIC_OPS_OPT.__build__.dir/copysignf_test.cpp.o
[2179/6370] Running unit test libc.test.src.fenv.feclearexcept_test
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcFEnvTest.ClearTest
[ OK ] LlvmLibcFEnvTest.ClearTest (2 ms)
Ran 1 tests. PASS: 1 FAIL: 0
[2180/6370] Building CXX object libc/test/src/math/CMakeFiles/libc.test.src.math.copysignf_test.__unit__.__NO_FMA_OPT.__NO_MISC_MATH_BASIC_OPS_OPT.__build__.dir/copysignf_test.cpp.o
[2181/6370] Running unit test libc.test.src.libgen.dirname_death_test.__unit__
FAILED: libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.dirname_death_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.dirname_death_test.__unit__
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/libc.test.src.libgen.dirname_death_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcDirnameTest.ModifyReturnValue
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3329828==ERROR: AddressSanitizer: SEGV on unknown address 0x5562b94c5ae0 (pc 0x5562b9465d3e bp 0x7fff9a03b870 sp 0x7fff9a03b850 T0)
==3329828==The signal is caused by a WRITE memory access.
#0 0x5562b9465d3e in LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0::operator()() const /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20:3
#1 0x5562b9465cc8 in __llvm_libc_20_0_0_git::testutils::FunctionCaller* __llvm_libc_20_0_0_git::testing::Test::createCallable<LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0>(LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0)::Callable::operator()() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:219:36
#2 0x5562b946d86d in __llvm_libc_20_0_0_git::testutils::invoke_in_subprocess(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/ExecuteFunctionUnix.cpp:54:5
#3 0x5562b946bf81 in __llvm_libc_20_0_0_git::testing::Test::testProcessKilled(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcDeathTestExecutors.cpp:29:7
#4 0x5562b9465833 in LlvmLibcDirnameTest_ModifyReturnValue::Run() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20:3
#5 0x5562b946f4b7 in __llvm_libc_20_0_0_git::testing::Test::runTests(__llvm_libc_20_0_0_git::testing::TestOptions const&) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.cpp:165:8
#6 0x5562b94adbe8 in main /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTestMain.cpp:59:10
#7 0x7f5409365249 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20:3 in LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0::operator()() const
==3329828==ABORTING
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20: FAILURE
Expected [r]() { r[0] = 'a'; } to be killed by a signal
But it exited normally!
[ FAILED ] LlvmLibcDirnameTest.ModifyReturnValue
Ran 1 tests. PASS: 0 FAIL: 1
[2182/6370] Running unit test libc.test.src.libgen.basename_death_test.__unit__
FAILED: libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.basename_death_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.basename_death_test.__unit__
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/libc.test.src.libgen.basename_death_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcBasenameTest.ModifyReturnValue
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3329817==ERROR: AddressSanitizer: SEGV on unknown address 0x563f07085ae0 (pc 0x563f07025d3e bp 0x7ffe35af0f90 sp 0x7ffe35af0f70 T0)
==3329817==The signal is caused by a WRITE memory access.
#0 0x563f07025d3e in LlvmLibcBasenameTest_ModifyReturnValue::Run()::$_0::operator()() const /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/basename_death_test.cpp:20:3
#1 0x563f07025cc8 in __llvm_libc_20_0_0_git::testutils::FunctionCaller* __llvm_libc_20_0_0_git::testing::Test::createCallable<LlvmLibcBasenameTest_ModifyReturnValue::Run()::$_0>(LlvmLibcBasenameTest_ModifyReturnValue::Run()::$_0)::Callable::operator()() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:219:36
#2 0x563f0702d73d in __llvm_libc_20_0_0_git::testutils::invoke_in_subprocess(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/ExecuteFunctionUnix.cpp:54:5
#3 0x563f0702be51 in __llvm_libc_20_0_0_git::testing::Test::testProcessKilled(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcDeathTestExecutors.cpp:29:7
#4 0x563f07025833 in LlvmLibcBasenameTest_ModifyReturnValue::Run() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/basename_death_test.cpp:20:3
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[2176/6370] Linking CXX executable libc/test/src/fenv/libc.test.src.fenv.feclearexcept_test.__build__
[2177/6370] Building CXX object libc/test/src/__support/wctype/CMakeFiles/libc.test.src.__support.wctype.wctype_perfect_hash_test.__unit__.__build__.dir/wctype_perfect_hash_test.cpp.o
[2178/6370] Building CXX object libc/test/src/math/CMakeFiles/libc.test.src.math.copysignf_test.__unit__.__NO_MISC_MATH_BASIC_OPS_OPT.__build__.dir/copysignf_test.cpp.o
[2179/6370] Running unit test libc.test.src.fenv.feclearexcept_test
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcFEnvTest.ClearTest
[ OK ] LlvmLibcFEnvTest.ClearTest (2 ms)
Ran 1 tests. PASS: 1 FAIL: 0
[2180/6370] Building CXX object libc/test/src/math/CMakeFiles/libc.test.src.math.copysignf_test.__unit__.__NO_FMA_OPT.__NO_MISC_MATH_BASIC_OPS_OPT.__build__.dir/copysignf_test.cpp.o
[2181/6370] Running unit test libc.test.src.libgen.dirname_death_test.__unit__
FAILED: libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.dirname_death_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.dirname_death_test.__unit__
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/libc.test.src.libgen.dirname_death_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcDirnameTest.ModifyReturnValue
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3329828==ERROR: AddressSanitizer: SEGV on unknown address 0x5562b94c5ae0 (pc 0x5562b9465d3e bp 0x7fff9a03b870 sp 0x7fff9a03b850 T0)
==3329828==The signal is caused by a WRITE memory access.
#0 0x5562b9465d3e in LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0::operator()() const /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20:3
#1 0x5562b9465cc8 in __llvm_libc_20_0_0_git::testutils::FunctionCaller* __llvm_libc_20_0_0_git::testing::Test::createCallable<LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0>(LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0)::Callable::operator()() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:219:36
#2 0x5562b946d86d in __llvm_libc_20_0_0_git::testutils::invoke_in_subprocess(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/ExecuteFunctionUnix.cpp:54:5
#3 0x5562b946bf81 in __llvm_libc_20_0_0_git::testing::Test::testProcessKilled(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcDeathTestExecutors.cpp:29:7
#4 0x5562b9465833 in LlvmLibcDirnameTest_ModifyReturnValue::Run() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20:3
#5 0x5562b946f4b7 in __llvm_libc_20_0_0_git::testing::Test::runTests(__llvm_libc_20_0_0_git::testing::TestOptions const&) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.cpp:165:8
#6 0x5562b94adbe8 in main /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTestMain.cpp:59:10
#7 0x7f5409365249 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20:3 in LlvmLibcDirnameTest_ModifyReturnValue::Run()::$_0::operator()() const
==3329828==ABORTING
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/dirname_death_test.cpp:20: FAILURE
Expected [r]() { r[0] = 'a'; } to be killed by a signal
But it exited normally!
[ FAILED ] LlvmLibcDirnameTest.ModifyReturnValue
Ran 1 tests. PASS: 0 FAIL: 1
[2182/6370] Running unit test libc.test.src.libgen.basename_death_test.__unit__
FAILED: libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.basename_death_test.__unit__ /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/CMakeFiles/libc.test.src.libgen.basename_death_test.__unit__
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/libc/test/src/libgen/libc.test.src.libgen.basename_death_test.__unit__.__build__
[==========] Running 1 test from 1 test suite.
[ RUN ] LlvmLibcBasenameTest.ModifyReturnValue
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3329817==ERROR: AddressSanitizer: SEGV on unknown address 0x563f07085ae0 (pc 0x563f07025d3e bp 0x7ffe35af0f90 sp 0x7ffe35af0f70 T0)
==3329817==The signal is caused by a WRITE memory access.
#0 0x563f07025d3e in LlvmLibcBasenameTest_ModifyReturnValue::Run()::$_0::operator()() const /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/basename_death_test.cpp:20:3
#1 0x563f07025cc8 in __llvm_libc_20_0_0_git::testutils::FunctionCaller* __llvm_libc_20_0_0_git::testing::Test::createCallable<LlvmLibcBasenameTest_ModifyReturnValue::Run()::$_0>(LlvmLibcBasenameTest_ModifyReturnValue::Run()::$_0)::Callable::operator()() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcTest.h:219:36
#2 0x563f0702d73d in __llvm_libc_20_0_0_git::testutils::invoke_in_subprocess(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/ExecuteFunctionUnix.cpp:54:5
#3 0x563f0702be51 in __llvm_libc_20_0_0_git::testing::Test::testProcessKilled(__llvm_libc_20_0_0_git::testutils::FunctionCaller*, int, char const*, char const*, __llvm_libc_20_0_0_git::testing::internal::Location) /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/UnitTest/LibcDeathTestExecutors.cpp:29:7
#4 0x563f07025833 in LlvmLibcBasenameTest_ModifyReturnValue::Run() /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/libgen/basename_death_test.cpp:20:3
```
</details>
https://github.com/llvm/llvm-project/pull/204554
More information about the libc-commits
mailing list