bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gzip 1.3.6 aborts on SIGPIPE with -q option


From: Jakub Bogusz
Subject: gzip 1.3.6 aborts on SIGPIPE with -q option
Date: Fri, 1 Dec 2006 22:45:08 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

When run on Linux/glibc 2.x or other system with BSD signal semantics,
gzip 1.3.6 aborts when it's called with -q option and receives
a SIGPIPE. It happens often when using zless and quitting before
reaching the end of archive.

It can also happen with other signals caught by abort_gzip_signal().
It's caused by trying to raise a signal with its own handler, when the
signal is still blocked - so raise() is ignored and abort() called.
Possible fix could be to unblock signal before raise() using
sigprocmask() or install signal handler using sigaction() with SA_NODEFER
instead of signal().

Attached patch does the first, i.e. adds sigprocmask() call before
raise(). Tested on Linux 2.6.x/glibc 2.5; maybe it should be adjusted
by adding some #ifdefs and configure checks for sigprocmask() support
in OS.


-- 
Jakub Bogusz    http://qboosh.pl/

Attachment: gzip-raise-unblock.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]