Switch to CentOS7 6.18.04 from SL6 6.14.04 Causing Segmentation Violation Problem in TMVA::ROCCalc

Hi,

I recently try to switch to CentOS7 and ROOT 6.18.04 from current setup of SL6 with 6.14.04. When I try CentOS7 with 6.14.08 it works as well. But when I tried to run my code (which runs succesfully in old setup) with recommended 6.18.04 setup I am getting a Break Segmentation Violation for the line where I initiate a TMVA::ROCCalc object:

====================================
TH1D* MVA_BDT_odd_Train_S  = (TH1D*)outputFile->Get(base_path+"MVA_BDT_odd_Train_S");
TH1D* MVA_BDT_odd_Train_B  = (TH1D*)outputFile->Get(base_path+"MVA_BDT_odd_Train_B");
    cout << "TEST A"  << endl;
TMVA::ROCCalc *roc_odd_train = new TMVA::ROCCalc(MVA_BDT_odd_Train_S,MVA_BDT_odd_Train_B);
    cout << "TEST b"  << endl;
====================================

The error stack is as follows:

TEST A

 *** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00002b61aabbf41c in waitpid () from /lib64/libc.so.6
#1  0x00002b61aab3cf12 in do_system () from /lib64/libc.so.6
#2  0x00002b61a5a11533 in TUnixSystem::StackTrace() () from /cvmfs/sft.cern.ch/lcg/releases/LCG_96b/ROOT/6.18.04/x86_64-centos7-gcc8-opt/lib/libCore.so
#3  0x00002b61a5a13d84 in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_96b/ROOT/6.18.04/x86_64-centos7-gcc8-opt/lib/libCore.so
#4  <signal handler called>
#5  0x00002b61a9c560c8 in TMVA::ROCCalc::ROCCalc(TH1*, TH1*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_96b/ROOT/6.18.04/x86_64-centos7-gcc8-opt/lib/libTMVA.so
#6  0x000000000040f4f9 in BDT::training(int, int, int, int, int, int, int) ()
#7  0x000000000040a57a in BDTTraining(int&, int&, int&, int&, int&, int&, int&) ()
#8  0x000000000040a296 in main ()
===========================================================
===========================================================
#5  0x00002b61a9c560c8 in TMVA::ROCCalc::ROCCalc(TH1*, TH1*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_96b/ROOT/6.18.04/x86_64-centos7-gcc8-opt/lib/libTMVA.so
#6  0x000000000040f4f9 in BDT::training(int, int, int, int, int, int, int) ()
#7  0x000000000040a57a in BDTTraining(int&, int&, int&, int&, int&, int&, int&) ()
#8  0x000000000040a296 in main ()
===========================================================

When switching between setups I do make clean and make sure I am using the correct lsetup commands. I am running on the local cluster with interactive condor jobs. Does anyone have any idea what the problem might be?

Thanks in advance!

Ogul

Hi,

I think there is a problem retrieving the signal and background score histograms from the file.
Are you sure that the histograms MVA_BDT_odd_Train_S and TH1D* MVA_BDT_odd_Train_B are present in base_path. It is possible that somewhere the location of the histogram directory has changed between the versions

Lorenzo

1 Like

Hi Lorenzo,

Thank you for the reply. This indeed is a good suggestion for a check. However, the base_path addresses seem to be the same in both cases:

TString base_path      = "/default/Method_BDT_odd/BDT_odd/";
TString base_path_even = "/default/Method_BDT_even/BDT_even/";

TH1D* MVA_BDT_odd_Train_S  = (TH1D*)outputFile->Get(base_path+"MVA_BDT_odd_Train_S");
TH1D* MVA_BDT_odd_Train_B  = (TH1D*)outputFile->Get(base_path+"MVA_BDT_odd_Train_B");
    cout << "TEST A"  << endl;
TMVA::ROCCalc *roc_odd_train = new TMVA::ROCCalc(MVA_BDT_odd_Train_S,MVA_BDT_odd_Train_B);
    cout << "TEST b"  << endl;

I am not really sure why it is crushing there.

Hi,

I have found an Issue with the ROCCalc class and I have made a PR, see

I am not sure however this fixes your problem, since the bug I found was in the destructor.
It would be great if you can upload your file and your macro, so I can reproduce this issue

Lorenzo

Hi Lorenzo,

Here is a simple macro that reproduces the problem:
roctest.cxx (1.5 KB)

It reads the TMVA output root file from my afs public folder, to which you can access I guess?

Ogul

Hi,

Thank you for posting your macro. Your base path seems to be wrong and therefore the histograms pointer are null. It is always a good practise to check the return object after TFile::Get, since no error message is printed.

The correct path to use is

TString base_path      = "/default/Method_BDT/BDT_odd/";

Lorenzo

Hi Lorenzo,

Thank you for the correct reply. Interestingly,

Method_BDT_odd

is still working in this certain version I described on the above posts. But it is

Method_BDT

for the same setup when ran on LXPLUS instead of local cluster, as well as in the 6.18.04 in both machines.

Thank you once again.

Cheers,

Ogul