This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin setup crashes

On Tue, 4 Mar 2003, Max Bowsher wrote:

> > Actually this patch was never applied correctly to cvs. Here is my
> > original post with the correct patch:
> >
> >
> ch
> Looks like a botched application of the patch.

I don't know what 'botched' is :)

> Robert:
> OK to fix on HEAD?
> OK to apply to setup-200206?
> OK to apply similar fix to setup-200207, just in case we want to use that
> branch to help find some of the weird logic bugs that have crept in since
> 200206?
> I'm going to suggest Manu tries this fix.

I guess it will fix his problems, however I think the patch should be 
enhanced a bit. It should handle properly also the other case i.e. 

  compress_gz_object = new compress_gz;
  if (compress_gz_object->error())
    delete compress_gz_object;

This code is dangerous. compress_gz::construct() calls
compress_gz::destroy() if an error is encountered. The
the destructor will trigger a second call to compress_gz::destroy()
which will try to free memory which was already freed.

So I suggest either to zero the pointer members after they're deleted
or use the 'destroyed' member of compress_gz to check if the object
has already been destroyed. This member is only set now but not checked.

Sorry, dont have time to do a proper patch right now.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]