Re: TImageDump error (1)

From: OKUMURA, Akira <oxon_at_icrr.u-tokyo.ac.jp>
Date: Tue, 13 Feb 2007 12:45:23 -1000


Hello Olivier

I ran the same code with OS X 10.4.8 (GCC 4.0.1) and ROOT ver. 5.14. Unlike the SL 4.4 environment, the code detects a signal and breaks. If I comment out the line of SetTopMargin, it runs. It seems that it depends on machine environment?

$ g++ tmp.C `root-config --libs --cflags` -bind_at_load $ ./a.out

/Users/oxon/1152: No such file or directory. Attaching to process 1152.
Reading symbols for shared libraries . done

Reading symbols for shared libraries ..................... done
0x90032084 in wait4 () Thread 1 (process 1152 thread 0xd03):
#0  0x90032084 in wait4 ()
#1  0x90052d10 in system ()
#2  0x0213bdd8 in TUnixSystem::StackTrace ()
#3  0x0213fb94 in TUnixSystem::DispatchSignals ()
#4  <signal handler called>
#5  0x0360cccc in TASImage::DrawGlyph ()
#6  0x005f5f5f in G__newtype ()
#7  0x0360fe20 in TASImage::DrawText ()
#8  0x00071504 in TImageDump::Text ()
#9  0x013c69c0 in TLatex::Analyse ()
#10 0x013c7a68 in TLatex::PaintLatex ()
#11 0x01391958 in TGaxis::PaintAxis ()
#12 0x03469550 in THistPainter::PaintAxis ()
#13 0x0347322c in THistPainter::PaintTable ()
#14 0x03468480 in THistPainter::Paint ()
#15 0x02dbe4f4 in TPad::Paint ()
#16 0x000042d4 in main ()


Sincerely,

OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
Institute for Cosmic Ray Research, University of Tokyo 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan Phone/Fax : +81 4-7136-3153
Skype : okumura.akira

On 2007/02/13, at 4:07, Olivier Couet wrote:

> Hi,
> Your macro works for me with the latest ROOT.
>
> -----Original Message-----
> From: owner-roottalk_at_pcroot.cern.ch
> [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of OKUMURA, Akira
> Sent: Tuesday, February 13, 2007 2:18 PM
> To: RootTalk
> Subject: [ROOT] TImageDump error (1)
>
> Hello ROOTers,
>
> I wrote a short program which dumps a GIF image using TImageDump
> class.
> I found that the line "can->SetLeftMargin(0)" caused a runtime error.
> However Top/Bottom/Right work well. How can I avoid this error?
>
> The error message is;
> *** glibc detected *** double free or corruption (!prev): 0x08fa63c8
> ***Aborted
>
> ROOT version is 5.14 for SL 4.4
>
> Sincerely
>
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan Phone/Fax : +81
> 4-7136-3153 Skype : okumura.akira
>
> ========================================
>
> $ g++ test.cxx -o test `root-config --libs --cflags`
>
> ========================================
>
> #include "TImageDump.h"
> #include "TCanvas.h"
> #include "TH2D.h"
>
> int main()
> {
> TCanvas* can = new TCanvas("can", "can", 100, 100);
> can->SetLeftMargin(0); // <= this cause an error
> can->SetTopMargin(0);
> can->SetRightMargin(0);
> can->SetBottomMargin(0);
>
> TH2D* hist = new TH2D("hist", "hist", 1, 0, 1, 1, 0, 1);
> hist->Draw();
>
> TImageDump dump("test.gif");
> can->Paint();
>
> dump.Close();
>
> return 0;
> }
>
>
>
>
Received on Tue Feb 13 2007 - 23:46:08 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 14 2007 - 11:50:01 CET