Hello Olivier,
I tried gROOT->SetBatch(1) before sending the first post. But I got the following segmentation fault. This does not happen when I execute root with -b option. I prefer using gROOT->SetBatch(1) to using -b, because I will draw some other graphs in the same script after calling gROOT->SetBatch(0).
$ root
root [0] gROOT->SetBatch(1)
root [1] TFile f("can.root")
root [2] TCanvas* can = (TCanvas*)f.Get("can")
root [3] can->Draw()
- Break *** segmentation violation
There was a crash.
This is the entire stack trace of all threads:
Thread 1 (process 91637):
#0 0x00007fff83ce8b28 in wait4 ()
#1 0x00007fff83cfd0e6 in system ()
#2 0x000000010012083c in TUnixSystem::StackTrace ()
#3 0x000000010011d9e1 in TUnixSystem::DispatchSignals ()
#4 <signal handler called>
#5 0x0000000104025503 in asim_parse_argb_color ()
#6 0x0000000104070e03 in build_xpm_colormap ()
#7 0x0000000104053dfb in xpm_file2ASImage ()
#8 0x0000000104054087 in xpm2ASImage ()
#9 0x000000010405591c in file2ASImage_extra ()
#10 0x000000010400eaf2 in TASImage::ReadImage ()
#11 0x0000000102e13103 in TImage::Open ()
#12 0x00000001033d1414 in TGPicturePool::GetPicture ()
#13 0x000000010349c16d in TGHScrollBar::TGHScrollBar ()
#14 0x000000010340c632 in TGCanvas::TGCanvas ()
#15 0x00000001034f8a36 in TRootCanvas::CreateCanvas ()
#16 0x00000001034f91ca in TRootCanvas::TRootCanvas ()
#17 0x0000000103502667 in TRootGuiFactory::CreateCanvasImp ()
#18 0x0000000102fc38cc in TCanvas::Draw ()
#19 0x0000000100241739 in G__G__Base2_11_0_15 ()
#20 0x00000001008bd326 in Cint::G__ExceptionWrapper ()
#21 0x000000010098012c in G__execute_call ()
#22 0x000000010098194b in G__call_cppfunc ()
#23 0x0000000100955425 in G__interpret_func ()
#24 0x0000000100944420 in G__getfunction ()
#25 0x0000000100a3d722 in G__getstructmem ()
#26 0x0000000100a33922 in G__getvariable ()
#27 0x00000001009158a9 in G__getitem ()
#28 0x000000010091a65f in G__getexpr ()
#29 0x00000001009ad48d in G__exec_statement ()
#30 0x000000010090169f in G__exec_tempfile_core ()
#31 0x00000001009019a6 in G__exec_tempfile_fp ()
#32 0x00000001009b8038 in G__process_cmd ()
#33 0x0000000100021cfe in TCint::ProcessLine ()
#34 0x000000010006a6e0 in TApplication::ProcessLine ()
#35 0x0000000101299dbc in TRint::HandleTermInput ()
#36 0x0000000101298627 in TTermInputHandler::Notify ()
#37 0x000000010129a89d in TTermInputHandler::ReadNotify ()
#38 0x000000010011d6a2 in TUnixSystem::CheckDescriptors ()
#39 0x000000010011dbb6 in TUnixSystem::DispatchOneEvent ()
#40 0x00000001000ad23d in TSystem::InnerLoop ()
#41 0x00000001000af733 in TSystem::Run ()
#42 0x0000000100068c37 in TApplication::Run ()
#43 0x000000010129a48b in TRint::Run ()
#44 0x0000000100001990 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
http://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 0x0000000104025503 in asim_parse_argb_color ()
#6 0x0000000104070e03 in build_xpm_colormap ()
#7 0x0000000104053dfb in xpm_file2ASImage ()
#8 0x0000000104054087 in xpm2ASImage ()
#9 0x000000010405591c in file2ASImage_extra ()
#10 0x000000010400eaf2 in TASImage::ReadImage ()
#11 0x0000000102e13103 in TImage::Open ()
#12 0x00000001033d1414 in TGPicturePool::GetPicture ()
#13 0x000000010349c16d in TGHScrollBar::TGHScrollBar ()
#14 0x000000010340c632 in TGCanvas::TGCanvas ()
#15 0x00000001034f8a36 in TRootCanvas::CreateCanvas ()
#16 0x00000001034f91ca in TRootCanvas::TRootCanvas ()
#17 0x0000000103502667 in TRootGuiFactory::CreateCanvasImp ()
#18 0x0000000102fc38cc in TCanvas::Draw ()
Root >
Regards,
--
OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
Institute of Space and Astronautical Science (ISAS/JAXA)
Now at KIPAC/SLAC/Stanford
Varian Physics #306, 382 Via Pueblo Mall, MC 4060
Stanford, CA 94305-4060
TEL 650-736-0971/FAX 650-724-5065
Skype : okumura.akira
On 2011/07/10, at 23:35, Olivier Couet wrote:
> May be you can turn on the batch mode with:
>
> gROOT->SetBatch(kTRUE);
>
> On 7/11/11 8:32 AM, "OKUMURA, Akira" <oxon_at_astro.isas.jaxa.jp> wrote:
>
>> Hello Olivier,
>>
>> Thank you for your advice. But as I wrote,
>>
>>> But I have thousands of ROOT files, I do not want to draw each TCanvas.
>>
>> there are so many files already created. So if possible, I would like to
>> access the sub pad in batch mode or similar way. Is this impossible?
>>
>> Regards,
>>
>> --
>> OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
>> Institute of Space and Astronautical Science (ISAS/JAXA)
>> Now at KIPAC/SLAC/Stanford
>> Varian Physics #306, 382 Via Pueblo Mall, MC 4060
>> Stanford, CA 94305-4060
>> TEL 650-736-0971/FAX 650-724-5065
>> Skype : okumura.akira
>>
>> On 2011/07/10, at 21:14, Olivier Couet wrote:
>>
>>> If you do
>>>
>>> can->Draw();
>>>
>>> Just after
>>>
>>> TCanvas* can = (TCanvas*)f.Get("can")
>>>
>>>
>>> Then it works.....
>>>
>>> On 7/11/11 2:36 AM, "OKUMURA, Akira" <oxon_at_astro.isas.jaxa.jp> wrote:
>>>
>>>> TCanvas* can = (TCanvas*)f.Get("can")
>>>
>>
>
Received on Mon Jul 11 2011 - 08:58:59 CEST