Re: [ROOT] Error calling TFile::Write

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Tue Aug 15 2000 - 13:18:04 MEST


Hi Dave,

   could you try linking your program without libNew.lib. Does the problem
go away? Also when using libNew make sure it is the very first lib when linking.

Cheers, FOns.


Dave Casper wrote:
> 
>         Hi,
> 
> I am trying to figure out how to write Geant4 output to a root tree.  I have
> created a test program (linked with our G4 program, however) which follows
> the "Event" example program identically.  The only differences are:
> 
> a) The object I am trying to write (derived from TObject) contains only two
> Int_t member variables rather than the complicated Event object in the
> example.
> b) I am not creating any histograms, just a single tree with a single
> branch.  I have tried both setting of the split variable when creating the
> branch.
> 
> Everything seems to go fine until I call TFile::Write() at the end of my job
> (i.e. the root file creation, tree and branch creation and tree filling give
> no problems; I checked that my class's Streamer function is being called).
> When I call TFile::Write() I get the error message:
> 
> <CustomReAlloc2>: passed oldsize 1032, should be 327811
> 
> followed by an access violation which crashes the program.
> 
> As far as I can tell, I am doing everything identically to the Event example
> program (which runs fine).  I've tried a lot of different variations but
> can't avoid this error.  Not calling TFile::Write and just closing the file
> results in no crash but an empty file (which isn't a huge surprise, I
> guess).  This error seems to be coming from somewhere deep with the root
> libraries - can anyone provide some clue as to what the problem could be?
> 
> I'm using root 2.25.1 on Win2K.
> 
> Thanks,
> 
> Dave
> dcasper@uci.edu

-- 
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 02 2001 - 11:50:31 MET