Hello,
I was running Valgrind on one of my code just to track down a memory issue and I saw that a TString declaration is triggering avalgrind message that I don’t understand. Can someone advice on this side issue ? I am just curious how to get rid of this message
==688== Memcheck, a memory error detector
==688== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==688== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==688== Command: SignalProcessing *_GWOSC_4KHZ_R1-*.root --input -{}_GWOSC_4KHZ_R1-{}-{}.root --output SP-512-{0}-{1}-{2}.root --center --timegate 32
==688==
==688== Invalid read of size 1
==688== at 0x49FFA29: patcmp(char const*, unsigned long, unsigned short const*, char const*) (in /home/marcomeyer/Software/root/6.26.04/lib/libCore.so)
==688== by 0x4A0032F: Matchs(char const*, unsigned long, unsigned short const*, char const**) (in /home/marcomeyer/Software/root/6.26.04/lib/libCore.so)
==688== by 0x4A5104F: TRegexp::Index(TString const&, int*, int) const (in /home/marcomeyer/Software/root/6.26.04/lib/libCore.so)
==688== by 0x5511FC7: UIUC::TFileReader::ExpandWildcardUrl(TString, char const*) (TFileReader.cc:1039)
==688== by 0x551150E: UIUC::TFileReader::ExpandWildcardUrl(std::vector<TString, std::allocator<TString> >, char const*) (TFileReader.cc:966)
==688== by 0x5510124: UIUC::TFileReader::ExpandTextFile(std::vector<TString, std::allocator<TString> >, char const*, int) (TFileReader.cc:861)
==688== by 0x550F231: UIUC::TFileReader::ExpandWildcard(TString, char const*, int) (TFileReader.cc:802)
==688== by 0x55084AE: UIUC::TFileReader::Add(TString) (TFileReader.cc:222)
==688== by 0x55078DD: UIUC::TFileReader::Init(TString) (TFileReader.cc:181)
==688== by 0x54ADC15: UIUC::HandboxUsage::AddArgument(UIUC::TFileReader*, TString, bool) (HandboxUsage.cc:1946)
==688== by 0x12A1B3: main (SignalProcessing.C:76)
==688== Address 0x107403df is 1 bytes before a block of size 32 alloc'd
==688== at 0x483E217: operator new[](unsigned long) (vg_replace_malloc.c:640)
==688== by 0x4A53C29: TString::Init(int, int) (in /home/marcomeyer/Software/root/6.26.04/lib/libCore.so)
==688== by 0x4A53D57: TString::TString(char const*) (in /home/marcomeyer/Software/root/6.26.04/lib/libCore.so)
==688== by 0x5511F89: UIUC::TFileReader::ExpandWildcardUrl(TString, char const*) (TFileReader.cc:1039)
==688== by 0x551150E: UIUC::TFileReader::ExpandWildcardUrl(std::vector<TString, std::allocator<TString> >, char const*) (TFileReader.cc:966)
==688== by 0x5510124: UIUC::TFileReader::ExpandTextFile(std::vector<TString, std::allocator<TString> >, char const*, int) (TFileReader.cc:861)
==688== by 0x550F231: UIUC::TFileReader::ExpandWildcard(TString, char const*, int) (TFileReader.cc:802)
==688== by 0x55084AE: UIUC::TFileReader::Add(TString) (TFileReader.cc:222)
==688== by 0x55078DD: UIUC::TFileReader::Init(TString) (TFileReader.cc:181)
==688== by 0x54ADC15: UIUC::HandboxUsage::AddArgument(UIUC::TFileReader*, TString, bool) (HandboxUsage.cc:1946)
==688== by 0x12A1B3: main (SignalProcessing.C:76)
==688==
The code responsible for this is the following:
https://gitlab.cern.ch/escalade/lib/UIUC/-/blob/master/src/TFileReader.cc#L1039
Cheers,
Marco
ROOT Version. v.6.26/04