delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/26/16:30:45

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=1.4 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Thu, 26 Nov 2009 22:30:25 +0100
To: cygwin AT cygwin DOT com
Subject: tar hangs on unpacking calcoo_1.3.16.orig.tar
Message-ID: <20091126213025.GA26443@win.tue.nl>
References: <5a05e0e60911261052w2e60586cxe7a90d02b4cf6e0f AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <5a05e0e60911261052w2e60586cxe7a90d02b4cf6e0f@mail.gmail.com>
User-Agent: Mutt/1.5.18 (2008-05-17)
From: rp AT win DOT tue DOT nl (Reinier Post)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

  Dear list,

I've been using Cygwin daily for years and I'm very happy with it.
But today it threw a nice puzzle at me.  I must confess I became
a list member just to report it.

My Cygwin /usr/bin/tar hangs when unpacking an archive:

  curl ftp://ftp.debian.org/debian/pool/main/c/calcoo/calcoo_1.3.16.orig.tar.gz
| tar zxvf -

hangs after printing the line

  calcoo-1.3.16/src/aux.c

This happens on two different i386 systems, both running an up to date Cygwin
on an up to date Windows XP with the latest security patches applied.
The file system is NTFS.

No such problem exists on Linux.

There must be something odd with this particular archive;
the ones preceding it on the FTP server have no such problem.
But tar should never hang in an infinite loop,
regardless of the input we throw at it.

The same thing happens when the tarball is saved to disk,
gunzipped, and then untarred without the z option.
It also happens with tar-1.20 (current is tar-1.21),
and with tar-1.20 compiled from source, both with and without
Cygwin patches applied.  gdb reveals that the problem is in the loop in

  src/extract.c

which looks like this (in tar-1.20):

763  do
764    fd = open_output_file (file_name, typeflag, mode ^ invert_permissions);
765  while (fd < 0 && maybe_recoverable (file_name, &interdir_made));

fd is set to -1, which causes maybe_recoverable() to be entered,
which attempts to unlink(file_name), which returns 0 even though
the file does *not* exist, which causes maybe_recoverable() to return 1
and the loop to repeat forever.

I don't know why this is happening, let alone how to repair it.

Does Cygwin have a bugtracker?

Help!

-- 
Reinier Post
TU Eindhoven

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019