rapidyaml: 0.7.1 tests failing in ppc64le with g++14 -O2
TL;DR full symptoms, gathered below:
- test failures with g++14 -O2 cross-compiled to ppc64le
- no failures with g++14 -O1 cross-compiled to ppc64le
- no failures with g++14 -O3 cross-compiled to ppc64le
- no failures with g++13 -O2 cross-compiled to ppc64le
- no failures with g++14 -O2 on x64
Original report
v0.7.1 is showing quite a few regressions on ppc64le only:
The following tests FAILED:
1 - ryml-test-quickstart (Failed)
7 - ryml-test-parse_engine_6_qmrk (Failed)
8 - ryml-test-parse_engine_7_seqimap (SEGFAULT)
16 - ryml-test-tree (SEGFAULT)
18 - ryml-test-emit (Failed)
19 - ryml-test-style (Failed)
22 - ryml-test-json (Failed)
24 - ryml-test-merge (Failed)
28 - ryml-test-seq (SEGFAULT)
31 - ryml-test-map (SEGFAULT)
38 - ryml-test-scalar_null (Failed)
53 - ryml-test-anchor (Failed)
55 - ryml-test-number (Failed)
(I am not sure if I tested 0.7.0 thoroughly on non-x86_64 architectures or not.)
_Originally posted by @musicinmybrain in https://github.com/biojppm/rapidyaml/issues/440#issuecomment-2294036666_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 32 (32 by maintainers)
Commits related to this issue
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464: smaller test case; cross-compile, qemu; command: set -xe ; cd ~/proj/rapidyaml/samples/add_subdirectory/ ; sys=powerpc64le ; cxxflags="-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grec... — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464: smaller test case; cross-compile, qemu; command: set -xe ; cd ~/proj/rapidyaml/samples/add_subdirectory/ ; sys=powerpc64le ; cxxflags="-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grec... — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464: workaround for failures with ppc64le g++14 -O2 — committed to biojppm/rapidyaml by biojppm 2 years ago
- re #464: workaround for failures with ppc64le g++14 -O2 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
- workarounds for gcc optimizer misbuilds See also #440, #464, #486 — committed to biojppm/rapidyaml by biojppm 2 years ago
Thank you! This seems to be working well for me, so I’m going to update the
rapidyamlpackage in Fedora from 0.6.0 to 0.7.2 in Fedora Rawhide (future Fedora 42) and in the upcoming Fedora 41. This will also be the initial version (and probably the only version due to ABI compatibility) ofrapidyamlin EPEL10.I just now tried https://github.com/biojppm/rapidyaml/issues/464#issuecomment-2297446452 again, with the following differences:
master, 346c0c1d9317eb48c2a59e567c194e94338e0b23-DRYML_CXX_STANDARD=14-O2to-O3All the tests passed.
Don’t patch, I’ll cleanup this branch and make a new release.
I’m somewhat bothered by this situation (eg, this issue, and #440, and the previous problem referred therein).
The functions I now had to change look innocuous, and their call sites also look innocuous. It is remarkable that the optimizer is choking on this code, and it is even more remarkable that
-O3works while-O2doesn’t.Even if UB is the ultimate reason, I find it hard to surmise how that is so. So do the many static analysis tools, and none of them point at anything suspicious.
Given that this issue is so specific (ie only gcc14+ppc64le±O2), having a test in the CI does not make much sense (or otherwise the already gigantic size of this project’s CI would balloon). So I’m just going to do the changes and merge them in.
If I restore the LTO flags (
-flto=auto -ffat-lto-objects), then the ODR violation warning reappears. If I also addstd=c++11so that the example is compiled as C++11 rather than the unspecified default (C++17 in practice), then I can get the test failures without the ODR violation warning. This makes sense because the different definitions ofFTOA_FLOATwere due to different C++ standards in different translation units. However, it also demonstrates that the ODR violation is not the cause of the test failure.So I started by trying to imitate Fedora’s build flags as closely as I reasonably could, with the idea that if I could reproduce this with
samples/add_subdirectory, I wouldI haven’t had a chance to try to minimize the compiler flags yet, but that looked interesting enough to go ahead and report it!