Re: TProfile in a object in a file in a macro causes bomb in released version of root

Rene Brun (Rene.Brun@cern.ch)
Thu, 12 Mar 1998 11:38:19 +0100


Gordon Watts (Brown University) wrote:
>
> Hi,
> Below I have two files, test.C and test1.C. When I run test.C (root -q
> test.C) I get an access violation: NT pops up a dialog and complains that I
> tried to access memory at 0xfffff or some such address. Am I doing something
> wrong, or is this a bug in root? BTW, I can verify this on 1.03/09 on a IRIX
> 6 system...
>
> Cheers,
> Gordon.
>

This problem is a CINT problem reported to Masa.
A turnaround is to replace your statement:
s->Fill(-1,10)
by
Float_t x=-1;
Float_t y=10;
s->Fill(x,y);

Numeric values seem to give problems to CINT in case the called
member function has a prototype involving a double precision
argument. This is the case for TProfile::Fill (2 prototypes
with 2 and 3 parameters).

Rene Brun

> FILE: test.C
> {
> TProfile *s = new TProfile ("my", "good", 16, -4, 0, 0, 20);
> s->Fill (-1,10);
> printf ("Just did the first fill, will now try the second");
> #include "test1.C"
> test1 junk1;
> }
>
> -----------
> FILE: test1.C
> class test1 {
> public:
> test1 (void);
> };
>
> test1::test1 (void)
> {
> TProfile *j = new TProfile ("hi", "there", 16, -4.0, 4.0, 0, 20);
> j -> Fill (10, 20);
> }