Skip to content

Fix sanitizer errors from THistSvc

Addresses a couple errors from the address and undefined behaviour sanitizers.

==3989==ERROR: AddressSanitizer: heap-use-after-free on address 0x60300027d378 at pc 0x7f954f29b3cb bp 0x7ffcea53c170 sp 0x7ffcea53c168
READ of size 8 at 0x60300027d378 thread T0
    #0 0x7f954f29b3ca in THistSvc::deReg(TObject*) /workspace/build/GAUDI/GAUDI_HEAD/GaudiSvc/src/THistSvc/THistSvc.cpp:634
    #1 0x7f954f297f9d in THistSvc::deReg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workspace/build/GAUDI/GAUDI_HEAD/GaudiSvc/src/THistSvc/THistSvc.cpp:586
    #2 0x7f9554c10998 in THistWrite::finalize() /workspace/build/GAUDI/GAUDI_HEAD/GaudiExamples/src/THist/THistWrite.cpp:280
/workspace/build/GAUDI/GAUDI_HEAD/GaudiSvc/src/THistSvc/THistSvc.icc:115:21: runtime error: load of value 55966096, which is not a valid value for type 'Mode'
    #0 0x7f7d1d2a1960 in StatusCode THistSvc::regHist_i<TH1>(std::unique_ptr<TH1, std::default_delete<TH1> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, THistSvc::THistID*&) /workspace/build/GAUDI/GAUDI_HEAD/GaudiSvc/src/THistSvc/THistSvc.icc:115
    #1 0x7f7d1d2a3182 in StatusCode THistSvc::regHist_i<TH1>(std::unique_ptr<TH1, std::default_delete<TH1> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) /workspace/build/GAUDI/GAUDI_HEAD/GaudiSvc/src/THistSvc/THistSvc.icc:20
    #2 0x7f7d1d214407 in THistSvc::regHist(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::unique_ptr<TH1, std::default_delete<TH1> >) /workspace/build/GAUDI/GAUDI_HEAD/GaudiSvc/src/THistSvc/THistSvc.cpp:352
    #3 0x7f7d2b7d8037 in THistWrite::initialize() /workspace/build/GAUDI/GAUDI_HEAD/GaudiExamples/src/THist/THistWrite.cpp:40

Merge request reports

Loading