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

LLVM assertion failure in HandleUnionActiveMemberChange #13019

Closed
1 task done
pikacic opened this issue Jun 14, 2023 · 1 comment
Closed
1 task done

LLVM assertion failure in HandleUnionActiveMemberChange #13019

pikacic opened this issue Jun 14, 2023 · 1 comment
Assignees
Labels

Comments

@pikacic
Copy link

pikacic commented Jun 14, 2023

Check duplicate issues.

  • Checked for duplicates

Describe the bug

We are using a customized version of https://github.com/therocode/meta_enum that fails with ROOT v6-28-00-patches.

When including the attached file I get an assertion failure from LLVM:

root [0] #include "custom_meta_enum_test.hpp"
root.exe: /build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-v6-28-00-patches/src/ROOT/v6-28-00-patches/interpreter/llvm/src/tools/clang/lib/AST/ExprConstant.cpp:5921: bool HandleUnionActiveMemberChange({anonymous}::EvalInfo&, const clang::Expr*, const {anonymous}::LValue&): Assertion `declaresSameEntity(FD, LHS.Designator.Entries[PathLength] .getAsBaseOrMember().getPointer())' failed.

By trial and errors I managed to find the bit of code that triggers the assertion error and I embedded the workaround in the attached file:

root [0] #define WORKAROUND
root [1] #include "custom_meta_enum_test.hpp"
root [2] 

The difference that works around the issue is basically

+++ b/Kernel/LHCbKernel/include/Kernel/meta_enum.h
@@ -130,10 +130,11 @@ namespace meta_enum_internal {
       currentStringStart = currentStringEnd;
     }
     for ( size_t i = 0; i < memberStrings.size(); ++i ) {
-      result.members[i].name  = parseEnumMemberName( memberStrings[i] );
+      auto name = parseEnumMemberName( memberStrings[i] );
+      result.members[i].name  = name;
       result.members[i].value = std::get<1>( values )[i];
       if ( std::get<0>( values ) == std::get<1>( values )[i] ) {
-        result.defaultString = result.members[i].name;
+        result.defaultString = name;
         result.defaultValue  = std::get<0>( values );
       }
     }

custom_meta_enum_test.hpp.gz

What is the expected behaviour?

No response

How to reproduce?

From lxplus9.cern.ch:

❯ . /cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Mon/x86_64-el9-gcc13-dbg/setup.sh
❯ root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.28/05                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jun 10 2023, 00:28:00                 |
  | From heads/v6-28-00-patches@v6-28-04-94-gb7de1efc73              |
  | With g++ (GCC) 13.1.0                                            |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

root [0] #include "custom_meta_enum_test.hpp"
root.exe: /build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-v6-28-00-patches/src/ROOT/v6-28-00-patches/interpreter/llvm/src/tools/clang/lib/AST/ExprConstant.cpp:5921: bool HandleUnionActiveMemberChange({anonymous}::EvalInfo&, const clang::Expr*, const {anonymous}::LValue&): Assertion `declaresSameEntity(FD, LHS.Designator.Entries[PathLength] .getAsBaseOrMember().getPointer())' failed.

The workaround can be demonstrated with:

❯ . /cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Mon/x86_64-el9-gcc13-dbg/setup.sh
❯ root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.28/05                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jun 10 2023, 00:28:00                 |
  | From heads/v6-28-00-patches@v6-28-04-94-gb7de1efc73              |
  | With g++ (GCC) 13.1.0                                            |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

root [0] #define WORKAROUND
root [1] #include "custom_meta_enum_test.hpp"
root [2] 

ROOT version

v6-28-00-patches@v6-28-04-94-gb7de1efc73

How did you install ROOT?

LCG nightly builds in /cvmfs/sft-nightlies.cern.ch

Which operating system are you using?

Linux Alma 9

Additional context

No response

@pikacic pikacic added the bug label Jun 14, 2023
@dpiparo dpiparo assigned dpiparo and unassigned Axel-Naumann Feb 5, 2024
@dpiparo dpiparo added this to Issues in Fixed in 6.32.00 via automation May 25, 2024
@dpiparo
Copy link
Member

dpiparo commented May 25, 2024

Apologies for coming back to this so late. I am closing since it's fixed in 6.30, currently used int LHCb's stacks, and 6.32, which relies on llvm16. Please feel free to re-open if this problem is hitting again the experiments.

@dpiparo dpiparo closed this as completed May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

3 participants