All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 089: fix error caused by weird stdout buffer handling
@ 2011-02-02 15:36 Lukas Czerner
  2011-02-02 15:52 ` [PATCH v2] " Lukas Czerner
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Czerner @ 2011-02-02 15:36 UTC (permalink / raw)
  To: xfs; +Cc: hch, lczerner, esandeen

We have hit the error while running 089.

FSTYP         -- ext3
PLATFORM      -- Linux/x86_64 localhost 2.6.32-109.el6.x86_64

089 4s ... - output mismatch (see 089.out.bad)
--- 089.out     2011-02-01 13:32:13.350865206 -0500
+++ 089.out.bad 2011-02-01 15:46:50.998864578 -0500
@@ -43,7 +43,6 @@
 completed 50 iterations
 completed 50 iterations
 completed 50 iterations
-completed 50 iterations
 completed 10000 iterations
 directory entries:
 t_mtab
Ran: 089
Failures: 089
Failed 1 of 1 tests

This is not very easily reproducible, however one can hit it
eventually when running 089 in the loop. The problem is apparently, that
the output might get lost, probably due to some stdio buffer weirdness.

This commit workaround the issue by adding an optional argument to the
t_mtab to specify output file. The t_mtab output is then appended to a
file which content is then printed to the stdout as it would if no
output file is used.

With this commit applied the problem is no longer reproducible.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 089          |    9 ++++++---
 src/t_mtab.c |    8 +++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/089 b/089
index e28e099..1714bec 100755
--- a/089
+++ b/089
@@ -28,6 +28,7 @@ owner=nathans@sgi.com
 seq=`basename $0`
 echo "QA output created by $seq"
 
+mtab_output=$TEST_DIR/mtab_output
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
@@ -62,10 +63,12 @@ mount > t_mtab
 
 mtab()
 {
-	$here/src/t_mtab 50 &
-	$here/src/t_mtab 50 &
-	$here/src/t_mtab 50 &
+	rm -f $mtab_output
+	$here/src/t_mtab 50 $mtab_output &
+	$here/src/t_mtab 50 $mtab_output &
+	$here/src/t_mtab 50 $mtab_output &
 	wait
+	cat $mtab_output
 
 	$here/src/t_mtab 10000
 
diff --git a/src/t_mtab.c b/src/t_mtab.c
index 2931887..9bca954 100644
--- a/src/t_mtab.c
+++ b/src/t_mtab.c
@@ -263,6 +263,7 @@ update_mtab (void)
 int main(int argc, char **argv)
 {
 	int i, stop = 100000;
+	FILE *fout = NULL;
 
 	if (argc > 1)
 		stop = atoi(argv[1]);
@@ -270,6 +271,11 @@ int main(int argc, char **argv)
 	for (i = 0; i < stop; i++) {
 		update_mtab();
 	}
-	printf("completed %d iterations\n", stop);
+
+	if (argc > 2)
+		fout = fopen(argv[2],"a");
+	if (!fout)
+		fout = stdout;
+	fprintf(fout, "completed %d iterations\n", stop);
 	return 0;
 }
-- 
1.7.2.3

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] 089: fix error caused by weird stdout buffer handling
  2011-02-02 15:36 [PATCH] 089: fix error caused by weird stdout buffer handling Lukas Czerner
@ 2011-02-02 15:52 ` Lukas Czerner
  2011-02-16 10:40   ` Lukas Czerner
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Czerner @ 2011-02-02 15:52 UTC (permalink / raw)
  To: xfs; +Cc: hch, lczerner, esandeen

(v2: Get rid of the diff mambo-jambo in the commit description)

We have hit the error while running 089.

FSTYP         -- ext3
PLATFORM      -- Linux/x86_64 localhost 2.6.32-109.el6.x86_64

...
...
 completed 50 iterations
 completed 50 iterations
 completed 50 iterations
-completed 50 iterations
 completed 10000 iterations
 directory entries:
 t_mtab
Ran: 089
Failures: 089
Failed 1 of 1 tests

This is not very easily reproducible, however one can hit it
eventually when running 089 in the loop. The problem is apparently, that
the output might get lost, probably due to some stdio buffer weirdness.

This commit workaround the issue by adding an optional argument to the
t_mtab to specify output file. The t_mtab output is then appended to a
file which content is then printed to the stdout as it would if no
output file is used.

With this commit applied the problem is no longer reproducible.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 089          |    9 ++++++---
 src/t_mtab.c |    8 +++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/089 b/089
index e28e099..1714bec 100755
--- a/089
+++ b/089
@@ -28,6 +28,7 @@ owner=nathans@sgi.com
 seq=`basename $0`
 echo "QA output created by $seq"
 
+mtab_output=$TEST_DIR/mtab_output
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
@@ -62,10 +63,12 @@ mount > t_mtab
 
 mtab()
 {
-	$here/src/t_mtab 50 &
-	$here/src/t_mtab 50 &
-	$here/src/t_mtab 50 &
+	rm -f $mtab_output
+	$here/src/t_mtab 50 $mtab_output &
+	$here/src/t_mtab 50 $mtab_output &
+	$here/src/t_mtab 50 $mtab_output &
 	wait
+	cat $mtab_output
 
 	$here/src/t_mtab 10000
 
diff --git a/src/t_mtab.c b/src/t_mtab.c
index 2931887..9bca954 100644
--- a/src/t_mtab.c
+++ b/src/t_mtab.c
@@ -263,6 +263,7 @@ update_mtab (void)
 int main(int argc, char **argv)
 {
 	int i, stop = 100000;
+	FILE *fout = NULL;
 
 	if (argc > 1)
 		stop = atoi(argv[1]);
@@ -270,6 +271,11 @@ int main(int argc, char **argv)
 	for (i = 0; i < stop; i++) {
 		update_mtab();
 	}
-	printf("completed %d iterations\n", stop);
+
+	if (argc > 2)
+		fout = fopen(argv[2],"a");
+	if (!fout)
+		fout = stdout;
+	fprintf(fout, "completed %d iterations\n", stop);
 	return 0;
 }
-- 
1.7.2.3

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] 089: fix error caused by weird stdout buffer handling
  2011-02-02 15:52 ` [PATCH v2] " Lukas Czerner
