This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: Cygwin setup crashes
- From: Pavel Tsekov <ptsekov at gmx dot net>
- To: Max Bowsher <maxb at ukf dot net>
- Cc: cygwin-apps at cygwin dot com
- Date: Tue, 4 Mar 2003 20:29:24 +0100 (CET)
- Subject: 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:
> >
> >
> http://sources.redhat.com/ml/cygwin-apps/2002-07/msg00049/compress_gz.cc.pat
> 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.