Well, that explains the last Purify issue.  Whenever we substr out 0 bytes
to a NULL register, we create a string by malloc(0).  If we later print that
string, then we pass in 0 to printf.  I thought that printf would not look
at its argument if the length specifier was 0, but apparently on your system
it does.  So, it appears we have two options:

1.) Ignore the error

2.) Put an if statement around the print and have it not print if the
    string is of length 0.

Any sugestions or other ideas? 

-----Original Message-----
From: Josh Wilmes
To: Gibbs Tanton - tgibbs
Cc: ''[EMAIL PROTECTED] ' '
Sent: 9/17/2001 2:23 PM
Subject: Re: "Automated" Purify Run 



****  Purify instrumented foo (pid 11272)  ****
ABR: Array bounds read:
  * This is occurring while in:
        _doprnt        [libc.so.1]
        printf         [libc.so.1]
        main           [ccjq2xev.o]
        _start         [crt1.o]
  * Reading 1 byte from 0x969b0 in the heap.
  * Address 0x969b0 is 1 byte past end of a malloc'd block at 0x969b0 of
0 bytes
.
  * This block was allocated from:
        malloc         [rtlib.o]
        main           [ccjq2xev.o]
        _start         [crt1.o]




At 14:18 on 09/17/2001 CDT, Gibbs Tanton - tgibbs
<[EMAIL PROTECTED]> wrote:

> The hourly should be fine...can you do me one other favor and run the
> following c snippet through Purify:
> 
> int main() {
>   char* c = (char*)malloc(0);
>   printf( "%.*s\n", 0, c );
>   return 0;
> } 
> 
> -----Original Message-----
> From: Josh Wilmes
> To: Gibbs Tanton - tgibbs
> Cc: '[EMAIL PROTECTED] '
> Sent: 9/17/2001 1:18 PM
> Subject: Re: "Automated" Purify Run 
> 
> It should now be running once an hour.  (it broke due to some makefile

> changes yesterday).
> 
> I can't really do it easily on-demand, due to the way this is set up.
> 
> --Josh
> 
> At 13:05 on 09/17/2001 CDT, Gibbs Tanton - tgibbs
> <[EMAIL PROTECTED]> wrote:
> 
> > It looks like to me that this is only running every day.  Can we get
> it to
> > run every hour?  Perhaps even on demand?  I think I have fixed all
of
> the
> > memory access errors but one. 
> > 
> > -----Original Message-----
> > From: Josh Wilmes
> > To: [EMAIL PROTECTED]
> > Sent: 9/15/2001 5:16 PM
> > Subject: "Automated" Purify Run
> > 
> > 
> > This time i've filtered out all the memory leak related data so all
> that
> > 
> > shows up are legitimate errors. (hopefully)
> > 
> > I have set up a cheesy script to update the following URL with the
> > current output 
> > of purify on the current CVS test_prog (test,test2,test3,euclid)
every
> > hour.
> > 
> > http://www.hitchhiker.org/josh/parrot/purify.txt
> > 
> > --Josh
> 

Reply via email to