Object names containing underscores lead to segfault?


I have come across a very strange behaviour this afternoon.

I was trying to read histograms from a root file with statements like.

I am doing this in a macro which I compile with .L macro.C+. It compiles without errors. As soon as I want access certain histograms in my macro, even with a simple ->Print(), I get a segmentation fault:

*** Break *** segmentation violation Attaching to program: /proc/20335/exe, process 20335 [Thread debugging using libthread_db enabled] [New Thread 0xb70b16c0 (LWP 20335)] 0xb7f36410 in __kernel_vsyscall () error detected on stdin The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]

Exactly the same code works if I run it interactively in CINT without compiling. It seems to me that only histograms with underscores in their name are affected!

I use ROOT version 5.18/00 on a linux machine. Is this a known bug?

Thanks for your time,


underscores in names cannot be a problem.
Could you post the shortest possible RUNNING script reproducing your problem?


I am really puzzled by now.
First things I did today: check again, it crashed like yesterday.
I recreated the input file with a different name containing the same histograms and it runs !
changing back to the old file (UNDO in emacs!!) runs as well!!!
(Do you have any idea?)

anyways, this is what happened before:
In the old file the histograms that make my code crash existed as well… I could look at them in a TBrowser and Draw() them, and I could even do everything I do in the compiled macro in CINT command line without any problems.

Here is the code:

[code]void runOnFile(TString filename = “data_eff_plots.root”) {

// some stuff …

TFile* infile = new TFile(filename);

std::vector<TProfile2D*> efflist;
std::vector<TH2D*> occlist;

TString bla = “eff_vs_slayer”;

TH1D* eff_vs_slay = (TH1D*)infile->Get(bla);
TH1D* occ_vs_slay = (TH1D*)infile->Get(“occ_vs_slayer”);
TH1D* occ_dist = (TH1D*)infile->Get(“occ_dist61”);
TH1D* dis_hot = (TH1D*)infile->Get(“dishot”);
TH1D* ntrthits60 = (TH1D*)infile->Get(“ntrthits60”);

TProfile2D* hiteffpercell60 = (TProfile2D*)infile->Get(“hiteffpercell60”);
TProfile2D* hiteffpercell61 = (TProfile2D*)infile->Get(“hiteffpercell61”);
TProfile2D* hiteffpercell62 = (TProfile2D*)infile->Get(“hiteffpercell62”);
TProfile2D* hiteffpercell70 = (TProfile2D*)infile->Get(“hiteffpercell70”);
TProfile2D* hiteffpercell71 = (TProfile2D*)infile->Get(“hiteffpercell71”);
TProfile2D* hiteffpercell72 = (TProfile2D*)infile->Get(“hiteffpercell72”);

TH2D* occupancy60 = (TH2D*)infile->Get(“occupancy60”);
TH2D* occupancy61 = (TH2D*)infile->Get(“occupancy61”);
TH2D* occupancy62 = (TH2D*)infile->Get(“occupancy62”);
TH2D* occupancy70 = (TH2D*)infile->Get(“occupancy70”);
TH2D* occupancy71 = (TH2D*)infile->Get(“occupancy71”);
TH2D* occupancy72 = (TH2D*)infile->Get(“occupancy72”);

eff_vs_slay->Print(); //CRASHES
occ_vs_slay->Print(); //CRASHES
occupancy60->Print(); // RUNS
hiteffpercell60->Print(); // RUNS
dis_hot->Print(); // CRASHES
occ_dist->Print(); // CRASHES
ntrthits60->Print(); // RUNS

If I find out more about this and if I can reproduce it I will let you know…
I have no clue what happened, I spent hours yesterday. It’s not possible that there was a typo in the filename (root didn’t complain, I used simple undo in emacs).