[Top][All Lists]

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

Re: dd hangs with SIGINT

From: Guillaume Chazarain
Subject: Re: dd hangs with SIGINT
Date: Wed, 06 Apr 2005 14:03:10 +0200
User-agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324)

Paul Eggert wrote:

Guillaume Chazarain <address@hidden> writes:
With recent linux distributions (using NPTL), dd can hang waiting on
a futex when being killed.
When "dd" gets a signal, it closes the input and output files, prints
some statistics, and exits.  If it gets a second signal it exits
immediately.  I don't offhand see why this could cause a hang that was
dd's fault.
Actually, it does a bit more. As it prints a message for the first time, it has to initialize gettext, and I'm not sure this qualifies for the "do as little as possible
in a signal handler" rule.

On a side not, the problem disappears with the LD_ASSUME_KERNEL=2.4 trick.

I workaround the problem with this:

--- coreutils-5.3.0/src/dd.c
+++ coreutils-5.3.0/src/dd.c
@@ -1535,6 +1535,7 @@ main (int argc, char **argv)

+  _("Do not initialize gettext in a signal handler");
  install_handler (SIGINT, interrupt_handler);
  install_handler (SIGQUIT, interrupt_handler);
  install_handler (SIGPIPE, interrupt_handler);

but you don't have to tell me you don't like it, I know.



reply via email to

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