star-bnl / star-sw

Core software for STAR experiment
26 stars 63 forks source link

Runtime errors in StarVMC/StarAgmlLib when using ROOT 6.24 #620

Closed plexoos closed 3 months ago

plexoos commented 6 months ago

After a couple of fixes, our code seems to compile fine against ROOT6.24 (See https://github.com/star-bnl/star-sw/pull/619)

However, some test jobs fail at what appears to be the geometry loading stage. The errors point to the code in StarVMC/StarAgmlLib. Here is an example error message:

https://github.com/star-bnl/star-sw/actions/runs/6727541469/job/18287828236?pr=619

In file included from /tmp/root/spack-stage/spack-stage-root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/spack-build-gbmdgvx/input_line_9:15:
In file included from /tmp/root/spack-stage/spack-stage-root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/spack-build-gbmdgvx/etc/dictpch/allHeaders.h:120:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/set:60:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_tree.h:1423:13: error: no viable conversion from returned value of type 'pair<...>' to function return type 'pair<...>'
            return _Res(0, _M_rightmost());
                   ^~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_tree.h:1673:19: note: in instantiation of member function 'std::_Rb_tree<int, std::pair<const int, std::vector<TString, std::allocator<TString> > >, std::_Select1st<std::pair<const int, std::vector<TString, std::allocator<TString> > > >, std::less<int>, std::allocator<std::pair<const int, std::vector<TString, std::allocator<TString> > > > >::_M_get_insert_hint_unique_pos' requested here
            auto __res = _M_get_insert_hint_unique_pos(__pos, _S_key(__z));
                         ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_map.h:465:15: note: in instantiation of function template specialization 'std::_Rb_tree<int, std::pair<const int, std::vector<TString, std::allocator<TString> > >, std::_Select1st<std::pair<const int, std::vector<TString, std::allocator<TString> > > >, std::less<int>, std::allocator<std::pair<const int, std::vector<TString, std::allocator<TString> > > > >::_M_emplace_hint_unique<const std::piecewise_construct_t &, std::tuple<const int &>, std::tuple<> >' requested here
          __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
                     ^
/star-sw/.sl79_gcc485/OBJ/StarVMC/StarAgmlLib/AgShape.h:70:53: note: in instantiation of member function 'std::map<int, std::vector<TString, std::allocator<TString> >, std::less<int>, std::allocator<std::pair<const int, std::vector<TString, std::allocator<TString> > > > >::operator[]' requested here
  std::vector< TString > &parList(){ return mParList[mId]; }
                                                    ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_pair.h:127:17: note: candidate constructor not viable: no known conversion from '_Res' (aka 'pair<std::_Rb_tree_node_base *, std::_Rb_tree_node_base *>') to 'const std::pair<std::_Rb_tree_node_base *, std::_Rb_tree_node_base *> &' for 1st argument
      constexpr pair(const pair&) = default;
                ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_pair.h:128:17: note: candidate constructor not viable: no known conversion from '_Res' (aka 'pair<std::_Rb_tree_node_base *, std::_Rb_tree_node_base *>') to 'std::pair<std::_Rb_tree_node_base *, std::_Rb_tree_node_base *> &&' for 1st argument
      constexpr pair(pair&&) = default;
                ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_pair.h:124:12: note: candidate template ignored: deduced type 'const pair<...>' of 1st parameter does not match adjusted type 'pair<...>' of argument [with _U1 = std::_Rb_tree_node_base *, _U2 = std::_Rb_tree_node_base *, $2 = void]
        constexpr pair(const pair<_U1, _U2>& __p)
                  ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_pair.h:150:12: note: candidate template ignored: deduced type 'pair<...>' of 1st parameter does not match adjusted type 'pair<...>' of argument [with _U1 = std::_Rb_tree_node_base *, _U2 = std::_Rb_tree_node_base *, $2 = void]
        constexpr pair(pair<_U1, _U2>&& __p)
                  ^

cc @klendathu2k @fgeurts

klendathu2k commented 6 months ago

This is not reproducible in the production environment (i.e. built on an rcas node). Could you point me to instructions on how to load the container that the test runs in?

@plexoos

plexoos commented 5 months ago

This issue can be resolved by circumventing the use of inlined non-const map accessors. E.g. https://github.com/star-bnl/star-sw/pull/619/commits/a9609e73adf77644ee60b61972ee61c064e0a954

plexoos commented 5 months ago

Could you point me to instructions on how to load the container that the test runs in?

Very easy. Download an artifact from the Build Pull Request action page, create a docker image with docker load < star-sw-root6-gcc485.tar, then run it

klendathu2k commented 4 months ago

Okay. Have things running under docker. Unfortunately no GDB. However, once I built the star-sw under the eval area in afs, I was able to reproduce the issue in the production environment.

The problem occurs when the StiMasterDetectorBuilder tries to create a copy (clone) of the geometry. The crash appears to happen inside of root. I can reproduce this very simply by doing

# Load a geometry macro
$ root.exe y2012.C

# Clone the geometry
gGeoManager->Clone("CloneGeom");
 *** Break *** segmentation violation
 Generating stack trace...

So... moving to 6.24 will require a workaround (or bug fix in root). In the past we have not cloned the geometry, but rather operated on the geometry in memory and then restored from a cached file. So we should have a workaround available. Will return to this tomorrow.