Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Floating Point Atomic #67799

Merged
merged 36 commits into from
Nov 22, 2023
Merged

[libc++] Floating Point Atomic #67799

merged 36 commits into from
Nov 22, 2023

Conversation

huixie90
Copy link
Contributor

  • implement P0020R6 Floating Point Atomic

Differential Revision: https://reviews.llvm.org/D153981

@github-actions
Copy link

github-actions bot commented Oct 11, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@github-actions
Copy link

github-actions bot commented Oct 16, 2023

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once CI is passing and the temporary tests have been cleaned up. Thanks a lot for all the digging you had to do to make this work, it's really non-trivial! It would be great to get some attention on #47978, maybe we should ping the clang or compiler-rt folks there.

@huixie90 huixie90 marked this pull request as ready for review October 20, 2023 17:36
@huixie90 huixie90 requested a review from a team as a code owner October 20, 2023 17:36
@huixie90 huixie90 changed the title [libc++][In progress] Floating Point Atomic [libc++] Floating Point Atomic Oct 22, 2023
Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ship this.

There are a few things that don't work especially with long double. However, this patch doesn't make the situation any worse than it already is, since people can already witness the broken behavior with e.g. atomic<long double>::load() today. I think this patch is in a really good shape and the fixes on top are going to be Clang or compiler-rt fixes.

@huixie90 huixie90 merged commit de7fbfe into llvm:main Nov 22, 2023
37 of 39 checks passed
@vitalybuka
Copy link
Collaborator

// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: target={{.+}}-windows-gnu
// Clang's support for atomic operations on long double is broken. See https://github.com/llvm/llvm-project/issues/72893
// XFAIL: tsan, msan
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like they hang, so XFAIL needs to be UNSUPPORTED

@gulfemsavrun
Copy link
Contributor

We started seeing tests failures after this patch:

FAIL: llvm-libc++-static.cfg.in :: libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp (7236 of 15729)
******************** TEST 'llvm-libc++-static.cfg.in :: libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
/b/s/w/ir/x/w/llvm_build/./bin/clang++ /b/s/w/ir/x/w/llvm-llvm-project/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -pthread --target=x86_64-unknown-linux-gnu -nostdinc++ -I /b/s/w/ir/x/w/llvm_build/include/c++/v1 -I /b/s/w/ir/x/w/llvm_build/include/x86_64-unknown-linux-gnu/c++/v1 -I /b/s/w/ir/x/w/llvm-llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings  -lc++experimental -nostdlib++ -L /b/s/w/ir/x/w/llvm_build/./lib/x86_64-unknown-linux-gnu -lc++ -lc++abi -o /b/s/w/ir/x/w/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/atomics/atomics.types.generic/atomics.types.float/Output/lockfree.pass.cpp.dir/t.tmp.exe
# executed command: /b/s/w/ir/x/w/llvm_build/./bin/clang++ /b/s/w/ir/x/w/llvm-llvm-project/libcxx/test/libcxx/atomics/atomics.types.generic/atomics.types.float/lockfree.pass.cpp -pthread --target=x86_64-unknown-linux-gnu -nostdinc++ -I /b/s/w/ir/x/w/llvm_build/include/c++/v1 -I /b/s/w/ir/x/w/llvm_build/include/x86_64-unknown-linux-gnu/c++/v1 -I /b/s/w/ir/x/w/llvm-llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -lc++experimental -nostdlib++ -L /b/s/w/ir/x/w/llvm_build/./lib/x86_64-unknown-linux-gnu -lc++ -lc++abi -o /b/s/w/ir/x/w/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/atomics/atomics.types.generic/atomics.types.float/Output/lockfree.pass.cpp.dir/t.tmp.exe
# .---command stderr------------
# | ld.lld: error: undefined symbol: __atomic_is_lock_free
# | >>> referenced by lockfree.pass.cpp
# | >>>               /b/s/w/ir/x/w/llvm_build/clang-crashreports/lockfree-afbabf.o:(void test<long double>())
# | >>> referenced by lockfree.pass.cpp
# | >>>               /b/s/w/ir/x/w/llvm_build/clang-crashreports/lockfree-afbabf.o:(void test<long double>())
# | >>> referenced by lockfree.pass.cpp
# | >>>               /b/s/w/ir/x/w/llvm_build/clang-crashreports/lockfree-afbabf.o:(std::__2::__atomic_base<long double, false>::is_lock_free[abi:ne180000]() const volatile)
# | clang++: error: linker command failed with exit code 1 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 1

