Please help me!*** Break *** segmentation violation

_ROOT Version:6.14/00
_Platform: CentOS, 7.8.2003
Compiler: Not Provided
Hello all,The problem is when i open a .ROOT file a break segmentation violation appears.
I don’t know the causes because i’m beginner.
what should i do to resolve this problem ?
thanks!

this is my code


error information

Your rootlist doesn’t have a type or value; you need to provide a char* to TFile; i.e. rootlist has to be the name of the root file from which you want to get the TTree.

It is even surprising that this code compiles.

I’m so sorry,I got it wrong.

Try to add some “protections”:

// ...
TFile *f = ...
if ((!f) || f->IsZombie()) return 1;
TTree *t4 = ...
if (!t4) return 2;
// ...
TBranch *branch = ...
if (!branch) return 3;
// ...
2 Likes

Thank you. I’ll try it now

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