GNU logs - #15779, boring messages


Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#15779: timeout: Child gets SIGTTOU when run from a shell script
Resent-From: "Richard W.M. Jones" <rjones@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 01 Nov 2013 12:19:02 +0000
Resent-Message-ID: <handler.15779.B.138330828817315 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 15779
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: =?UTF-8?Q?P=C3=A1draig?= Brady <pbrady@HIDDEN>
Cc: 15779 <at> debbugs.gnu.org
X-Debbugs-Original-Cc: Report bugs to <bug-coreutils@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.138330828817315
          (code B ref -1); Fri, 01 Nov 2013 12:19:02 +0000
Received: (at submit) by debbugs.gnu.org; 1 Nov 2013 12:18:08 +0000
Received: from localhost ([127.0.0.1]:56808 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VcDfz-0004VC-88
	for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 08:18:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36943)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rjones@HIDDEN>) id 1VcDfv-0004Ue-EE
 for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 08:18:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rjones@HIDDEN>) id 1VcDfk-0007h9-SV
 for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 08:17:58 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:60340)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rjones@HIDDEN>) id 1VcDfk-0007h5-P3
 for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 08:17:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38625)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rjones@HIDDEN>) id 1VcDfg-0004PR-0e
 for bug-coreutils@HIDDEN; Fri, 01 Nov 2013 08:17:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rjones@HIDDEN>) id 1VcDfb-0007fo-7F
 for bug-coreutils@HIDDEN; Fri, 01 Nov 2013 08:17:47 -0400
Received: from mx1.redhat.com ([209.132.183.28]:45820)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rjones@HIDDEN>) id 1VcDfa-0007fj-Ut
 for bug-coreutils@HIDDEN; Fri, 01 Nov 2013 08:17:43 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
 (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
 by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA1CHgfr013513
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
 for <bug-coreutils@HIDDEN>; Fri, 1 Nov 2013 08:17:42 -0400
Received: from localhost (vpn1-5-7.ams2.redhat.com [10.36.5.7])
 by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 rA1CHfLt017430; Fri, 1 Nov 2013 08:17:41 -0400
Date: Fri, 1 Nov 2013 12:17:37 +0000
From: "Richard W.M. Jones" <rjones@HIDDEN>
Message-ID: <20131101121737.GC1887@HIDDEN>
References: <20131101081028.GA18071@HIDDEN> <52739648.1070901@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="L+ofChggJdETEG3Y"
Content-Disposition: inline
In-Reply-To: <52739648.1070901@HIDDEN>
User-Agent: Mutt/1.5.20 (2009-12-10)
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)


--L+ofChggJdETEG3Y
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id rA1CHgfr013513

On Fri, Nov 01, 2013 at 11:53:44AM +0000, P=E1draig Brady wrote:
> Probably something to do with job control
> If you `set -m` first in the script,
> then the test binary doesn't hang.

Unfortunately set -m isn't quite right for the script
we are interested in fixing:

https://github.com/libguestfs/libguestfs/blob/master/run.in#L217

> I did a version of timeout once that put the child in it's own group,
> and noted in that version that I needed to leave SIGTTOU as IGN
> as tcsetpgrp(0, getpid()) caused SIGTTOU to be sent and I wasn't sure w=
hy.

That sounds like a very similar situation to this one.  The
tty_check_change function is called all over the place, so just about
any ioctl or flush or tc* function could cause SIGTTOU to be sent.

> Maybe we should be resetting SIGTT{OU,IN} to what it was
> previously set to, rather than SIG_DFL?

The attached patch does *not* work .. don't know if you can see
any obvious mistakes.

Yesterday I looked through the strace -f output between the two cases
and came to the conclusion that it's not about signal handlers at all.
(What it's about is a mystery ...)

Rich.

--=20
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rj=
ones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/

--L+ofChggJdETEG3Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="timeout.patch2"

--- src/timeout.c.old	2013-10-31 19:44:01.719755435 +0000
+++ src/timeout.c	2013-11-01 12:01:06.074839679 +0000
@@ -370,6 +370,7 @@
   double timeout;
   char signame[SIG2STR_MAX];
   int c;
+  struct sigaction sa, sa_ttin, sa_ttou;
 
   initialize_main (&argc, &argv);
   set_program_name (argv[0]);
@@ -429,9 +430,16 @@
   /* Setup handlers before fork() so that we
      handle any signals caused by child, without races.  */
   install_signal_handlers (term_signal);
-  signal (SIGTTIN, SIG_IGN);   /* Don't stop if background child needs tty.  */
-  signal (SIGTTOU, SIG_IGN);   /* Don't stop if background child needs tty.  */
-  signal (SIGCHLD, SIG_DFL);   /* Don't inherit CHLD handling from parent.   */
+
+  /* Don't stop if background child needs tty.  */
+  sigemptyset (&sa.sa_mask);
+  sa.sa_handler = SIG_IGN;
+  sa.sa_flags = SA_RESTART;
+  sigaction (SIGTTIN, &sa, &sa_ttin);
+  sigaction (SIGTTOU, &sa, &sa_ttou);
+
+  /* Don't inherit CHLD handling from parent.   */
+  signal (SIGCHLD, SIG_DFL);
 
   monitored_pid = fork ();
   if (monitored_pid == -1)
@@ -443,9 +451,9 @@
     {                           /* child */
       int exit_status;
 
-      /* exec doesn't reset SIG_IGN -> SIG_DFL.  */
-      signal (SIGTTIN, SIG_DFL);
-      signal (SIGTTOU, SIG_DFL);
+      /* Restore old SIGTTIN/SIGTTOU handlers (RHBZ#1025269). */
+      sigaction (SIGTTIN, &sa_ttin, NULL);
+      sigaction (SIGTTOU, &sa_ttou, NULL);
 
       execvp (argv[0], argv);   /* FIXME: should we use "sh -c" ... here?  */
 

--L+ofChggJdETEG3Y--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.503 (Entity 5.503)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: "Richard W.M. Jones" <rjones@HIDDEN>
Subject: bug#15779: Acknowledgement (timeout: Child gets SIGTTOU when run
 from a shell script)
Message-ID: <handler.15779.B.138330828817315.ack <at> debbugs.gnu.org>
References: <20131101121737.GC1887@HIDDEN>
X-Gnu-PR-Message: ack 15779
X-Gnu-PR-Package: coreutils
Reply-To: 15779 <at> debbugs.gnu.org
Date: Fri, 01 Nov 2013 12:19:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-coreutils@HIDDEN

If you wish to submit further information on this problem, please
send it to 15779 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
15779: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D15779
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#15779: timeout: Child gets SIGTTOU when run from a shell script
Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 01 Nov 2013 13:49:02 +0000
Resent-Message-ID: <handler.15779.B15779.138331373525981 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 15779
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: 15779 <at> debbugs.gnu.org
Cc: "Richard W.M. Jones" <rjones@HIDDEN>
Received: via spool by 15779-submit <at> debbugs.gnu.org id=B15779.138331373525981
          (code B ref 15779); Fri, 01 Nov 2013 13:49:02 +0000
Received: (at 15779) by debbugs.gnu.org; 1 Nov 2013 13:48:55 +0000
Received: from localhost ([127.0.0.1]:56961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VcF5q-0006kz-Mo
	for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 09:48:54 -0400
Received: from mail6.vodafone.ie ([213.233.128.184]:59906)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <P@HIDDEN>) id 1VcF5o-0006ke-Lf
 for 15779 <at> debbugs.gnu.org; Fri, 01 Nov 2013 09:48:53 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAMuvc1JtTemc/2dsb2JhbAANTIM/wDWBNIMZAQEBBDIBRhALDQsJFg8JAwIBAgFFEwEHAQGICAiqAJMtBI9YBxaEGAOebo5L
Received: from unknown (HELO [192.168.1.79]) ([109.77.233.156])
 by mail3.vodafone.ie with ESMTP; 01 Nov 2013 13:48:46 +0000
Message-ID: <5273B13D.9060205@HIDDEN>
Date: Fri, 01 Nov 2013 13:48:45 +0000
From: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:17.0) Gecko/20130110 Thunderbird/17.0.2
MIME-Version: 1.0
References: <20131101081028.GA18071@HIDDEN> <52739648.1070901@HIDDEN>
 <20131101121737.GC1887@HIDDEN>
In-Reply-To: <20131101121737.GC1887@HIDDEN>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On 11/01/2013 12:17 PM, Richard W.M. Jones wrote:
> On Fri, Nov 01, 2013 at 11:53:44AM +0000, Pádraig Brady wrote:
>> Probably something to do with job control
>> If you `set -m` first in the script,
>> then the test binary doesn't hang.
> 
> Unfortunately set -m isn't quite right for the script
> we are interested in fixing:
> 
> https://github.com/libguestfs/libguestfs/blob/master/run.in#L217
> 
>> I did a version of timeout once that put the child in it's own group,
>> and noted in that version that I needed to leave SIGTTOU as IGN
>> as tcsetpgrp(0, getpid()) caused SIGTTOU to be sent and I wasn't sure why.
> 
> That sounds like a very similar situation to this one.  The
> tty_check_change function is called all over the place, so just about
> any ioctl or flush or tc* function could cause SIGTTOU to be sent.
> 
>> Maybe we should be resetting SIGTT{OU,IN} to what it was
>> previously set to, rather than SIG_DFL?
> 
> The attached patch does *not* work .. don't know if you can see
> any obvious mistakes.
> 
> Yesterday I looked through the strace -f output between the two cases
> and came to the conclusion that it's not about signal handlers at all.
> (What it's about is a mystery ...)
> 
> Rich.

The initial messages to bug-coreutils have disappeared somewhere in the ether.
Anyway the context is that if a process being controlled by timeout
gets a SIGTTOU, then it will be stopped. Note timeout handles this case
by killing the process when the timeout occurs, but that doesn't help
as the process will be stalled for the duration of the timeout.
Details at: https://bugzilla.redhat.com/1025269

The workaround was to remove the calls to set SIGTTOU to SIG_DFL
just before the child is exec'd, however I'm not sure about that
since we want to treat monitored timeout jobs like background
processes, and if you run the problematic test child as a standard
shell background job, it's stopped also:

 $ /tmp/test&
 [2]+  Stopped                 /tmp/test

The proposed workaround mentioned in the quoted text above is ineffective.

I think that since the child wants to "interact" with the tty,
that adding the --foreground option to the timeout command is appropriate here?
The caveat is that children of the monitored command will not be timed out.

thanks,
Pádraig.

p.s. I wonder would cgroups when available
give a more powerful "process tree" timeout control functionality




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 1 Nov 2013 13:54:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 01 09:54:45 2013
Received: from localhost ([127.0.0.1]:56969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VcFBV-0006to-H2
	for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 09:54:45 -0400
Received: from mail4.vodafone.ie ([213.233.128.170]:51061)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <P@HIDDEN>) id 1VcFBS-0006tX-Mm
 for control <at> debbugs.gnu.org; Fri, 01 Nov 2013 09:54:43 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApUBAEayc1JtTemc/2dsb2JhbAANTJA4sD+CcwEBCIE0gxoBAQSBCQsNFBYPCQMCAQIBRRMIAQGICKoJkzCPXxaEGAOebo5L
Received: from unknown (HELO [192.168.1.79]) ([109.77.233.156])
 by mail3.vodafone.ie with ESMTP; 01 Nov 2013 13:54:26 +0000
Message-ID: <5273B291.1070703@HIDDEN>
Date: Fri, 01 Nov 2013 13:54:25 +0000
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:17.0) Gecko/20130110 Thunderbird/17.0.2
MIME-Version: 1.0
To: control <at> debbugs.gnu.org
Subject: Re: bug#15781: timeout: Child gets SIGTTOU when run from a shell
 script
References: <20131101081028.GA18071@HIDDEN> <52739648.1070901@HIDDEN>
In-Reply-To: <52739648.1070901@HIDDEN>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

forcemerge 15781 15779
stop




Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#15779: timeout: Child gets SIGTTOU when run from a shell script
Resent-From: "Richard W.M. Jones" <rjones@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 01 Nov 2013 14:40:02 +0000
Resent-Message-ID: <handler.15779.B15779.13833167483027 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 15779
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
Cc: 15779 <at> debbugs.gnu.org
Received: via spool by 15779-submit <at> debbugs.gnu.org id=B15779.13833167483027
          (code B ref 15779); Fri, 01 Nov 2013 14:40:02 +0000
Received: (at 15779) by debbugs.gnu.org; 1 Nov 2013 14:39:08 +0000
Received: from localhost ([127.0.0.1]:57556 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VcFsR-0000ml-5z
	for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 10:39:07 -0400
Received: from mx1.redhat.com ([209.132.183.28]:48762)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rjones@HIDDEN>) id 1VcFsK-0000mF-6p
 for 15779 <at> debbugs.gnu.org; Fri, 01 Nov 2013 10:39:01 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
 (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
 by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA1EcwfU004910
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Fri, 1 Nov 2013 10:38:58 -0400
Received: from localhost (vpn1-5-7.ams2.redhat.com [10.36.5.7])
 by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 rA1EUbrh007628; Fri, 1 Nov 2013 10:30:37 -0400
Date: Fri, 1 Nov 2013 14:30:33 +0000
From: "Richard W.M. Jones" <rjones@HIDDEN>
Message-ID: <20131101143033.GD1887@HIDDEN>
References: <20131101081028.GA18071@HIDDEN> <52739648.1070901@HIDDEN>
 <20131101121737.GC1887@HIDDEN>
 <5273B13D.9060205@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <5273B13D.9060205@HIDDEN>
User-Agent: Mutt/1.5.20 (2009-12-10)
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
X-Spam-Score: -5.5 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.5 (-----)

On Fri, Nov 01, 2013 at 01:48:45PM +0000, Pádraig Brady wrote:
> The initial messages to bug-coreutils have disappeared somewhere in
> the ether.  Anyway the context is that if a process being controlled
> by timeout gets a SIGTTOU, then it will be stopped.

I don't think this is strictly accurate.

The issue I have is that timeout behaves differently when running
directly from the command line versus run from the command line via an
intermediate shell script.

  interactive -> timeout -> command   # OK
  interactive -> bash script -> timeout -> command   # SIGTTOU sent

SIGTTOU is sent in the latter case, causing the process under test to
hang (ie. T state) until the timeout happens.

This makes timeout useless for our purposes which is to cause a test
to time out if it runs for longer than 4 hours.

> I think that since the child wants to "interact" with the tty, that
> adding the --foreground option to the timeout command is appropriate
> here?  The caveat is that children of the monitored command will not
> be timed out.

Annoyingly, for reasons not well understood, this bug only manifests
itself on RHEL 6.  Although my minimal test case mentioned in
https://bugzilla.redhat.com/show_bug.cgi?id=1025269 works even
upstream, the original bug we are trying to avoid only happens on RHEL 6
(no idea why that is .. possibly qemu doesn't play funny games with
the tty upstream?)

'timeout' in RHEL 6 doesn't have --foreground.  Therefore I have
disabled timeout completely on RHEL 6 builds of libguestfs.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW





Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.