--

https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8763728761573399857/overview

@ldionne
Copy link
Member

ldionne commented Nov 22, 2023

We started seeing tests failures after this patch:

[...]

This is likely because our tests didn't reference that function before (our tests for atomics were very very naive). But that function should be provided by compiler-rt. Can you dig into it a bit more? This isn't something wrong with this patch per se, it's probably something wrong with the testing configuration on Fuchsia (which might be attributable to libc++'s config or not).

@vitalybuka
Copy link
Collaborator

@huixie90 it's landed breaking msan tsan even presubmit failed them "37 of 40 checks passed"

@ldionne
Copy link
Member

ldionne commented Nov 22, 2023

This patch breaks https://lab.llvm.org/buildbot/#/builders/74/builds/23708/steps/11/logs/stdio

Let's take this discussion to #73152.

@ldionne
Copy link
Member

ldionne commented Nov 22, 2023

@huixie90 it's landed breaking msan tsan even presubmit failed them "37 of 40 checks passed"

Hmm, I just looked and the msan timeouts are unrelated to this patch (we're having some trouble right now):

********************
Timed Out Tests (2):
  llvm-libc++-shared.cfg.in :: std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
  llvm-libc++-shared.cfg.in :: std/numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.negbin/eval.pass.cpp

The tsan failures are more mysterious, but it looks like maybe the job as a whole timed out (which could be due to this patch or not): https://github.com/llvm/llvm-project/actions/runs/6933781778/job/18867566743?pr=67799

So I'm not certain @huixie90 bypassed any checks he should not have bypassed due to ongoing flakes as part of merging this. I'm not claiming this means those tests aren't broken on tsan/msan, I'm just saying the information we have with the checks on this patch doesn't allow claiming that.

@vitalybuka
Copy link
Collaborator

@huixie90 it's landed breaking msan tsan even presubmit failed them "37 of 40 checks passed"

Never mind, libcxx actions failed different tests, I have no idea if they are related.

@huixie90
Copy link
Contributor Author

Hi, I am a bit confused now. I looked at the UI under this tab and it was all green. (That was how I check if anything failed before). But It does seem that the UI changed a bit

@huixie90
Copy link
Contributor Author

Screenshot 2023-11-22 at 19 10 39

like this is where I checked. and things seem to be changed between my last push and previous push

ldionne pushed a commit that referenced this pull request Nov 22, 2023
This adds a few UNSUPPORTED annotations for tests that hang on some
msan bots:

https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux-bootstrap-msan
https://lab.llvm.org/buildbot/#/builders/sanitizer-aarch64-linux-bootstrap-msan

We still haven't figured out the root cause of them hanging on these 
bots but not on the main libc++ CI infra.
@huixie90
Copy link
Contributor Author

Screenshot 2023-11-22 at 19 10 39

like this is where I checked. and things seem to be changed between my last push and previous push

@ldionne our CI used to be under this "show all checks" button but now it is gone

@vitalybuka
Copy link
Collaborator

I am not sure if these run before or after the merge
image

@petrhosek
Copy link
Member

We started seeing tests failures after this patch:
[...]

This is likely because our tests didn't reference that function before (our tests for atomics were very very naive). But that function should be provided by compiler-rt. Can you dig into it a bit more? This isn't something wrong with this patch per se, it's probably something wrong with the testing configuration on Fuchsia (which might be attributable to libc++'s config or not).

To be clear, this is a Fuchsia Clang toolchain, but the test is actually failing on Linux so it's not Fuchsia-specific. What's somewhat unusual for our toolchain is that we ship libclang_rt.atomic.so (that's part of compiler-rt) and there is no libatomic.so (that's part of GCC) available on our bots (because we want our toolchain to be fully hermetic). We already encountered an issue in compiler-rt tests which were linking libatomic.so unconditionally and we had to address that in https://reviews.llvm.org/D151680.

I see neither libatomic.so nor libclang_rt.atomic.so in the failing link command. Do you know how are those references satisfied in other toolchains?

@huixie90
Copy link
Contributor Author

We started seeing tests failures after this patch:
[...]

This is likely because our tests didn't reference that function before (our tests for atomics were very very naive). But that function should be provided by compiler-rt. Can you dig into it a bit more? This isn't something wrong with this patch per se, it's probably something wrong with the testing configuration on Fuchsia (which might be attributable to libc++'s config or not).

