Cling failed to compile on simple command

Dear all,

I am trying to use Draw() on a histogram saved in a root file but each time I get the error message listed below.

I doubt that the problem comes from the file because I’m able to draw the same histogram using a TBrowser.
I have also been able to draw the histogram in the way shown below but it happened only once and I could not reproduce the circumstances.

Has anyone any clue about solving this issue?

ROOT 6.06/00
Built for macosx64
OS X 10.10.5

Here is the error stack with the commands I sent

root [0] TFile *_file0 = TFile::Open("some_file.root")
(TFile *) 0x7feadac84600
root [1]
root [1]
root [1] h_x_22->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____id12661824131378241578(*(double**)args[0], *(double**)args[1]));
      return;
   }
   else {
      TFormula____id12661824131378241578(*(double**)args[0], *(double**)args[1]);
      return;
   }
}
#pragma clang diagnostic pop
  ==== SOURCE END ====
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_1(void* obj, int nargs, void** args, void* ret)
{
   if (ret) {
      new (ret) (double) (TFormula____id6344818496209118899(*(double**)args[0], *(double**)args[1]));
      return;
   }
   else {
      TFormula____id6344818496209118899(*(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
 Generating stack trace...
 0x0000000123521f15 in THistPainter::PaintInit() (in libHistPainter.so) + 1493
 0x0000000123517583 in THistPainter::Paint(char const*) (in libHistPainter.so) + 1059
 0x000000011fc25a2d in TPad::PaintModified() (in libGpad.so) + 749
 0x000000011fc0b2a9 in TCanvas::Update() (in libGpad.so) + 345
 0x000000010f479e64 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCling.so) + 372
 0x000000010f47db69 in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in libCling.so) + 121
 0x000000010f3e8799 in TRint::HandleTermInput() (in libRint.so) + 777
 0x000000010f1958f8 in TUnixSystem::CheckDescriptors() (in libCore.so) + 328
 0x000000010f19e6ed in TMacOSXSystem::DispatchOneEvent(bool) (in libCore.so) + 429
 0x000000010f11423a in TSystem::InnerLoop() (in libCore.so) + 26
 0x000000010f11408b in TSystem::Run() (in libCore.so) + 203
 0x000000010f0b11d4 in TApplication::Run(bool) (in libCore.so) + 36
 0x000000010f3e7a9c in TRint::Run(bool) (in libRint.so) + 1372
 0x000000010f039e8f in main (in root.exe) + 79
 0x00007fff914345c9 in start (in libdyld.dylib) + 1
 0x0000000000000003 in <unknown function>

Hi,

could you check if you see the same error when reading explicitly the histogram out of the ROOT file?

TH1F* h = nullptr;
_file0->GetObject("h_x_22",h);
h->Draw();

Could you share the file?

Cheers,
Danilo

Hi!
Thanks for your answer, the command you gave me works.

Unfortunately I cannot give you the file. Although, this file and few others that give the same error have been produced using ROOT 5.34/14. Might it be related?

Hi,

I am not sure. Can you maybe produce an analogous file with a randomised histogram which reproduces the issue? Have those histograms been fit and the function persisted?

Danilo

Hello,

Sorry for the late answer. Indeed, it seems to be linked to the fitting of a function.
I’ve attached two root file. They are both a random gaussian but in one of them there is a fit too.
The one without fit works fine while the fitted one crashes if I do a simple “h1->Draw()” but works fine when calling it explicitly.

Here’s the error stack:

[code]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____id18130473110346259110((double**)args[0], (double*)args[1]));
return;
}
else {
TFormula____id18130473110346259110(
(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
Generating stack trace…
0x0000000121128f15 in THistPainter::PaintInit() (in libHistPainter.so) + 1493
0x000000012111e583 in THistPainter::Paint(char const*) (in libHistPainter.so) + 1059
0x000000011d6dda2d in TPad::PaintModified() (in libGpad.so) + 749
0x000000011d6c32a9 in TCanvas::Update() (in libGpad.so) + 345
0x000000010d279e64 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCling.so) + 372
0x000000010d27db69 in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in libCling.so) + 121
0x000000010d1e8799 in TRint::HandleTermInput() (in libRint.so) + 777
0x000000010cf968f8 in TUnixSystem::CheckDescriptors() (in libCore.so) + 328
0x000000010cf9f6ed in TMacOSXSystem::DispatchOneEvent(bool) (in libCore.so) + 429
0x000000010cf1523a in TSystem::InnerLoop() (in libCore.so) + 26
0x000000010cf1508b in TSystem::Run() (in libCore.so) + 203
0x000000010ceb21d4 in TApplication::Run(bool) (in libCore.so) + 36
0x000000010d1e7a9c in TRint::Run(bool) (in libRint.so) + 1372
0x000000010ce3be8f in main (in root.exe) + 79
0x00007fff914345c9 in start (in libdyld.dylib) + 1
0x0000000000000004 in
[/code]
htestfit.root (7.53 KB)
htest.root (3.7 KB)

Hi,

thanks for the file, I can reproduce the issue.
While you can proceed working with explicit reading the histogram from the files, the right people are informed. We’ll keep you posted.

Cheers,
Danilo

Has this issue been solved? I have same issue on my ROOT6 installation while not have the issue in ROOT5.

yes it works:

root [0] TFile *_file0 = TFile::Open("hsimple.root")
(TFile *) 0x7fbbf779e180
root [1] hpx->Draw()
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [2]