Package: gzip
Version: 1.3.5-9
Tags: patch

While looking at the ubuntu patches for gzip, I found some changes
which are missing in the debian package.  These are the ubuntu
changelog entries related to the fixes:

  gzip (1.3.5-9ubuntu3) warty; urgency=low
  
    * Acutually use the abort_gzip_signal routine created in -9ubuntu2
      (really Closes: Ubuntu#1854)
  
   -- Matt Zimmerman <[EMAIL PROTECTED]>  Wed, 13 Oct 2004 08:15:48 -0700
  
  gzip (1.3.5-9ubuntu2) warty; urgency=low
  
    * Use a separate signal handler function rather than changing abort_gzip,
      since abort_gzip is used in non-signal contexts as well
  
   -- Matt Zimmerman <[EMAIL PROTECTED]>  Mon, 11 Oct 2004 12:50:02 -0700
  
  gzip (1.3.5-9ubuntu1) warty; urgency=low
  
    * Call _exit rather than the do_exit cleanup routine from abort_gzip.
      abort_gzip is a signal handler, and do_exit does a number of things that
      signal handlers are not permitted to do (Closes: Ubuntu#1854)
  
   -- Matt Zimmerman <[EMAIL PROTECTED]>  Mon, 11 Oct 2004 03:34:02 -0700

The ubuntu bug report is available from
<URL: https://bugzilla.ubuntu.com/show_bug.cgi?id=1854 >.  The problem
is described there as:

  when running apt-get upgrade, apt-extracttemplates never finishes
  due to gzip hanging on a futex.

  If I try to strace apt-get, it works, so I'm not able to generate a
  useful trace.  dpkg by itself on single packages seems to work
  still, so I could try to track down if it's a single package that's
  causing the trouble.

I'm quite sure this problem exist in Debian as well.  Here is the
complete patch from ubuntu:


--- gzip-1.3.5.orig/gzip.c
+++ gzip-1.3.5/gzip.c
@@ -464,16 +467,16 @@
 
     foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
     if (foreground) {
-       (void) signal (SIGINT, (sig_type)abort_gzip);
+       (void) signal (SIGINT, (sig_type)abort_gzip_signal);
     }
 #ifdef SIGTERM
     if (signal(SIGTERM, SIG_IGN) != SIG_IGN) {
-       (void) signal(SIGTERM, (sig_type)abort_gzip);
+       (void) signal(SIGTERM, (sig_type)abort_gzip_signal);
     }
 #endif
 #ifdef SIGHUP
     if (signal(SIGHUP, SIG_IGN) != SIG_IGN) {
-       (void) signal(SIGHUP,  (sig_type)abort_gzip);
+       (void) signal(SIGHUP,  (sig_type)abort_gzip_signal);
     }
 #endif
 
@@ -580,7 +586,7 @@
 #ifdef SIGPIPE
     /* Ignore "Broken Pipe" message with --quiet */
     if (quiet && signal (SIGPIPE, SIG_IGN) != SIG_IGN)
-      signal (SIGPIPE, (sig_type) abort_gzip);
+      signal (SIGPIPE, (sig_type) abort_gzip_signal);
 #endif
 
     /* By default, save name and timestamp on compression but do not
@@ -1842,14 +1849,31 @@
 }
 
 /* ========================================================================
- * Signal and error handler.
+ * Close and unlink the output file if appropriate.  This routine must be
+ * async-signal-safe.
  */
-RETSIGTYPE abort_gzip()
-{
+local void do_remove() {
    if (remove_ofname) {
        close(ofd);
        xunlink (ofname);
    }
+}
+
+/* ========================================================================
+ * Error handler.
+ */
+RETSIGTYPE abort_gzip()
+{
+   do_remove();
    do_exit(ERROR);
 }
+
+/* ========================================================================
+ * Signal handler.
+ */
+RETSIGTYPE abort_gzip_signal()
+{
+   do_remove();
+   _exit(ERROR);
+}
--- gzip-1.3.5.orig/gzip.h
+++ gzip-1.3.5/gzip.h
@@ -273,6 +274,7 @@
 
        /* in gzip.c */
 RETSIGTYPE abort_gzip OF((void));
+RETSIGTYPE abort_gzip_signal OF((void));
 
         /* in deflate.c */
 void lm_init OF((int pack_level, ush *flags));


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to