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

Bug#755446: dash: Should pass SA_RESTART to sigaction



Package: dash
Version: 0.5.7-4
Severity: normal
User: debian-hurd@lists.debian.org
Usertags: hurd

Hello,

We have been having issues on hurd-i386 with the dash shell, we often
get "cannot create /dev/null: Interrupted system call" errors. With
research from Svante Signell, we have found that this is actually due to
a signal which unfortunately interrupts the open() call used by dash to
redirect some output. dash indeed does not set the SA_RESTART flag when
calling sigaction for SIGINT or SIGCHLD. There can probably be other
calls in dash that could get interrupted too. dash seems to take care of
at least some of them by handling EINTR, but it's much safer to simply
let the system handle all of them by setting SA_RESTART. The attached
patch does this, and fixes the issue on hurd-i386, could you consider
applying it?

For hurd developers: I have uploaded a fixed dash on debian-ports, it's
also available on:
http://people.debian.org/~sthibault/tmp/dash_0.5.7-4.1_hurd-i386.deb

Thanks,
Samuel

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.15.0 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dash depends on:
ii  debianutils  4.4
ii  dpkg         1.17.10
ii  libc6        2.19-7

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: false

-- 
Samuel
       void *memmem (const void *meule_de_foin, size_t lg_meule,
              const void *aiguille, size_t lg_aiguille);
(extrait de la page de man de memmem -- Manuel du programmeur Linux)
--- src/trap.c.orig	2014-07-20 22:02:37.000000000 +0000
+++ src/trap.c	2014-07-20 22:02:40.000000000 +0000
@@ -259,7 +259,7 @@
 		act.sa_handler = SIG_DFL;
 	}
 	*t = action;
-	act.sa_flags = 0;
+	act.sa_flags = SA_RESTART;
 	sigfillset(&act.sa_mask);
 	sigaction(signo, &act, 0);
 }

Reply to: