Subject: Bug#1075450: rocm-smi-lib: ftbfs with GCC-14

From: Matthias Klose <[email-masked]>
Date: Wed, 03 Jul 2024 12:42:16 +0000

Package: src:rocm-smi-lib
Version: 5.7.0-1
Severity: important
Tags: sid trixie
User: [email-masked]
Usertags: ftbfs-gcc-14

[This bug is targeted to the upcoming trixie release]

Please keep this issue open in the bug tracker for the package it
was filed for.  If a fix in another package is required, please
file a bug for the other package (or clone), and add a block in this
package. Please keep the issue open until the package can be built in
a follow-up test rebuild.

The package fails to build in a test rebuild on at least amd64 with
gcc-14/g++-14, but succeeds to build with gcc-13/g++-13. The
severity of this report will be raised before the trixie release.

The full build log can be found at:
http://qa-logs.debian.net/2024/07/01/rocm-smi-lib_5.7.0-1_unstable_gccexp.log
The last lines of the build log are at the end of this report.

To build with GCC 14, either set CC=gcc-14 CXX=g++-14 explicitly,
or install the gcc, g++, gfortran, ... packages from experimental.

  apt-get -t=experimental install g++ 

Common build failures are new warnings resulting in build failures with
-Werror turned on, or new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-14/porting_to.html

[...]
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h:155:18: error: assignment of member ‘dismiss_’ in read-only object
  155 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:121: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_power_mon.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 29%] Building CXX object oam/CMakeFiles/oam.dir/__/src/rocm_smi_main.cc.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/oam && /usr/bin/c++ -Doam_EXPORTS -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/third_party/shared_mutex -I/<<PKGBUILDDIR>>/oam/include -I/<<PKGBUILDDIR>>/common/shared_mutex -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -fno-rtti -m64 -msse -msse2 -std=c++11  -Wconversion -Wcast-align  -Wformat=2 -fno-common -Wstrict-overflow   -Woverloaded-virtual -Wreorder  -DFORTIFY_SOURCE=2 -fstack-protector-all -Wcast-align -Wl,-z,noexecstack -Wl,-znoexecheap -Wl,-z,relro  -Wtrampolines -Wl,-z,now -ggdb -O0 -DDEBUG -fPIC -MD -MT oam/CMakeFiles/oam.dir/__/src/rocm_smi_main.cc.o -MF CMakeFiles/oam.dir/__/src/rocm_smi_main.cc.o.d -o CMakeFiles/oam.dir/__/src/rocm_smi_main.cc.o -c /<<PKGBUILDDIR>>/src/rocm_smi_main.cc
In file included from /<<PKGBUILDDIR>>/src/rocm_smi_monitor.cc:58:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h:155:18: error: assignment of member ‘dismiss_’ in read-only object
  155 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:149: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_counters.cc.o] Error 1
[ 32%] Building CXX object oam/CMakeFiles/oam.dir/__/src/rocm_smi_monitor.cc.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/oam && /usr/bin/c++ -Doam_EXPORTS -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/third_party/shared_mutex -I/<<PKGBUILDDIR>>/oam/include -I/<<PKGBUILDDIR>>/common/shared_mutex -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -fno-rtti -m64 -msse -msse2 -std=c++11  -Wconversion -Wcast-align  -Wformat=2 -fno-common -Wstrict-overflow   -Woverloaded-virtual -Wreorder  -DFORTIFY_SOURCE=2 -fstack-protector-all -Wcast-align -Wl,-z,noexecstack -Wl,-znoexecheap -Wl,-z,relro  -Wtrampolines -Wl,-z,now -ggdb -O0 -DDEBUG -fPIC -MD -MT oam/CMakeFiles/oam.dir/__/src/rocm_smi_monitor.cc.o -MF CMakeFiles/oam.dir/__/src/rocm_smi_monitor.cc.o.d -o CMakeFiles/oam.dir/__/src/rocm_smi_monitor.cc.o -c /<<PKGBUILDDIR>>/src/rocm_smi_monitor.cc
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:163: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_kfd.cc.o] Error 1
[ 35%] Building CXX object oam/CMakeFiles/oam.dir/__/src/rocm_smi_power_mon.cc.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/oam && /usr/bin/c++ -Doam_EXPORTS -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/third_party/shared_mutex -I/<<PKGBUILDDIR>>/oam/include -I/<<PKGBUILDDIR>>/common/shared_mutex -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -fno-rtti -m64 -msse -msse2 -std=c++11  -Wconversion -Wcast-align  -Wformat=2 -fno-common -Wstrict-overflow   -Woverloaded-virtual -Wreorder  -DFORTIFY_SOURCE=2 -fstack-protector-all -Wcast-align -Wl,-z,noexecstack -Wl,-znoexecheap -Wl,-z,relro  -Wtrampolines -Wl,-z,now -ggdb -O0 -DDEBUG -fPIC -MD -MT oam/CMakeFiles/oam.dir/__/src/rocm_smi_power_mon.cc.o -MF CMakeFiles/oam.dir/__/src/rocm_smi_power_mon.cc.o.d -o CMakeFiles/oam.dir/__/src/rocm_smi_power_mon.cc.o -c /<<PKGBUILDDIR>>/src/rocm_smi_power_mon.cc
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:93: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_main.cc.o] Error 1
[ 38%] Building CXX object oam/CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/oam && /usr/bin/c++ -Doam_EXPORTS -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/third_party/shared_mutex -I/<<PKGBUILDDIR>>/oam/include -I/<<PKGBUILDDIR>>/common/shared_mutex -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -fno-rtti -m64 -msse -msse2 -std=c++11  -Wconversion -Wcast-align  -Wformat=2 -fno-common -Wstrict-overflow   -Woverloaded-virtual -Wreorder  -DFORTIFY_SOURCE=2 -fstack-protector-all -Wcast-align -Wl,-z,noexecstack -Wl,-znoexecheap -Wl,-z,relro  -Wtrampolines -Wl,-z,now -ggdb -O0 -DDEBUG -fPIC -MD -MT oam/CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o -MF CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o.d -o CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o -c /<<PKGBUILDDIR>>/src/rocm_smi_utils.cc
make[3]: *** [oam/CMakeFiles/oam.dir/build.make:79: oam/CMakeFiles/oam.dir/__/src/rocm_smi_device.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:79: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_device.cc.o] Error 1
In file included from /<<PKGBUILDDIR>>/src/rocm_smi_utils.cc:62:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h:155:18: error: assignment of member ‘dismiss_’ in read-only object
  155 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~
In file included from /<<PKGBUILDDIR>>/src/rocm_smi_main.cc:66:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h:155:18: error: assignment of member ‘dismiss_’ in read-only object
  155 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~
In file included from /<<PKGBUILDDIR>>/src/rocm_smi_monitor.cc:58:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h:155:18: error: assignment of member ‘dismiss_’ in read-only object
  155 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~
/<<PKGBUILDDIR>>/src/rocm_smi_utils.cc: At global scope:
/<<PKGBUILDDIR>>/src/rocm_smi_utils.cc:106:13: warning: ‘void amd::smi::debugFilesDiscovered(std::vector<std::__cxx11::basic_string<char> >)’ defined but not used [-Wunused-function]
  106 | static void debugFilesDiscovered(std::vector<std::string> files) {
      |             ^~~~~~~~~~~~~~~~~~~~
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:135: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_utils.cc.o] Error 1
In file included from /<<PKGBUILDDIR>>/src/rocm_smi_power_mon.cc:55:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/<<PKGBUILDDIR>>/include/rocm_smi/rocm_smi_utils.h:155:18: error: assignment of member ‘dismiss_’ in read-only object
  155 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~
