[ROOT] Error calling TFile::Write

From: Dave Casper (dcasper@uci.edu)
Date: Tue Aug 15 2000 - 03:18:42 MEST


	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



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:31 MET