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

[Issue]: Build failure with GCC-14: rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h:237:18: error: assignment of member ‘dismiss_’ in read-only object #170

Open
NHOrus opened this issue May 22, 2024 · 2 comments

Comments

@NHOrus
Copy link

NHOrus commented May 22, 2024

Problem Description

Gentoo bug https://bugs.gentoo.org/918709 for 5.4.2, but issue persists for 6.1.1

/home/.../rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/home/.../rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h:237:18: error: assignment of member ‘dismiss_’ in read-only object
  237 |     rhs.dismiss_ = true;
      |     ~~~~~~~~~~~~~^~~~~~

Operating System

Gentoo

CPU

AMD Ryzen 7 5700U with Radeon Graphics

GPU

AMD Radeon VII

ROCm Version

ROCm 6.1.0

ROCm Component

rocm_smi_lib

Steps to Reproduce

install gcc-14
Try to compile with gcc-14 as standard compiler

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

@PIPIPIG233666
Copy link

❯ cat gcc14.patch

--- a/include/rocm_smi/rocm_smi_utils.h 2024-05-25 00:02:19.127412816 -0400
+++ b/include/rocm_smi/rocm_smi_utils.h 2024-05-25 00:03:25.359416227 -0400
@@ -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;

lamikr added a commit to lamikr/rocm_sdk_builder that referenced this issue May 29, 2024
fix the modify of readonly object detected by gcc_14
- original patch and bugreports
    1) #12
    2) https://bugs.gentoo.org/918709
    3) ROCm/rocm_smi_lib#170

[ 24%] Building CXX object oam/CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o
In file included from /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/rocm_smi_lib/src/rocm_smi_power_mon.cc:52:
/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h:237:18: error: assignment of member ‘dismiss_’ in read-only object
  237 |     rhs.dismiss_ = true;

Thank you for Crizle for bug report and link for the fix patch.

Signed-off-by: Mika Laitio <lamikr@gmail.com>
lamikr added a commit to lamikr/rocm_sdk_builder that referenced this issue May 29, 2024
fix the modify of readonly object detected by gcc_14
- original patch and bugreports
    1) #12
    2) https://bugs.gentoo.org/918709
    3) ROCm/rocm_smi_lib#170

[ 24%] Building CXX object oam/CMakeFiles/oam.dir/__/src/rocm_smi_utils.cc.o
In file included from /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/rocm_smi_lib/src/rocm_smi_power_mon.cc:52:
/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h: In member function ‘amd::smi::ScopeGuard<lambda>& amd::smi::ScopeGuard<lambda>::operator=(const amd::smi::ScopeGuard<lambda>&)’:
/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/rocm_smi_lib/include/rocm_smi/rocm_smi_utils.h:237:18: error: assignment of member ‘dismiss_’ in read-only object
  237 |     rhs.dismiss_ = true;

Thank you for Crizle for bug report and link for the fix patch.

Signed-off-by: Mika Laitio <lamikr@gmail.com>
@dmitrii-galantsev
Copy link
Collaborator

thanks for submitting a bug. I pushed this out for now: 7fdc6e5

Internal change pending. Should be in develop in a day or 2.

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

No branches or pull requests

3 participants