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

RPM Fusion build fails: sampleutiltest.cpp #11742

Closed
uklotzde opened this issue Jul 13, 2023 · 12 comments · Fixed by #11839
Closed

RPM Fusion build fails: sampleutiltest.cpp #11742

uklotzde opened this issue Jul 13, 2023 · 12 comments · Fixed by #11839

Comments

@uklotzde
Copy link
Contributor

uklotzde commented Jul 13, 2023

Bug Description

Build fails on all supported platforms: https://koji.rpmfusion.org/koji/taskinfo?taskID=602238

See the build log(s) for details, e.g. build_x86-64.zip

In function '__fill_a1',
    inlined from '__fill_a' at /usr/include/c++/13/bits/stl_algobase.h:977:21,
    inlined from 'fill' at /usr/include/c++/13/bits/stl_algobase.h:1007:20,
    inlined from 'fill' at /builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/src/util/sample.h:48:18,
    inlined from 'FillBuffer' at /builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/src/test/sampleutiltest.cpp:46:25,
    inlined from 'TestBody' at /builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/src/test/sampleutiltest.cpp:318:19:
/usr/include/c++/13/bits/stl_algobase.h:931:18: warning: '__builtin_memset' specified bound between 18446744065119617024 and 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  931 |         *__first = __tmp;
      |                  ^

Only the hardened RPM builds fail. The local build succeeds.

Version

2.4

OS

Fedora 38, 39 (rawhide)

@uklotzde uklotzde added the bug label Jul 13, 2023
@uklotzde
Copy link
Contributor Author

I am not planning to investigate the cause. The 2.4 release for Fedora is blocked until this issue is resolved.

@Swiftb0y
Copy link
Member

I'll try to look into it before the August 8th deadline.

@uklotzde
Copy link
Contributor Author

uklotzde commented Jul 14, 2023

Trying to exclude the tests from the build didn't work: ec301b4d9ba32940700a5238d47bc0c951bc0117

https://koji.rpmfusion.org/koji/buildinfo?buildID=26018

@uklotzde
Copy link
Contributor Author

uklotzde commented Jul 14, 2023

The failures can be reproduced by running a mock build using the source RPM as input on the local machine. But not well suited for debugging.

@mtasaka
Copy link

mtasaka commented Jul 24, 2023

Note that the above -Wstringop warning is just a warning and not a build "error".

The real error is shown following the above warnings, that is linkage is failing like

/usr/bin/ld: /tmp/ccEM9iDs.ltrans49.ltrans.o: warning: relocation against `_ZTVN9benchmark8internal17FunctionBenchmarkE' in read-only section `.text.startup'
/usr/bin/ld: /tmp/ccEM9iDs.ltrans21.ltrans.o: in function `(anonymous namespace)::BM_ZeroDelay(benchmark::State&)':
/builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/lib/benchmark/src/../include/benchmark/benchmark.h:820: undefined reference to `benchmark::State::StartKeepRunning()'
/usr/bin/ld: /builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/lib/benchmark/src/../include/benchmark/benchmark.h:807: undefined reference to `benchmark::State::FinishKeepRunning()'
/usr/bin/ld: /tmp/ccEM9iDs.ltrans21.ltrans.o:/builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/lib/benchmark/src/../include/benchmark/benchmark.h:820: undefined reference to `benchmark::State::StartKeepRunning()'
/usr/bin/ld: /tmp/ccEM9iDs.ltrans21.ltrans.o: in function `(anonymous namespace)::BM_DelaySmallerThanBufferSize(benchmark::State&)':
/builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/lib/benchmark/src/../include/benchmark/benchmark.h:820: undefined reference to `benchmark::State::StartKeepRunning()'
/usr/bin/ld: /builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/lib/benchmark/src/../include/benchmark/benchmark.h:807: undefined reference to `benchmark::State::FinishKeepRunning()'
/usr/bin/ld: /tmp/ccEM9iDs.ltrans21.ltrans.o:/builddir/build/BUILD/mixxx-f73413685fe173a07239c66a3a8d619c954f8e74/lib/benchmark/src/../include/benchmark/benchmark.h:820: undefined reference to `benchmark::State::StartKeepRunning()'

@mtasaka
Copy link

mtasaka commented Jul 24, 2023

Looks like the above symbols are defined in lib/benchmark/src/benchmark.cc, so I guess this symbol is expected to appear in libbenchmark.so.1 (as actually when trying to create mixxx-test binary, linker tries to link against lib/benchmark/src/libbenchmark.so.1.6.0 . But perhaps due to that compilation flag now uses -fvisibility=hidden -fvisibility-inlines-hidden, probably these needed function definition does no appear in libbenchmark.so.1, that is:

0444717

Removing these 3 lines actually makes build proceed, except that currently build dies with:

DEBUG: Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/mixxx-2.4.0-0.1.beta.20230723git0550e07.fc39.x86_64
DEBUG: error: Installed (but unpackaged) file(s) found:
DEBUG:    /usr/share/icons/hicolor/scalable/apps/mixxx_macos.svg
DEBUG: RPM build errors:
DEBUG:     Installed (but unpackaged) file(s) found:
DEBUG:    /usr/share/icons/hicolor/scalable/apps/mixxx_macos.svg

Also this can explain that 2.3.5 build was okay, the above visibility change was introduced in 2.4 branch.

@uklotzde
Copy link
Contributor Author

uklotzde commented Jul 24, 2023

@mtasaka Thank you for your investigation! Unfortunately, I have no clue why those CMake settings have been changed in Mixxx and how this causes linker errors on Fedora for the RPM builds but neither for local builds nor for the CI builds.

The mixxx_macos.svg file needs to be excluded, that's an easy fix.

@uklotzde
Copy link
Contributor Author

Next build task with the proposed changes and patch is scheduled, awaiting the failure of the currently running build job: https://koji.rpmfusion.org/koji/taskinfo?taskID=603283

@daschuer
Copy link
Member

Without the visibility flags, we see warnings on clang (macOS) because of different visibilities in Mixxx and the linked libraries.
Unlike on Windows, on Linux and macOS everything is visible by default. Recently the upstream libraries are starting to hide functions which is causing this warning.

@daschuer
Copy link
Member

This is a related PR:
google/benchmark#1321
Merged to 1.6.2

With vcpkg we use benchmark 1.7.1 including this patch.

@uklotzde
Copy link
Contributor Author

According to CMakeLists.txt Mixxx uses the vendored (and unmaintained) version of google-benchmark from the lib directory.

add_subdirectory(
  "${CMAKE_CURRENT_SOURCE_DIR}/lib/benchmark"
  "${CMAKE_CURRENT_BINARY_DIR}/lib/benchmark"
)
target_link_libraries(mixxx-test PRIVATE benchmark)

@uklotzde
Copy link
Contributor Author

Patched out: rpmfusion/mixxx@75f608e

@daschuer daschuer added this to the 2.4.0 milestone Aug 18, 2023
@daschuer daschuer closed this as completed Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants