I am encountering a very strange segmentation fault and would be very grateful for all hints where the problem might be or how to resolve it. It could also be a bug, but i would like to post my problem in the forum first, maybe there is just a simple mistake.
In the file test.C I define this class
class testclass
{
public:
TH1D* hist;
};
I can now load the file and use the class, for example like this
.L test.C
testclass t;
t.hist = new TH1D("hist","Test",100,-5.0,5.0);
t.hist->FillRandom("gaus",5000);
I can further access and modify the histogram t.hist, but when I wish to draw it, a crash occures
t.hist->Draw();
Leading to:
*** Break *** segmentation violation
===========================================================
There was a crash (#7 0x0109561b in SigHandler(ESignals) () from /usr/local/lib/root/libCore.so).
This is the entire stack trace of all threads:
and a following stack trace. This is strange, because it does not happen when I define the class on the command line. The crash happens after the function gPad->Modified() is called, but i was unable to determine which slots are activated by this signal.
Do you have an Idea how to resolve this problem? Or how to find out which slots are activated by the “Modified()” signal?
I am encountering a very strange segmentation fault and would be very grateful for all hints where the problem might be or how to resolve it. It could also be a bug
[/code]
Jules[/quote]
It’s a bug.
I did simply this:
[quote]root[0] .L testclass.C
root[1] testclass t;
root[2] TProfile::Class() //that’s what is called from THistPainter::PaintStats
[/quote]
And got the same segmentation violation inside TDataMember.
And got the same segmentation violation inside TDataMember.[/quote]
Thank you very much. I could also reproduce the crash following your steps and will report it as a bug. I encountered this bug both on my desktop computer (linux x86-64 gcc 4.5.2) and my laptop (linux i386).
Knowing this, I found two ways to work around this bug:
[ul]
[li] Call TProfile::Class() before loading the file[/li]
[li] Or disable the stats via t.hist->SetStats(kFALSE)[/li][/ul]