PyROOT6 Requires Manual Canvas Update

Hi, I noticed a slight but annoying difference when using PyROOT under ROOT6. This occurs using the regular interpreter and IPython. If you do:

import ROOT
h = ROOT.TH1D("h","h",10,0,10)
h.Draw()

under ROOT5, the default canvas window pops up and the histogram and axes are shown. Under ROOT6, the canvas window pops up, but the histogram is not drawn. You need to either click on the window to trigger an Update(), or use ROOT.gPad.Update().

I am still using 6.00.00, not the newer 6.01. This is on OSX 10.9 using python 2.7.7.

Also I just discovered a new peculiar behavior. If you quit with Ctrl+D without updating the canvas, it quits normally. If you clicked on the canvas or used ROOT.gPad.Update(), Ctrl+D triggers a seg fault! Here’s the printed messages:

 *** Break *** segmentation violation
 Generating stack trace...
 0x00000001181a20f2 in TGCocoa::DestroyWindow(unsigned long) (in libGCocoa.so) + 258
 0x000000011831e53a in TGWindow::~TGWindow() (in libGui.so) + 58
 0x00000001182bccee in TGPopupMenu::~TGPopupMenu() (in libGui.so) + 14
 0x00000001182b9e9e in TGMenuBar::~TGMenuBar() (in libGui.so) + 382
 0x00000001182b9cce in TGMenuBar::~TGMenuBar() (in libGui.so) + 14
 0x0000000118332530 in TRootCanvas::~TRootCanvas() (in libGui.so) + 528
 0x0000000118332308 in non-virtual thunk to TRootCanvas::~TRootCanvas() (in libGui.so) + 24
 0x0000000117f81683 in TCanvas::Close(char const*) (in libGpad.so) + 403
 0x0000000117f810af in TCanvas::~TCanvas() (in libGpad.so) + 207
 0x0000000117f80ece in TCanvas::~TCanvas() (in libGpad.so) + 14
 0x0000000109d8d6c5 in TList::Delete(char const*) (in libCore.so) + 549
 0x0000000109d3b891 in TROOT::EndOfProcessCleanups() (in libCore.so) + 113
 0x00007fff92c95794 in __cxa_finalize (in libsystem_c.dylib) + 164
 0x00007fff92c95a4c in exit (in libsystem_c.dylib) + 22
 0x00007fff99911604 in start (in libdyld.dylib) + 8
 0x0000000000000002 in <unknown function>

Should I try to reproduce this on 6.01?

Jean-François

Jean-François,

I find this in ROOT.py for ROOT6:[code]# TODO: EndOfLineAction currently unresolvable (#98656?)

_root.gInterpreter.EndOfLineAction()[/code]

I’ll have a look and see whether this has since been fixed.

Thanks,
Wim

Hi,

the end-of-line action is no re-enabled and seems to do the trick. Don’t know about the crash: seems to be an ordering problem that I can’t quite put my finger on. I put in a work-around for Cocoa-only, forcing the early cleanup of canvases, before gROOT goes dodo-bird.

Cheers,
Wim