Re: [ROOT] root crash

From: Paul Nord (Paul.Nord@valpo.edu)
Date: Mon Nov 19 2001 - 23:55:44 MET


Rene,

Both methods will work, as you suggest.  However, this failure so so
catastrophic and hard to track down, that the Paint function should report
an error if the full set of initiliazation functions for this class have
not been called.  There is no doccumentation for TMarker3DBox suggesting
that the default constructor needs to be used carefully.  Given that you
didn't even notice that I had omitted SetDirection() in the code fragment,
I think that we can conclude that the code is broken.  I don't care how
you fix it.  Please fix it.

Paul


On Mon, 19 Nov 2001, Rene Brun wrote:

> Paul,
>
> If you call the default constructor of TMarker3DBox, you should set
> all the parameters. You forgot to call SetDirection.
> It might be more convenient to call the other constructor.
> In the default constructor, we only initialize the pointers.
> This is for speed reasons. The default constructor is called
> by the I/O system to create an object, followed by object.Streamer.
> The Streamer function initializes each member. In this case, there is no
> need to set the members to some default values.
>
> Rene
>
> On Mon, 19 Nov 2001, Paul Nord wrote:
>
> > Rene,
> >
> > I think that I may be near the answer.  Since the problem only pops up at
> > strange times, I'm thinking that some variable is not getting zeroed or
> > initialiazed properly.  Look at the TMarker3DBox constructor.  The code
> > I'm calling, with no variables, will never set values for fTheta and fPhi.
> > I think that this may be the problem.  And it may only pop up on the Alpha
> > compiler.
> >
> > Paul
> >
> > On Mon, 19 Nov 2001, Paul Nord wrote:
> >
> > > Rene,
> > >
> > > The problem is strange.  When I run the program from the debugger, it goes
> > > away.  Right now, this will crash it:
> > >
> > > /gluonc/e614/root_v3.01.06.OSF1.V4.0.cxx6/test> uname -a
> > > OSF1 gluon.valpo.edu V4.0 564 alpha
> > > /gluonc/e614/root_v3.01.06.OSF1.V4.0.cxx6/test> cat myworld.cxx
> > > #include "TApplication.h"
> > > #include "TCanvas.h"
> > > #include "TLine.h"
> > > #include "TPaveLabel.h"
> > > #include "TMarker3DBox.h"
> > > #include "TView.h"
> > > #include "TList.h"
> > >
> > > int main(int argc, char **argv)
> > > {
> > >    TApplication theApp("App", &argc, argv);
> > >
> > >    TCanvas *c = new TCanvas("c", "My Canvas", 400, 400);
> > >    c->Update();
> > >
> > >    TPaveLabel *hello = new TPaveLabel(0.2,0.0,0.8,0.4,"Hello World");
> > >    hello->Draw();
> > >    c->Update();
> > >
> > >    // Create main display pad
> > >    TPad *m_Pad = new TPad("viewpad", "Event display",0.0,.4,1,1);
> > >    m_Pad->Draw();
> > >    m_Pad->Modified();
> > >    m_Pad->SetBorderSize(2);
> > >    m_Pad->cd();
> > >    c->Update();
> > >
> > >    TView *view = new TView(1);
> > >    view->SetRange(-1,-1,-1,1,1,1);
> > >    c->Update();
> > >
> > >    TMarker3DBox *marker = new TMarker3DBox();
> > >    marker->SetPosition(0,0,0);
> > >    marker->SetSize(.1,.1,.1);
> > >    marker->SetLineColor(2);
> > >
> > >    c->Update();
> > >
> > >    TList *mylist = new TList();
> > >    mylist->Add(marker);
> > >
> > >    TIter nextm(mylist);
> > >    TMarker3DBox *pMarker;
> > >    while((pMarker = (TMarker3DBox *)nextm())) {
> > >       pMarker->Draw();
> > >    }
> > >
> > >    c->Update();
> > >
> > >
> > >
> > >    // Enter event loop, one can now interact with the objects in
> > >    // the canvas. Select "Exit ROOT" from Canvas "File" menu to exit
> > >    // the event loop and execute the next statements.
> > >    theApp.Run();
> > >
> > >    return 0;
> > > }
> > > /gluonc/e614/root_v3.01.06.OSF1.V4.0.cxx6/test> touch myworld.cxx
> > > /gluonc/e614/root_v3.01.06.OSF1.V4.0.cxx6/test> make
> > > cxx -O0 -nostdnew -D__osf__ -D__alpha -I/usr/users/e614/root/include -c
> > > myworld.cxx
> > > cxx -O myworld.o -L/usr/users/e614/root/lib -lCore -lCint -lHist -lGraf
> > > -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lm  -o
> > > myworld
> > > myworld done
> > > /gluonc/e614/root_v3.01.06.OSF1.V4.0.cxx6/test> myworld
> > >
> > >  *** Break *** floating point exception
> > > IOT trap (core dumped)
> > >
> > > ==================================
> > >
> > > Any ideas?
> > >
> > > Paul
> > >
> > >
> >
>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:09 MET