@ 2011-02-16 10:40   ` Lukas Czerner
  2011-02-16 10:46     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Czerner @ 2011-02-16 10:40 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: hch, esandeen, xfs

On Wed, 2 Feb 2011, Lukas Czerner wrote:

> (v2: Get rid of the diff mambo-jambo in the commit description)
> 
> We have hit the error while running 089.
> 
> FSTYP         -- ext3
> PLATFORM      -- Linux/x86_64 localhost 2.6.32-109.el6.x86_64
> 
> ...
> ...
>  completed 50 iterations
>  completed 50 iterations
>  completed 50 iterations
> -completed 50 iterations
>  completed 10000 iterations
>  directory entries:
>  t_mtab
> Ran: 089
> Failures: 089
> Failed 1 of 1 tests
> 
> This is not very easily reproducible, however one can hit it
> eventually when running 089 in the loop. The problem is apparently, that
> the output might get lost, probably due to some stdio buffer weirdness.
> 
> This commit workaround the issue by adding an optional argument to the
> t_mtab to specify output file. The t_mtab output is then appended to a
> file which content is then printed to the stdout as it would if no
> output file is used.
> 
> With this commit applied the problem is no longer reproducible.

ping

> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---
>  089          |    9 ++++++---
>  src/t_mtab.c |    8 +++++++-
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/089 b/089
> index e28e099..1714bec 100755
> --- a/089
> +++ b/089
> @@ -28,6 +28,7 @@ owner=nathans@sgi.com
>  seq=`basename $0`
>  echo "QA output created by $seq"
>  
> +mtab_output=$TEST_DIR/mtab_output
>  here=`pwd`
>  tmp=/tmp/$$
>  status=1	# failure is the default!
> @@ -62,10 +63,12 @@ mount > t_mtab
>  
>  mtab()
>  {
> -	$here/src/t_mtab 50 &
> -	$here/src/t_mtab 50 &
> -	$here/src/t_mtab 50 &
> +	rm -f $mtab_output
> +	$here/src/t_mtab 50 $mtab_output &
> +	$here/src/t_mtab 50 $mtab_output &
> +	$here/src/t_mtab 50 $mtab_output &
>  	wait
> +	cat $mtab_output
>  
>  	$here/src/t_mtab 10000
>  
> diff --git a/src/t_mtab.c b/src/t_mtab.c
> index 2931887..9bca954 100644
> --- a/src/t_mtab.c
> +++ b/src/t_mtab.c
> @@ -263,6 +263,7 @@ update_mtab (void)
>  int main(int argc, char **argv)
>  {
>  	int i, stop = 100000;
> +	FILE *fout = NULL;
>  
>  	if (argc > 1)
>  		stop = atoi(argv[1]);
> @@ -270,6 +271,11 @@ int main(int argc, char **argv)
>  	for (i = 0; i < stop; i++) {
>  		update_mtab();
>  	}
> -	printf("completed %d iterations\n", stop);
> +
> +	if (argc > 2)
> +		fout = fopen(argv[2],"a");
> +	if (!fout)
> +		fout = stdout;
> +	fprintf(fout, "completed %d iterations\n", stop);
>  	return 0;
>  }
> 

-- 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] 089: fix error caused by weird stdout buffer handling
  2011-02-16 10:40   ` Lukas Czerner
@ 2011-02-16 10:46     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2011-02-16 10:46 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: esandeen, xfs

Thanks, applied.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-16 10:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 15:36 [PATCH] 089: fix error caused by weird stdout buffer handling Lukas Czerner
2011-02-02 15:52 ` [PATCH v2] " Lukas Czerner
2011-02-16 10:40   ` Lukas Czerner
2011-02-16 10:46     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.