Issue with running event loop in MakeClass

_ROOT Version: 6.20/06 tags/v6-20-06@v6-20-06
or Version: 6.12/07 tag , 9 February 2018 CMS environment
Platform: AMD Opteron™ Processor 6176, CentOS 7.8.2003, 4.4.224-1.el7.elrepo.x86_64
Compiler: linuxx8664gcc

I’m running a long script built using the MakeClass interface. The Event loop is around 1500 lines of code analyzing a mostly flat event based ntuple. I find that when I add code, say a new distribution to histogram adding around 100 lines of code, that the script still compiles, I can instantiate the class which loads all the chained ntuple files (9000 of them with 27 million events) but then on the entering the event loop the program exits to the command line with no output or errors. A cout with an additional flush command placed on the first few lines of the event loop is not executed before the program exits. If I remove, by commenting out, the lines the program works again. If I swap my new lines for the code for another distribution that I am plotting, by commenting out the other lines so the that program does not get any larger, then it still works. If I use different root versions the maximum amount of code I can use is a little different. The older version allows the program to be a little longer. Hopefully, this is a simple problem addressed by some internal memory setting or something like that but I could not find any similar problem searching root forums using google.

Note the same problem occurs even it I limit the number of files read to just a few with only a few thousand events.

If necessary I could provide the code and an ntuple if there is a good place I could put them.

  • thanks - Matt Herndon

@Axel or @pcanal can you think of what could be going on here?

Usually this kind of behavior is indicative of a memory usage problem (for example out-of-bound memory read or write; usage of already delete memory; etc).

To debug the issue I would recommend to

a) compile the code (via ACliC for example)

If you are lucky the compiler may point out an obvious problem.

b) run the failing example with the compiled code via valgrind (for example: valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp root.exe -b -l -q scriptName.C+ ; note you need to use root.exe)

And in most case valgrind will be able to detect the error.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.