To be clear, this is a Fuchsia Clang toolchain, but the test is actually failing on Linux so it's not Fuchsia-specific. What's somewhat unusual for our toolchain is that we ship libclang_rt.atomic.so (that's part of compiler-rt) and there is no libatomic.so (that's part of GCC) available on our bots (because we want our toolchain to be fully hermetic). We already encountered an issue in compiler-rt tests which were linking libatomic.so unconditionally and we had to address that in https://reviews.llvm.org/D151680.

I see neither libatomic.so nor libclang_rt.atomic.so in the failing link command. Do you know how are those references satisfied in other toolchains?

Hello, the test is conditionally adding -latomic if compiling a dummy programme with -latomic return 0. In Libc++ CI, on Linux -latomic would be valid so it would add -latomic in the test. On Mac, -latomic would make the dummy program fail to compile/link , so it would not add the flag. But the test link fine without the flag.

I guess in Fushia, the -latomic dummy program test returned false , so it did not add the flag. What is the right way to link under fushia ?

@petrhosek
Copy link
Member

We started seeing tests failures after this patch:
[...]

This is likely because our tests didn't reference that function before (our tests for atomics were very very naive). But that function should be provided by compiler-rt. Can you dig into it a bit more? This isn't something wrong with this patch per se, it's probably something wrong with the testing configuration on Fuchsia (which might be attributable to libc++'s config or not).

To be clear, this is a Fuchsia Clang toolchain, but the test is actually failing on Linux so it's not Fuchsia-specific. What's somewhat unusual for our toolchain is that we ship libclang_rt.atomic.so (that's part of compiler-rt) and there is no libatomic.so (that's part of GCC) available on our bots (because we want our toolchain to be fully hermetic). We already encountered an issue in compiler-rt tests which were linking libatomic.so unconditionally and we had to address that in https://reviews.llvm.org/D151680.
I see neither libatomic.so nor libclang_rt.atomic.so in the failing link command. Do you know how are those references satisfied in other toolchains?

Hello, the test is conditionally adding -latomic if compiling a dummy programme with -latomic return 0. In Libc++ CI, on Linux -latomic would be valid so it would add -latomic in the test. On Mac, -latomic would make the dummy program fail to compile/link , so it would not add the flag. But the test link fine without the flag.

I guess in Fushia, the -latomic dummy program test returned false , so it did not add the flag. What is the right way to link under fushia ?

To emphasize again, we're seeing this issue on Linux and not on Fuchsia.

The existing has-latomic feature test is insufficient:

Feature(
name="has-latomic",
when=lambda cfg: sourceBuilds(
cfg,
"""
int main(int, char**) { return 0; }
""",
["-latomic"],
),
),

libatomic.so is part of GCC and this test will only succeed when you have GCC installed on your machine. We don't have GCC installed on our bots, we use Clang exclusively. We need a similar test for libclang_rt.atomic.so which is the compiler-rt counterpart.

@ldionne
Copy link
Member

ldionne commented Nov 22, 2023

Actually, is there a reason why we even need to link against any of these libraries manually? Why doesn't Clang link against compiler-rt automatically? It does that for other system libraries by default, why is the atomic support library treated differently?

ldionne pushed a commit that referenced this pull request Nov 23, 2023
Undo a part of #73152.

These test do not hang, but unexpectedlty pass on aarch64
https://lab.llvm.org/buildbot/#/builders/74/builds/23708

Tests work on aarch64 and probably any platform without fp80.
@ldionne
Copy link
Member

ldionne commented Nov 24, 2023

I think we got to the bottom of it with Hui just now. He's going to upload a patch soon that should address this issue. Note that these tests are going to be disabled on platforms like Fuchsia where we don't know how to get __atomic_store symbols & friends though

@mstorsjo
Copy link
Member

Just for clarity; the issue that @petrhosek has reported wasn’t about Fuchsia, it is the Fuchsia team’s toolchain build, targeting Linux - the issue lies in, AFAIK, what library to link in for atomics. But a fix that disables those tests if unable to link in working atomics probably is right in any case.

@mgorny
Copy link
Member

mgorny commented Nov 25, 2023

These tests are hanging on my Gentoo amd64 machine:

  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp

I've killed them after they were running at 100% CPU utilization for over 20 minutes.

Full output (after killing)
FAIL: llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp (9682 of 9685)
******************** TEST 'llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp' FAILED ********************
Exit Code: 241

