Hi. I have a macro that I’m using compiled using “.L macroName.cc++” and I’m encountering a strange crash at the end of running.
I’m using ROOT 5.22/00d, included with the CMSSW release I’m using.
The macro runs all the way to the end without issue, but when the last line of code is executed and the macro goes to exit, it sends an abort signal and exits with a stack trace.
I compiled the macro with debug symbols and generated a stack trace using GDB. It appears that the crash (actually a double free()) is occuring upon destruction of one of the TString objects I’ve allocated. Here’s the portion of the stack trace:
#0 0xffffe410 in __kernel_vsyscall ()
#1 0x00b6fdf0 in raise () from /lib/libc.so.6
#2 0x00b71701 in abort () from /lib/libc.so.6
#3 0x00ba828b in __libc_message () from /lib/libc.so.6
#4 0x00bb05a5 in _int_free () from /lib/libc.so.6
#5 0x00bb09e9 in free () from /lib/libc.so.6
#6 0xf6da5f41 in operator delete (ptr=0x0)
#7 0xf6da5f9d in operator delete (ptr=0x998d318)
#8 0xf7a0dedb in TString::~TString() ()
#9 0xf59c24c6 in plotCorrected_2d ()
I haven’t used dynamic memory allocation for the objects. I do something like:
TString theString = “the string content”
rather than using new.
Has anybody seen this sort of thing before? It seems like it’d be a reference counting problem with one of the strings, but I can’t for the life of me figure out which one it is.