Hi Glen, this is not a bug and you are not doing anything wrong. What happens in the first case is that the object is deleted, but its memory has not been reused, so the object looks still perfectly ok, but its memory can be reused anytime when you start creating new objects. In the second case with rootn.exe it goes wrong immediately because libNew in rootn sets explicitely the memory of the deleted object to 0. LibNew cannot be loaded in a running program, it must be linked in from the start. Cheers, Fons. "Glen R. Salo" wrote: > > Hi, > > I found the following strange behavior (r->Dump() returns valid data after > being deleted) using today's CVS version of ROOT on a RedHat 7.0 linux > machine (with all of the updates). Using the "root" binary, I get: > > root [0] TList l > root [1] TRotMatrix *r = new TRotMatrix("r","R",0,0,0,0,0,0) > root [2] l.Add(r) > root [3] l.Delete() > root [4] r->Dump() > fUniqueID 1085936384 object unique identifier > fBits 1085936568 bit field status word > > And using the "rootn.exe" binary, I get what I expect as show below: > > root [0] TList l > root [1] TRotMatrix *r = new TRotMatrix("r","R",90.,0.,90.,90.,0.,0.) > root [2] l.Add(r) > root [3] l.Delete() > root [4] r->Dump() > > *** Break *** segmentation violation > > Running "root" and loading libNew.so (gSystem->Load("libNew.so")) did not > change the results as I thought they might. > > Is this a bug or am I doing something wrong? > > Thanks for your help, > > Glen -- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7677910
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:40 MET