diff mbox

PATCH: contrib/repro_fail: filter out "-ignore SIGHUP" from spawn line

Message ID 1366907428.13869.28.camel@surprise
State New
Headers show

Commit Message

David Malcolm April 25, 2013, 4:30 p.m. UTC
I'm attempting to use contrib/repro_fail to track down my testcase
failures, but the spawn lines of the testcases I'm interested are of the
form:

  spawn -ignore SIGHUP COMMAND ARGS

rather than just:

  spawn COMMAND ARGS

which leads to repro_fail's attempt to rerun the command failing with:

../src/contrib/repro_fail: line 92: -ignore: command not found

I'm attaching a patch which filters away such "-ignore SIGHUP"
directives from the spawn lines so that it can rerun the failing tests.

Seems to work, but this is the first time I've run repro_fail


Hope this is helpful
Dave

Comments

Diego Novillo April 25, 2013, 5:43 p.m. UTC | #1
On 2013-04-25 12:30 , David Malcolm wrote:

> diff --git a/contrib/ChangeLog b/contrib/ChangeLog
> index 9f4505b..01afcb5 100644
> --- a/contrib/ChangeLog
> +++ b/contrib/ChangeLog
> @@ -1,3 +1,7 @@
> +2013-04-25  David Malcolm  <dmalcolm@redhat.com>
> +
> +    * repro_fail: filter out "-ignore SIGHUP" from the spawn lines
> +

This is OK, thanks.  It works with the regular spawn lines too, right?  
(looks like it should).



Diego.
David Malcolm April 25, 2013, 6:10 p.m. UTC | #2
On Thu, 2013-04-25 at 13:43 -0400, Diego Novillo wrote:
> On 2013-04-25 12:30 , David Malcolm wrote:
> 
> > diff --git a/contrib/ChangeLog b/contrib/ChangeLog
> > index 9f4505b..01afcb5 100644
> > --- a/contrib/ChangeLog
> > +++ b/contrib/ChangeLog
> > @@ -1,3 +1,7 @@
> > +2013-04-25  David Malcolm  <dmalcolm@redhat.com>
> > +
> > +    * repro_fail: filter out "-ignore SIGHUP" from the spawn lines
> > +
> 
> This is OK, thanks.  It works with the regular spawn lines too, right?  
> (looks like it should).

All of the spawn lines in my.log files have the "-ignore SIGHUP", so I
hand-edited some to remove that part, and it does indeed work on such
lines.
diff mbox

Patch

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 9f4505b..01afcb5 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@ 
+2013-04-25  David Malcolm  <dmalcolm@redhat.com>
+
+	* repro_fail: filter out "-ignore SIGHUP" from the spawn lines
+
 2013-04-18  Diego Novillo  <dnovillo@google.com>
 
 	* validate_failures.py: Fix typo.
diff --git a/contrib/repro_fail b/contrib/repro_fail
index b28a712..9ea79f2 100755
--- a/contrib/repro_fail
+++ b/contrib/repro_fail
@@ -4,7 +4,7 @@ 
 #
 # Contributed by Diego Novillo <dnovillo@google.com>
 #
-# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -56,7 +56,9 @@  logf="$2"
 shift 2
 
 # Find the commands in LOGF that reference PATTERN.
-lines=$(grep -E "^spawn .*$pattern" $logf | sed -e 's/^spawn //')
+lines=$(grep -E "^spawn .*$pattern" $logf \
+        | sed -e 's/^spawn -ignore SIGHUP //' \
+        | sed -e 's/^spawn //')
 if [ -z "$lines" ] ; then
     echo "Could not find a spawn command for pattern $pattern"
     exit 1