Graphics not working

Hi,
I have recently built root, and the interpreter is working fine, meaning I can do simple calculations and run scripts that doesn’t require drawing graphs or fitting histogram.

When I try running a demo, graph.C for example, it crashes. I have the ‘graph.C’ file where I have set up my root in macros file.

root [1] .x graph.C

*** Break *** segmentation violation

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

Thread 1 (process 93326):
#0 0x00007fff866dbf6c in wait4 ()
#1 0x00007fff866f0526 in system ()
#2 0x000000010013080c in TUnixSystem::StackTrace ()
#3 0x000000010012de11 in TUnixSystem::DispatchSignals ()
#4
#5 0x0000000103bf5d53 in _XReply ()
#6 0x0000000103bdce99 in XAllocColor ()
#7 0x0000000103e283d3 in find_useable_visual ()
#8 0x0000000103e28aa2 in query_screen_visual_id ()
#9 0x0000000103e2a2bb in create_asvisual_for_id ()
#10 0x0000000103db3b02 in TASImage::InitVisual ()
#11 0x0000000103dbe063 in TASImage::ReadImage ()
#12 0x0000000102e83c43 in TImage::Open ()
#13 0x0000000103443784 in TGPicturePool::GetPicture ()
#14 0x000000010350fadd in TGHScrollBar::TGHScrollBar ()
#15 0x000000010347ea82 in TGCanvas::TGCanvas ()
#16 0x000000010356d14b in TRootCanvas::CreateCanvas ()
#17 0x000000010356d8da in TRootCanvas::TRootCanvas ()
#18 0x0000000103576ee7 in TRootGuiFactory::CreateCanvasImp ()
#19 0x0000000103065846 in TCanvas::Constructor ()
#20 0x00000001030660a7 in TCanvas::TCanvas ()
#21 0x00000001030d71e5 in G__G__GPad_168_0_13 ()
#22 0x00000001008ecc16 in Cint::G__ExceptionWrapper ()
#23 0x00000001009af41c in G__execute_call ()
#24 0x00000001009b197b in G__call_cppfunc ()
#25 0x0000000100985095 in G__interpret_func ()
#26 0x0000000100974070 in G__getfunction ()
#27 0x00000001009a617e in G__new_operator ()
#28 0x000000010094f2c6 in G__getexpr ()
#29 0x0000000100937bd6 in G__define_var ()
#30 0x00000001009da987 in G__exec_statement ()
#31 0x0000000100987f2f in G__interpret_func ()
#32 0x00000001009741e8 in G__getfunction ()
#33 0x0000000100945b22 in G__getitem ()
#34 0x000000010094a13f in G__getexpr ()
#35 0x0000000100957b05 in G__calc_internal ()
#36 0x00000001009ea70f in G__process_cmd ()
#37 0x000000010002d02e in TCint::ProcessLine ()
#38 0x00000001000fd133 in TCint::ProcessLineSynch ()
#39 0x0000000100079f8a in TApplication::ExecuteFile ()
#40 0x0000000100077691 in TApplication::ProcessLine ()
#41 0x000000010103fb5c in TRint::HandleTermInput ()
#42 0x000000010103e407 in TTermInputHandler::Notify ()
#43 0x00000001010406ed in TTermInputHandler::ReadNotify ()
#44 0x000000010012d1f2 in TUnixSystem::CheckDescriptors ()
#45 0x000000010012d826 in TUnixSystem::DispatchOneEvent ()
#46 0x00000001000bcebd in TSystem::InnerLoop ()
#47 0x00000001000bf183 in TSystem::Run ()
#48 0x0000000100075cd7 in TApplication::Run ()
#49 0x00000001010402e8 in TRint::Run ()
#50 0x0000000100000990 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.

#5 0x0000000103bf5d53 in _XReply ()
#6 0x0000000103bdce99 in XAllocColor ()
#7 0x0000000103e283d3 in find_useable_visual ()
#8 0x0000000103e28aa2 in query_screen_visual_id ()
#9 0x0000000103e2a2bb in create_asvisual_for_id ()
#10 0x0000000103db3b02 in TASImage::InitVisual ()
#11 0x0000000103dbe063 in TASImage::ReadImage ()
#12 0x0000000102e83c43 in TImage::Open ()
#13 0x0000000103443784 in TGPicturePool::GetPicture ()
#14 0x000000010350fadd in TGHScrollBar::TGHScrollBar ()
#15 0x000000010347ea82 in TGCanvas::TGCanvas ()
#16 0x000000010356d14b in TRootCanvas::CreateCanvas ()
#17 0x000000010356d8da in TRootCanvas::TRootCanvas ()
#18 0x0000000103576ee7 in TRootGuiFactory::CreateCanvasImp ()
#19 0x0000000103065846 in TCanvas::Constructor ()
#20 0x00000001030660a7 in TCanvas::TCanvas ()

Root > Function graph() busy flag cleared

While graph.C isn’t working, this code I found online works perfectly fine, which leads me to the conclusion that there is a problem with compiler.

I am working on Mac OS 10.6.7, x-code 3.2, xquartz 2.3.6

[code]Double_t mult(Double_t a, Double_t b = 2) {
// multiply a and b
return a*b;
}

Double_t mult() {
// prompt for two numbers and return the product
Double_t a, b;
cout << “enter a number:”; // output prompt string
cin >> a; // read input
cout << “enter a second number:”; // output prompt
cin >> b; // read input
return ab; // return ab
}[/code]

see: Draw() crash on MacOSX

thanks that post is really helpful