Re: Fix for rman [was: Re: [-CURRENT tinderbox] ...]

From: Marcel Moolenaar <marcel_at_xcllnt.net>
Date: Wed, 16 Jul 2003 03:05:06 -0700
On Wed, Jul 16, 2003 at 01:52:28AM -0700, Kris Kennaway wrote:
> On Wed, Jul 16, 2003 at 12:43:37AM -0700, Marcel Moolenaar wrote:
> > On Tue, Jul 15, 2003 at 10:16:01PM -0700, Kris Kennaway wrote:
> > > > 
> > > > malloc, you say? I have build failures in XFree4-clients because
> > > > rman coredumps and I have a backtrace full of free() frames...
> > > > 
> > > > Coincidence?
> > > 
> > > Some of the XFree86 utilities contain malloc bugs..rman in particular
> > > has been dumping core on certain ports for a couple of years.  I tried
> > > to track it down once but couldn't find it.
> > 
> > [cc anholt_at_]
> > 
> > The attached patch fixes rman. The faulting case is "\\\0". The '\0'
> > was handled in the default case for escaped characters, which also
> > incremented the pointer p beyond the terminating '\0'. 
> > 
> > Oh: this goes to devel/imake-4 of course.
> 
> Hmm, I'm not sure this is the same bug I was seeing, because mine went
> away when I turned off malloc debugging.

Without malloc debugging the chance that the allocated memory has
zeroes is large(r). Going past the terminating '\0' if it's followed
by another one then hides the bug. With J, malloc() makes sure the
allocated memory is not zero and thus exposes the bug.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel_at_xcllnt.net
Received on Wed Jul 16 2003 - 01:05:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC