Problem using TGraphErrors created by other version of ROOT

Hi,

I have a big root file created by root 5.34
Trying to plot a TGaphErrors from this file using 6.09/01 (compiled from git)
the canvas with graph is dispalyed but I get this error message:

root [2] gain_25_44->Draw()
Error in TClingCallFunc::make_wrapper: Failed to compile
==== SOURCE BEGIN ====
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-security"
attribute((used)) extern “C” void __cf_0(void* obj, int nargs, void** args, void* ret)
{
if (ret) {
new (ret) (double) (TFormula____id3745227758458394687((double**)args[0], (double*)args[1]));
return;
}
else {
TFormula____id3745227758458394687(
(double**)args[0], (double*)args[1]);
return;
}
}
#pragma clang diagnostic pop
==== SOURCE END ====
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f30620c648a in __GI___waitpid (pid=6617, stat_loc=stat_loc
entry=0x7ffc65940200, options=options
entry=0) at …/sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x00007f306203f2fb in do_system (line=) at …/sysdeps/posix/system.c:148
#2 0x00007f3062c350a9 in TUnixSystem::Exec (shellcmd=, this=0x561f70f6c4f0) at /home/produit/root/core/unix/src/TUnixSystem.cxx:2116
#3 TUnixSystem::StackTrace (this=0x561f70f6c4f0) at /home/produit/root/core/unix/src/TUnixSystem.cxx:2403
#4 0x00007f3062c37a5c in TUnixSystem::DispatchSignals (this=0x561f70f6c4f0, sig=kSigSegmentationViolation) at /home/produit/root/core/unix/src/TUnixSystem.cxx:3661
#5
#6 0x0000000000000000 in ?? ()
#7 0x00007f3055fa5b2f in TFormula::DoEval (this=0x561f7350f750, x=, params=) at /home/produit/root/hist/hist/src/TFormula.cxx:2652
#8 0x00007f3055fa5ce5 in TFormula::EvalPar (this=, x=, params=) at /home/produit/root/hist/hist/src/TFormula.cxx:2561
#9 0x00007f3055f7b76f in TF1::EvalPar (this=0x561f7232da40, x=, params=) at /home/produit/root/hist/hist/src/TF1.cxx:1230
#10 0x00007f3055f82d83 in TF1::DoCreateHistogram (this=0x561f7232da40, xmin=, xmax=, recreate=) at /home/produit/root/hist/hist/src/TF1.cxx:2829
#11 0x00007f3055f82478 in TF1::Paint (this=0x561f7232da40, option=0x7f305202e9bc “lsame”) at /home/produit/root/hist/hist/src/TF1.cxx:2706
#12 0x00007f3051fdb5a0 in TGraphPainter::PaintGraphSimple (this=this
entry=0x561f736d8010, theGraph=theGraph
entry=0x561f7230eeb0, option=option
entry=0x561f736b6169 “alp”) at /home/produit/root/hist/histpainter/src/TGraphPainter.cxx:3140
#13 0x00007f3051fe7ba3 in TGraphPainter::PaintGraphErrors (this=0x561f736d8010, theGraph=0x561f7230eeb0, option=0x561f736b6169 “alp”) at /home/produit/root/hist/histpainter/src/TGraphPainter.cxx:2556
#14 0x00007f30554e7b1b in TPad::PaintModified (this=0x561f71d6aa30) at /home/produit/root/graf2d/gpad/src/TPad.cxx:3213
#15 0x00007f30554aff95 in TCanvas::Update (this=0x561f71d6aa30) at /home/produit/root/graf2d/gpad/src/TCanvas.cxx:2219
#16 0x00007f305e68b129 in TCling::UpdateAllCanvases () at /home/produit/root/core/meta/src/TCling.cxx:5754
#17 0x00007f305e6918a4 in TCling::ProcessLine (this=0x561f70fc6910, line=, error=0x0) at /home/produit/root/core/meta/src/TCling.cxx:1921
#18 0x00007f305e684537 in TCling::ProcessLineSynch (this=0x561f70fc6910, line=0x7f30601422f8 “TRint::EndOfLineAction();”, error=0x0) at /home/produit/root/core/meta/src/TCling.cxx:2867
#19 0x00007f3062f7a8d5 in TRint::HandleTermInput (this=0x561f70fb7e80) at /home/produit/root/core/rint/src/TRint.cxx:645
#20 0x00007f3062c36f1d in TUnixSystem::CheckDescriptors (this=this
entry=0x561f70f6c4f0) at /home/produit/root/core/unix/src/TUnixSystem.cxx:1321
#21 0x00007f3062c3836b in TUnixSystem::DispatchOneEvent (this=0x561f70f6c4f0, pendingOnly=) at /home/produit/root/core/unix/src/TUnixSystem.cxx:1076
#22 0x00007f3062b81374 in TSystem::InnerLoop (this=0x561f70f6c4f0) at /home/produit/root/core/base/src/TSystem.cxx:408
#23 0x00007f3062b7fecf in TSystem::Run (this=0x561f70f6c4f0) at /home/produit/root/core/base/src/TSystem.cxx:358
#24 0x00007f3062b2048f in TApplication::Run (this=this
entry=0x561f70fb7e80, retrn=retrn
entry=false) at /home/produit/root/core/base/src/TApplication.cxx:1153
#25 0x00007f3062f7be3e in TRint::Run (this=0x561f70fb7e80, retrn=) at /home/produit/root/core/rint/src/TRint.cxx:463
#26 0x0000561f6ed6527c in main (argc=, argv=0x7ffc65945988) at /home/produit/root/main/src/rmain.cxx:30

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
report at root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#6 0x0000000000000000 in ?? ()
#7 0x00007f3055fa5b2f in TFormula::DoEval (this=0x561f7350f750, x=, params=) at /home/produit/root/hist/hist/src/TFormula.cxx:2652
#8 0x00007f3055fa5ce5 in TFormula::EvalPar (this=, x=, params=) at /home/produit/root/hist/hist/src/TFormula.cxx:2561
#9 0x00007f3055f7b76f in TF1::EvalPar (this=0x561f7232da40, x=, params=) at /home/produit/root/hist/hist/src/TF1.cxx:1230
#10 0x00007f3055f82d83 in TF1::DoCreateHistogram (this=0x561f7232da40, xmin=, xmax=, recreate=) at /home/produit/root/hist/hist/src/TF1.cxx:2829
#11 0x00007f3055f82478 in TF1::Paint (this=0x561f7232da40, option=0x7f305202e9bc “lsame”) at /home/produit/root/hist/hist/src/TF1.cxx:2706
#12 0x00007f3051fdb5a0 in TGraphPainter::PaintGraphSimple (this=this
entry=0x561f736d8010, theGraph=theGraph
entry=0x561f7230eeb0, option=option
entry=0x561f736b6169 “alp”) at /home/produit/root/hist/histpainter/src/TGraphPainter.cxx:3140
#13 0x00007f3051fe7ba3 in TGraphPainter::PaintGraphErrors (this=0x561f736d8010, theGraph=0x561f7230eeb0, option=0x561f736b6169 “alp”) at /home/produit/root/hist/histpainter/src/TGraphPainter.cxx:2556
#14 0x00007f30554e7b1b in TPad::PaintModified (this=0x561f71d6aa30) at /home/produit/root/graf2d/gpad/src/TPad.cxx:3213
#15 0x00007f30554aff95 in TCanvas::Update (this=0x561f71d6aa30) at /home/produit/root/graf2d/gpad/src/TCanvas.cxx:2219
#16 0x00007f305e68b129 in TCling::UpdateAllCanvases () at /home/produit/root/core/meta/src/TCling.cxx:5754