Command Output (stdout):
--
# COMPILED WITH
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.minus_equals.pass.cpp.dir/t.tmp.exe
# executed command: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.minus_equals.pass.cpp.dir/t.tmp.exe
# EXECUTED AS
/usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.minus_equals.pass.cpp.dir --  /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.minus_equals.pass.cpp.dir/t.tmp.exe
# executed command: /usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.minus_equals.pass.cpp.dir -- /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.minus_equals.pass.cpp.dir/t.tmp.exe
# note: command had no output on stdout or stderr
# error: command failed with exit status: 241

--

********************
FAIL: llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp (9683 of 9685)
******************** TEST 'llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp' FAILED ********************
Exit Code: 241

Command Output (stdout):
--
# COMPILED WITH
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_sub.pass.cpp.dir/t.tmp.exe
# executed command: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_sub.pass.cpp.dir/t.tmp.exe
# EXECUTED AS
/usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_sub.pass.cpp.dir --  /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_sub.pass.cpp.dir/t.tmp.exe
# executed command: /usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_sub.pass.cpp.dir -- /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_sub.pass.cpp.dir/t.tmp.exe
# note: command had no output on stdout or stderr
# error: command failed with exit status: 241

--

********************
FAIL: llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp (9684 of 9685)
******************** TEST 'llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp' FAILED ********************
Exit Code: 241

Command Output (stdout):
--
# COMPILED WITH
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_add.pass.cpp.dir/t.tmp.exe
# executed command: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_add.pass.cpp.dir/t.tmp.exe
# EXECUTED AS
/usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_add.pass.cpp.dir --  /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_add.pass.cpp.dir/t.tmp.exe
# executed command: /usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_add.pass.cpp.dir -- /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/fetch_add.pass.cpp.dir/t.tmp.exe
# note: command had no output on stdout or stderr
# error: command failed with exit status: 241

--

********************
FAIL: llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp (9685 of 9685)
******************** TEST 'llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp' FAILED ********************
Exit Code: 241

Command Output (stdout):
--
# COMPILED WITH
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.plus_equals.pass.cpp.dir/t.tmp.exe
# executed command: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-clang++ /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp -pthread --target=x86_64-pc-linux-gnu -nostdinc++ -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/include/c++/v1 -I /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -latomic -lc++experimental -nostdlib++ -L /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -Wl,-rpath,/var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/lib -lc++ -o /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.plus_equals.pass.cpp.dir/t.tmp.exe
# EXECUTED AS
/usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.plus_equals.pass.cpp.dir --  /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.plus_equals.pass.cpp.dir/t.tmp.exe
# executed command: /usr/bin/python3.12 /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/libcxx/utils/run.py --execdir /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.plus_equals.pass.cpp.dir -- /var/tmp/portage/sys-libs/libcxx-18.0.0_pre20231123/work/runtimes_build-abi_x86_64.amd64/test/std/atomics/atomics.types.generic/atomics.types.float/Output/operator.plus_equals.pass.cpp.dir/t.tmp.exe
# note: command had no output on stdout or stderr
# error: command failed with exit status: 241

--

********************
********************
Failed Tests (4):
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp


Testing Time: 3378.31s

Total Discovered Tests: 9685
  Unsupported      :  571 (5.90%)
  Passed           : 9069 (93.64%)
  Expectedly Failed:   41 (0.42%)
  Failed           :    4 (0.04%)

zeroomega referenced this pull request Dec 1, 2023
We really shouldn't be depending on far away configuration options like
LLVM_HAVE_LINK_VERSION_SCRIPT here. This patch simplifies the enablement
of the linker scripts and as a result gets rid of an undesirable
dependency on HandleLLVMOptions.cmake.

As a drive-by, the patch also stops taking into account whether Python3
is available. This should have no bearing on whether we generate a
linker script or not, which is required for correctness. If someone
tries to build libc++ and generate a linker script but Python3 is not
available, they should get an error instead of silently getting an
incorrect installation of the library.
@androm3da
Copy link
Member

These tests are hanging on my Gentoo amd64 machine:

  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp
  llvm-libc++-shared.cfg.in :: std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp

I've killed them after they were running at 100% CPU utilization for over 20 minutes.

Can you get a stacktrace in the deadlock condition @mgorny ?

@ldionne
Copy link
Member

ldionne commented Dec 18, 2023

Note that I think this is "resolved" now. @huixie90 turned off the tests that were broken for long double and is working on fixing the underlying issues in Clang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants