Re: Small test example for: cannot create /dev/null: Interrupted system call
Hello, Thanks for your investigation, I have submitted a bug report against dash. Samuel
Re: Small test example for: cannot create /dev/null: Interrupted system call
Hi! On Thu, 10 Jul 2014 23:26:24 +0200, Richard Braun rbr...@sceen.net wrote: On Thu, Jul 10, 2014 at 11:18:17PM +0200, Richard Braun wrote: All right, it looks like open() gets interrupted by SIGCHLD here. It's my understanding that signal handling is highly system-specific in such cases, but we probably want to align on what others do, as usual. By the way, it looks like it happens with dash only, not bash. I suppose dash relies on the Linux-specific behaviour of interrupting a blocked open(). See if switching to bash helps. That's also what I figured from my experimenting before coulomb crashed, http://news.gmane.org/find-root.php?message_id=%3C87wqghouoc.fsf%40schwinge.name%3E. If I remember correctly, I have never been able to reproduce the issue when switching /bin/sh from dash to bash. Svante, which is your /bin/sh? Grüße, Thomas pgpkGHQCgzhDe.pgp Description: PGP signature
Re: Small test example for: cannot create /dev/null: Interrupted system call
On Fri, 2014-07-11 at 10:13 +0200, Thomas Schwinge wrote: Hi! On Thu, 10 Jul 2014 23:26:24 +0200, Richard Braun rbr...@sceen.net wrote: On Thu, Jul 10, 2014 at 11:18:17PM +0200, Richard Braun wrote: All right, it looks like open() gets interrupted by SIGCHLD here. It's my understanding that signal handling is highly system-specific in such cases, but we probably want to align on what others do, as usual. By the way, it looks like it happens with dash only, not bash. I suppose dash relies on the Linux-specific behaviour of interrupting a blocked open(). See if switching to bash helps. That's also what I figured from my experimenting before coulomb crashed, http://news.gmane.org/find-root.php?message_id=%3C87wqghouoc.fsf%40schwinge.name%3E. If I remember correctly, I have never been able to reproduce the issue when switching /bin/sh from dash to bash. Svante, which is your /bin/sh? Hi Thomas, the shell I use is dash. Some further tests: Linux: ./test_interrupted_system_call.sh ./test_interrupted_system_call.bash ./test_interrupted_system_call.bash: line 8: 28384 Killed ./native 21 ./test_interrupted_system_call.bash: line 8: wait: pid 2 is not a child of this shell Hurd: ./test_interrupted_system_call.sh ./test_interrupted_system_call.sh: 8: ./test_interrupted_system_call.sh: cannot create /dev/null: Interrupted system call ./test_interrupted_system_call.bash ./test_interrupted_system_call.bash: line 8: 29957 Killed ./native 21 ./test_interrupted_system_call.bash: line 8: wait: pid 2 is not a child of this shell
Re: Small test example for: cannot create /dev/null: Interrupted system call
On Mon, Jul 07, 2014 at 01:29:20PM +0200, Svante Signell wrote: ./test.sh: 6: ./test.sh: cannot create /dev/null: Interrupted system All right, it looks like open() gets interrupted by SIGCHLD here. It's my understanding that signal handling is highly system-specific in such cases, but we probably want to align on what others do, as usual. -- Richard Braun
Re: Small test example for: cannot create /dev/null: Interrupted system call
On Mon, Jul 07, 2014 at 01:29:20PM +0200, Svante Signell wrote: ./test.sh: 6: ./test.sh: cannot create /dev/null: Interrupted system All right, it looks like open() gets interrupted by SIGCHLD here. It's my understanding that signal handling is highly system-specific in such cases, but we probably want to align on what others do, as usual. Is the SIGCHLD set with SA_RESTART?
Re: Small test example for: cannot create /dev/null: Interrupted system call
On Thu, Jul 10, 2014 at 11:18:17PM +0200, Richard Braun wrote: All right, it looks like open() gets interrupted by SIGCHLD here. It's my understanding that signal handling is highly system-specific in such cases, but we probably want to align on what others do, as usual. By the way, it looks like it happens with dash only, not bash. I suppose dash relies on the Linux-specific behaviour of interrupting a blocked open(). See if switching to bash helps. -- Richard Braun
Re: Small test example for: cannot create /dev/null: Interrupted system call
On Thu, Jul 10, 2014 at 02:21:06PM -0700, Roland McGrath wrote: Is the SIGCHLD set with SA_RESTART? From what I see, no. -- Richard Braun
Re: Small test example for: cannot create /dev/null: Interrupted system call
On Mon, 2014-07-07 at 13:29 +0200, Svante Signell wrote: Hi, found out when running the testsuite for elfutils that the following code reproducibly triggers the interrupted system call bug: #! /bin/sh echo 'main () { while (1) pause (); }' native.c gcc -o native -g native.c /dev/null 21 { ./native 21 native=$! ; } || native=0 kill -9 $native || : wait $native 2 /dev/null || : # sh ./test.sh ./test.sh: 6: ./test.sh: cannot create /dev/null: Interrupted system call HTH! Additional info (the above related to wait, this one to waitpid): # apt-get update ... Unpacking gpgv (1.4.18-1) over (1.4.16-1.2) ... Processing triggers for man-db (2.6.7.1-1) ... E: Couldn't wait for subprocess - waitpid (1073741928: Computer bought the farm) Connection to localhost closed by remote host. Connection to localhost closed.