Root >

Hi Nicolas,

I think this is a known problem. You should explicitly retrieve the TGraphError from the file using
TFile::Get(name), instead of retrieving it automatically by its name

Best Regards

Lorenzo

Hi,
I see. In fact it aslo make a problem with a TGraphError created by same version of ROOT:
I see in fact it is only when retrieving by name and not if I done properly.

But if it is a known bug, it will be corrected soon?

Cheers

Hi,

This fix is not easy and we don’t have yet a timescale for it.

Best Regards

Lorenzo

You should open a JIRA ticket in order to keep track of this bug.

I tried to reproduce you problem using a TGraph but it seems of. I am missing something surely.

$ root
   ----------------------------------------------------------------
  | Welcome to ROOT 6.09/01                    http://root.cern.ch |
  |                                   (c) 1995-2016, The ROOT Team |
  | Built for macosx64                                             |
  | From heads/master@v6-09-01-261-ge024758, Nov 01 2016, 10:40:45 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'     |
   ----------------------------------------------------------------

root [0] TGraph *g=new TGraph()
(TGraph *) 0x7fca11ed4ef0
root [1] g->SetName("g")
root [2] TFile *f = new TFile("f.root", "RECREATE"); 
root [3] g->Write()
(Int_t) 158
root [4] f->ls()
TFile**		f.root	
 TFile*		f.root	
  KEY: TGraph	g;1	
root [5] .q
IMACCOUET:Downloads couet$ root
   ----------------------------------------------------------------
  | Welcome to ROOT 6.09/01                    http://root.cern.ch |
  |                                   (c) 1995-2016, The ROOT Team |
  | Built for macosx64                                             |
  | From heads/master@v6-09-01-261-ge024758, Nov 01 2016, 10:40:45 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'     |
   ----------------------------------------------------------------

root [0] TFile *f = new TFile("f.root"); 
root [1] g->Draw()
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
Error in <TGraphPainter::PaintGraph>: illegal number of points (0)
root [2] 

HI,

The problem is in TFormula, and you will see when reading a TGraph or TH1 containing a fitted function based on a formula expression

Lorenzo

Hi,

For the record, this is sft.its.cern.ch/jira/browse/ROOT-7512

Axel.