public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon TURNEY <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com, cygwin-ports-general@lists.sourceforge.net
Subject: Re: Problems installing from Cygwinports
Date: Thu, 31 Mar 2011 14:35:00 -0000	[thread overview]
Message-ID: <4D949120.1070404@dronecode.org.uk> (raw)
In-Reply-To: <1301548510.2936.23.camel@YAAKOV04>

[-- Attachment #1: Type: text/plain, Size: 2080 bytes --]

On 31/03/2011 06:15, Yaakov (Cygwin/X) wrote:
> As a potential setup.exe bug, redirecting to cygwin-apps.
> 
> On Thu, 2011-03-31 at 00:54 +0200, Angelo Graziosi wrote:
>> It is sometime I have installed a few packages from Cygwinports 
>> (QT,GCC), but today upgrading (mainly *QT*-4.7.2-1 and *mesa*-7.10.1-2) 
>> 'setup.exe' seems to hang in extracting /usr/include/GL/glxext.h from 
>> libGL-devel-7.10.1-2.
> 
> Confirmed.
> 
> (The tarball in question is here:)
> ftp://ftp.cygwinports.org/pub/cygwinports/release-2/_DISTRO_/X.Org/mesa/libGL-devel/libGL-devel-7.10.1-2.tar.bz2
> 
>> Result: my hard drive (C:) is almost full, X does not start any more and 
>> I can use only Cygwin.bat and mintty. To be short, my Cygwin 
>> installation is broken :(
> 
> Start by deleting /usr/include/GL/glxext.h, that will free up your hard
> drive.  Then re-run setup, choosing to KEEP libGL-devel instead of
> upgrading.
> 
> Now, as for the cause, the only thing I can think of is that I just
> started using pbzip2 for compression in cygport[1].  The bz2's are
> supposed to be fully compatible, and neither Cygwin nor MinGW bzip2 have
> any problems with the tarball in question.
> 
> So my wild guess is that setup uses libbz2 in a way which is
> incompatible with pbzip2-compressed tarballs, as unlikely as it seems.  
> 
> Can any setup.exe authors shed any light on this?

I do actually want to install that package, so I took a brief look at this:

The first problem is that .bz2 file and the decompressor don't like each
other. The decompressor reports the stream has ended partway through
decompressing glxext.h.  It's very mysterious that it should fail but bunzip2
has no problems with the same file.

The second problem is a setup bug: If we get an unexpected short read from the
archive stream decompressor, we'll sit in an infinite loop writing garbage to
the output file 5 bytes at a time.  A patch is attached which fixes that, but
since these errors are  unreported (see comment in io_stream::copy), we just
stop expanding the archive, leaving an incomplete glxext.h

[-- Attachment #2: 0001-Don-t-hang-if-something-goes-wrong-reading-from-a-ta.patch --]
[-- Type: text/plain, Size: 1577 bytes --]

From 3ca6eaca538d496867ac4e5e9faf2cf51162ad2f Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Thu, 31 Mar 2011 14:45:47 +0100
Subject: [PATCH] Don't hang if something goes wrong reading from a tar archive

Returning EIO (a small positive integer) as the result of archive_tar_file::read()
on an error isn't a good idea, it's indistinguishable from successfully reading
a small number of bytes.

This causes io_stream::copy() to spin forever if it's reading from an archive stream
which terminates unexpectedly early, which can happen on an decompression error.

So, return 0 instead

2011-03-31  Jon TURNEY  <jon.turney@dronecode.org.uk>

	* archive_tar_file.cc (read, peek): Return 0 on an error,
	not EIO.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
---
 archive_tar_file.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/archive_tar_file.cc b/archive_tar_file.cc
index 29a2df7..ed6e515 100644
--- a/archive_tar_file.cc
+++ b/archive_tar_file.cc
@@ -65,7 +65,7 @@ ssize_t archive_tar_file::read (void *buffer, size_t len)
 	  /* unexpected EOF or read error in the tar parent stream */
 	  /* the user can query the parent for the error */
 	  state.lasterr = EIO;
-	  return EIO;
+	  return 0;
 	}
     }
   return 0;
@@ -96,7 +96,7 @@ ssize_t archive_tar_file::peek (void *buffer, size_t len)
 	  /* unexpected EOF or read error in the tar parent stream */
 	  /* the user can query the parent for the error */
 	  state.lasterr = EIO;
-	  return EIO;
+	  return 0;
 	}
     }
   return 0;
-- 
1.7.4


  reply	other threads:[~2011-03-31 14:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4D93B499.4090800@alice.it>
2011-03-31  5:15 ` Yaakov (Cygwin/X)
2011-03-31 14:35   ` Jon TURNEY [this message]
2011-03-31 14:42     ` Eric Blake
2011-04-08 14:44       ` [PATCH 0/6] Handle and report decompression errors; handle multistream bzip2 files Jon TURNEY
2011-04-08 14:44         ` [PATCH 6/6] Handle short reads in archive_tar_file::read() Jon TURNEY
2011-04-20 16:41           ` Corinna Vinschen
2011-04-21 10:07             ` Jon TURNEY
2011-04-24 11:29               ` Jon TURNEY
2011-04-24 11:43                 ` Some observations made installing all packages (was Re: [PATCH 6/6] Handle short reads in archive_tar_file::read()) Jon TURNEY
2011-04-08 14:44         ` [PATCH 4/6] Report failure extracting a file from package to the user Jon TURNEY
2011-04-20 16:37           ` Corinna Vinschen
2011-04-21  9:57             ` Jon TURNEY
2011-04-08 14:44         ` [PATCH 1/6] Don't hang if something goes wrong reading from a tar archive Jon TURNEY
2011-04-20  8:42           ` Corinna Vinschen
2011-04-08 14:44         ` [PATCH 2/6] Consistently return -1 and set lasterr instead in io_stream derived classes Jon TURNEY
2011-04-20  8:43           ` Corinna Vinschen
2011-04-08 14:44         ` [PATCH 3/6] Propagate errors out of io_stream::copy() Jon TURNEY
2011-04-20  8:44           ` Corinna Vinschen
2011-04-08 14:44         ` [PATCH 5/6] Handle bzip2 multi-stream files Jon TURNEY
2011-04-20 16:39           ` Corinna Vinschen
2011-04-20 20:16             ` Charles Wilson
2011-04-21 10:07               ` Jon TURNEY
2011-03-31 14:44     ` Problems installing from Cygwinports Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D949120.1070404@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    --cc=cygwin-ports-general@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).