TImageDump crash for divided canvases

Hello,
I tried to use TImageDump to produce a gif file for the case of a canvas that is divided and I got a crash!

TCanvas *myc = new TCanvas(“myc”,"",500,600);
myc->Divide(1,2);
TImageDump *imgdump = new TImageDump(“file.gif”);
myc->cd(1);
histo1->Draw();
myc->cd(2);
histo2->Draw();
myc->Paint();
imgdump->Close();

It crashes in both batch and interactive mode (I’m using ROOT 5.18). In batch mode I get:

*** Break *** segmentation violation
Generating stack trace…
/usr/bin/addr2line: ‘which’: No such file
/usr/bin/addr2line: ‘which’: No such file
/usr/bin/addr2line: ‘which’: No such file
0x00002aba0465e6e4 in TPad::PaintBorder(short, bool) + 0x3e4 from /usr/local/analyze/ROOT/lib/libGpad.so
0x00002aba04666cc4 in TPad::Paint(char const*) + 0x94 from /usr/local/analyze/ROOT/lib/libGpad.so
0x0000000000411cf4 in _Z12create_histoSt3mapI7TStringS_IS0_S_IS0_S_IS0_S_IS0_S_IS0_S_IS0_S_IS0_iSt4lessIS0_ESaISt4pairIKS0_iEEES2_SaIS3_IS4_S7_EEES2_SaIS3_IS4_SA_EEES2_SaIS3_IS4_SD_EEES2_SaIS3_IS4_SG_EEES2_SaIS3_IS4_SJ_EEE + 0x2574 from read_tree
0x00000000004196ae in main + 0x77ae from read_tree
0x00002aba060e00c4 in __libc_start_main + 0xf4 from /lib/libc.so.6
0x000000000040c939 in __gxx_personality_v0 + 0x109 from read_tree

then I’ve tried to move down the TImageDump definition:

TCanvas *myc = new TCanvas(“myc”,"",500,600);
myc->Divide(1,2);
myc->cd(1);
histo1->Draw();
myc->cd(2);
histo2->Draw();
TImageDump *imgdump = new TImageDump(dir+“plot.gif”);
myc->Paint();
imgdump->Close();

in this case I have no crash but the gif file contains only the histo2 that is put on the upper part of the canvas (the lower portion is empty).
What is goingo wrong?

many thanks!

Pierpaolo

A fix has been done yesterday. The Macro we used to test is:

{
   gROOT->SetBatch();

   TCanvas *c = new TCanvas;
   c->Divide(1,2);
   TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
   h->FillRandom("gaus", 10000);
   c->cd(1); h->Draw();
   c->cd(2); h->Draw("c*");
   c->Print("ccc1.gif");
   TImage *img = TImage::Create();
   img->FromPad(c);
   img->WriteImage("ccc2.gif");
}

can you try it ?

I tried your code. The first part
c->Print(“ccc1.gif”);

correctly produce the divided plot, while the second one:
TImage *img = TImage::Create();
img->FromPad©;
img->WriteImage(“ccc2.gif”);

only produce a gif file with upper part containing the result of your second Draw command (lower part is empty).

Yes that was the bug. Now fixed in the svn trunk.