Mail Archives: djgpp-workers/2003/11/02/15:52:42.1
Hello.
Eli Zaretskii wrote:
>
> > Date: Thu, 30 Oct 2003 19:21:15 +0000
> > From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
> >
> > > I have no good idea how to check fix for the realloc() in regex.
> > > I did it by the visual examination of code.
> >
> > I was thinking of something like this:
> >
> > Write some regression tests for regexps. (Actually, there are already
> > some.) Modify realloc so that it fails randomly. Rebuild libc and test.
> > Check that nothing bad happens.
>
> Can functions in malldbg.c help here?
It looks like it can help detect buffer overruns.
I couldn't see a way to make realloc fail 25% of the time, say. It would be
nice to have something like this, to check that libc handles malloc/realloc
failures gracefully.
Maybe the memory allocation hooks could return an int, to indicate whether the
operation should be allowed to take place. Or maybe that belongs in a new set
of hooks - a memory allocation policy manager?
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
"You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek
- Raw text -