Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We have to make this as `static` or `extern` in order to keep the lifetime of these arrays until application terminates. `static` needs to be picked if values will not be compared by reference between various translation units otherwise we need `extern`. Should resolve valgrind detected issues, e.g.: ==27582== Invalid read of size 4 ==27582== at 0x5BFEE2D: __gnu_cxx::__exchange_and_add(int volatile*, int) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x5BFEEC1: __gnu_cxx::__exchange_and_add_dispatch(int*, int) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x5C0330F: std::string::_Rep::_M_dispose(std::allocator<char> const&) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x5BFF9E2: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x71AD3EF: __tcf_2 (GEMDetLabel.h:4) ==27582== by 0x3A46635B21: exit (in /lib64/libc-2.12.so) ==27582== by 0x3A4661ED63: (below main) (in /lib64/libc-2.12.so) ==27582== Address 0x60579c0 is 16 bytes inside a block of size 30 free'd ==27582== at 0x40290B3: operator delete(void*) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/valgrind/3.10.1/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27582== by 0x5C03D3F: __gnu_cxx::new_allocator<char>::deallocate(char*, unsigned long) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x5C0337E: std::string::_Rep::_M_destroy(std::allocator<char> const&) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x5C0332B: std::string::_Rep::_M_dispose(std::allocator<char> const&) (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x5BFF9E2: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /afs/cern.ch/cms/sw/ReleaseCandidates/volB/slc6_amd64_gcc493/external/gcc/4.9.3/lib64/libstdc++.so.6.0.20) ==27582== by 0x713F6FE: __tcf_2 (GEMDetLabel.h:4) ==27582== by 0x3A46635B21: exit (in /lib64/libc-2.12.so) ==27582== by 0x3A4661ED63: (below main) (in /lib64/libc-2.12.so) Signed-off-by: David Abdurachmanov <[email protected]>
- Loading branch information