make[3]: *** [oam/CMakeFiles/oam.dir/build.make:121: oam/CMakeFiles/oam.dir/__/src/rocm_smi_power_mon.cc.o] Error 1
make[3]: *** [rocm_smi/CMakeFiles/rocm_smi64.dir/build.make:107: rocm_smi/CMakeFiles/rocm_smi64.dir/__/src/rocm_smi_monitor.cc.o] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:319: rocm_smi/CMakeFiles/rocm_smi64.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: *** [oam/CMakeFiles/oam.dir/build.make:93: oam/CMakeFiles/oam.dir/__/src/rocm_smi_main.cc.o] Error 1
make[3]: *** [oam/CMakeFiles/oam.dir/build.make:107: oam/CMakeFiles/oam.dir/__/src/rocm_smi_monitor.cc.o] Error 1
/<<PKGBUILDDIR>>/src/rocm_smi_utils.cc: At global scope:
/<<PKGBUILDDIR>>/src/rocm_smi_utils.cc:106:13: warning: ‘void amd::smi::debugFilesDiscovered(std::vector<std::__cxx11::basic_string<char> >)’ defined but not used [-Wunused-function]
  106 | static void debugFilesDiscovered(std::vector<std::string> files) {
      |             ^~~~~~~~~~~~~~~~~~~~
make[3]: *** [oam/CMakeFiles/oam.dir/build.make:135: oam/CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:397: oam/CMakeFiles/oam.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[1]: *** [Makefile:159: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
dh_auto_build: error: cd obj-x86_64-linux-gnu && make -j8 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:12: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

---

From: "Debian Bug Tracking System" <[email-masked]>
Date: Wed, 03 Jul 2024 12:50:16 +0000

Thank you for filing a new Bug report with Debian.

You can follow progress on this Bug here: 1075450: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075450.

This is an automatically generated reply to let you know your message
has been received.

Your message has been forwarded to the package maintainers (but not
other interested parties, as you requested) for their attention; they
will reply in due course.

Your message has been sent to the package maintainer(s):
 ROCm Team <[email-masked]>

If you wish to submit further information on this problem, please
send it to [email-masked].

Please do not send mail to [email-masked] unless you wish
to report a problem with the Bug-tracking system.

-- 
1075450: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075450
Debian Bug Tracking System
Contact [email-masked] with problems

---

From: Graham Inggs <[email-masked]>
Date: Mon, 26 Aug 2024 17:10:52 +0000

Control: tags -1 + patch

This is already fixed upstream:
https://github.com/ROCm/rocm_smi_lib/commit/12c8237705a91bd4096cfa4e9c0eac2d5305544b

--- a/include/rocm_smi/rocm_smi_utils.h
+++ b/include/rocm_smi/rocm_smi_utils.h
@@ -149,7 +149,7 @@
   __forceinline ~ScopeGuard() {
     if (!dismiss_) release_();
   }
-  __forceinline ScopeGuard& operator=(const ScopeGuard& rhs) {
+  __forceinline ScopeGuard& operator=(ScopeGuard& rhs) {
     dismiss_ = rhs.dismiss_;
     release_ = rhs.release_;
     rhs.dismiss_ = true;

---

From: Christian Kastner <[email-masked]>
Date: Tue, 27 Aug 2024 00:15:26 +0200

Thanks, Graham.

This looked easy enough so I cherry-picked this patch, but the build
produces a ton symbol changes.

These are all C++ internal symbols that should not be public, I assume
this is gcc-14 related. Since they not part of the public interface, I
wouldn't have qualms forcefully updating them, but I'd nevertheless feel
more comfortable spending a bit more time on this, to ensure this is
either gcc-14- and/or patch-related.

Best,
Christian

---

From: Chris Hofstaedtler <[email-masked]>
Date: Sun, 13 Apr 2025 20:14:51 +0200

Hi,

> either gcc-14- and/or patch-related.

Can and will anything be done about this bug for trixie?

If not, could -release please tag this bug so it disappears from the 
UDD BSP view?

Thanks,
Chris

---

From: "Debian Bug Tracking System" <[email-masked]>
Date: Mon, 14 Apr 2025 08:27:04 +0000

This is an automatic notification regarding your Bug report
which was filed against the src:rocm-smi-lib package:

#1075450: rocm-smi-lib: ftbfs with GCC-14

It has been closed by Philipp Kern <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Philipp Kern <[email-masked]> by
replying to this email.

Subject: Re: Bug#1075450: rocm-smi-lib: ftbfs with GCC-14
From: Philipp Kern <[email-masked]>
To: Chris Hofstaedtler <[email-masked]>, [email-masked]
Cc: Christian Kastner <[email-masked]>, Graham Inggs <[email-masked]>, [email-masked]
Date: Mon, 14 Apr 2025 08:25:05 +0000

Version: 6.1.2-1

> Can and will anything be done about this bug for trixie?

Looks like it's fixed (at least) in 6.1.2-1 given that the fixed code is
already present there.

Kind regards
Philipp Kern

Subject: rocm-smi-lib: ftbfs with GCC-14
From: Matthias Klose <[email-masked]>
To: [email-masked]
Date: Wed, 03 Jul 2024 12:42:16 +0000

[...]