I have a rather complicated gui based macro. Here’s the skeleton
[code]class myClass{
TCanvas *c;
};
void myClass::ifClicked(TH1D h){
// TFile blah blah here
h = (TH1D)file->Get(“histName”);
this->h->Draw(“same”);
this->c->Modified();
this->c->Update();
}
constructor {
this->c = new TCanvas(//params);
}
[/code]
I tried initializing the canvas object in the ifClicked method, it works, but well it keeps updating everytime, I just want the histograms to update. I tried with dummy histograms and it works, but only when the canvas is initialized in the method.
I have been scratching my head for quite some time trying to figure out why I get an error like this, only when the canvas is initialized in the constructor.
[color=#BF0000] *** Break *** segmentation violation
===========================================================
There was a crash (#7 0xb75d40c8 in SigHandler(ESignals) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so).
This is the entire stack trace of all threads:
#0 0xb7722d40 in __kernel_vsyscall ()
#1 0xb7125ab3 in __waitpid_nocancel () at …/sysdeps/unix/syscall-template.S:81
#2 0xb70ad02e in do_system (line=line
entry=0xbab0f48 “/home/catsFlying/Packages/root-6.04.04/etc/gdb-backtrace.sh 26375 1>&2”) at …/sysdeps/posix/system.c:148
#3 0xb70ad400 in __libc_system (line=line
entry=0xbab0f48 “/home/catsFlying/Packages/root-6.04.04/etc/gdb-backtrace.sh 26375 1>&2”) at …/sysdeps/posix/system.c:184
#4 0xb722abdb in system (line=0xbab0f48 “/home/catsFlying/Packages/root-6.04.04/etc/gdb-backtrace.sh 26375 1>&2”) at pt-system.c:28
#5 0xb75d1c84 in TUnixSystem::StackTrace() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#6 0xb75d3f6b in TUnixSystem::DispatchSignals(ESignals) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#7 0xb75d40c8 in SigHandler(ESignals) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#8 0xb75ce2d3 in sighandler(int) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#9 0xb7600606 in textinput::TerminalConfigUnix::HandleSignal(int) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#10 0xb7600651 in (anonymous namespace)::TerminalConfigUnix__handleSignal(int) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#11
#12 0xb735f74e in ?? ()
#13 0xb735f573 in ?? ()
#14 0xaefe402a in ?? ()
#15 0xb4c43b6c in TClingCallFunc::exec(void*, void*) const () from /home/catsFlying/Packages/root-6.04.04/lib/libCling.so
#16 0xb4c5066f in TClingCallFunc::Exec(void*, TInterpreterValue*) () from /home/catsFlying/Packages/root-6.04.04/lib/libCling.so
#17 0xb4c018ae in TCling::CallFunc_Exec(CallFunc_t*, void*) const () from /home/catsFlying/Packages/root-6.04.04/lib/libCling.so
#18 0xb75225cc in TQConnection::ExecuteMethod() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#19 0xb755ab48 in TQObject::Emit(char const*) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#20 0xaeb9a192 in TGCheckButton::HandleButton(Event_t*) () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#21 0xaebf00dc in TGFrame::HandleEvent(Event_t*) () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#22 0xaecb09dd in TGClient::HandleEvent(Event_t*) () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#23 0xaecb0cfa in TGClient::ProcessOneEvent() () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#24 0xaecb0d5e in TGClient::HandleInput() () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#25 0xaecb0d8b in TGInputHandler::Notify() () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#26 0xb75d4818 in TUnixSystem::DispatchOneEvent(bool) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#27 0xb7539e38 in TSystem::InnerLoop() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#28 0xb7537a0d in TSystem::Run() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#29 0xb755f880 in TApplication::Run(bool) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#30 0xb73816d4 in TRint::Run(bool) () from /home/catsFlying/Packages/root-6.04.04/lib/libRint.so
#31 0x08048cec in main ()
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug 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.
#12 0xb735f74e in ?? ()
#13 0xb735f573 in ?? ()
#14 0xaefe402a in ?? ()
#15 0xb4c43b6c in TClingCallFunc::exec(void*, void*) const () from /home/catsFlying/Packages/root-6.04.04/lib/libCling.so
#16 0xb4c5066f in TClingCallFunc::Exec(void*, TInterpreterValue*) () from /home/catsFlying/Packages/root-6.04.04/lib/libCling.so
#17 0xb4c018ae in TCling::CallFunc_Exec(CallFunc_t*, void*) const () from /home/catsFlying/Packages/root-6.04.04/lib/libCling.so
#18 0xb75225cc in TQConnection::ExecuteMethod() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#19 0xb755ab48 in TQObject::Emit(char const*) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#20 0xaeb9a192 in TGCheckButton::HandleButton(Event_t*) () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#21 0xaebf00dc in TGFrame::HandleEvent(Event_t*) () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#22 0xaecb09dd in TGClient::HandleEvent(Event_t*) () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#23 0xaecb0cfa in TGClient::ProcessOneEvent() () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#24 0xaecb0d5e in TGClient::HandleInput() () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#25 0xaecb0d8b in TGInputHandler::Notify() () from /home/catsFlying/Packages/root-6.04.04/lib/libGui.so
#26 0xb75d4818 in TUnixSystem::DispatchOneEvent(bool) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#27 0xb7539e38 in TSystem::InnerLoop() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#28 0xb7537a0d in TSystem::Run() () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#29 0xb755f880 in TApplication::Run(bool) () from /home/catsFlying/Packages/root-6.04.04/lib/libCore.so
#30 0xb73816d4 in TRint::Run(bool) () from /home/catsFlying/Packages/root-6.04.04/lib/libRint.so
#31 0x08048cec in main ()
[/color]