bug-gnulib
[Top][All Lists]
Advanced

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

Re: libidn 1.23


From: Bruno Haible
Subject: Re: libidn 1.23
Date: Sun, 27 Nov 2011 15:54:17 +0100
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Simon Josefsson wrote:
> This also came up for Libidn, it is using the latest gnulib.
> 
> > * mingw with gcc
> >
> > Fails already in the gnulib tests:
> >
> > FAIL: test-binary-io.sh
> 
> I have not seen this test fail before.

I'm seeing this test failure only in the libidn and gsasl builds, not
in the gnulib testdir.

Debugging it, it turns out that the failure comes from the libtool wrapper:

$ ./test-binary-io.exe > t-bin-out1.tmp ; echo $?
3

$ .libs/test-binary-io.exe > t-bin-out1.tmp ; echo $?
0

The exit code 3 means that the child process (.libs/test-binary-io.exe) caught
a signal (cf. lib/sys_wait.in.h).

The cause is that when the libtool wrapper is present, the wrapper process
keeps stdin, stdout, stderr open, therefore the fclose(stdout) statement
in the child process does not have the effect of flushing the file's data
to disk, because the OS is waiting for the second file handle in the parent
process to be closed as well.

The details of how the libtool wrapper program works can be seen in
.libs/lt-test-binary-io.c:

  /* execv doesn't actually work on mingw as expected on unix */
  newargz = prepare_spawn (newargz);
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);

I'm applying this fix.


2011-11-27  Bruno Haible  <address@hidden>

        binary-io tests: Avoid test failure on mingw when libtool is used.
        * tests/test-binary-io.c (main): Don't remove t-bin-out2.tmp here.
        Don't verify the size of t-bin-out1.tmp here.
        * tests/test-binary-io.sh: Verify it here.
        Reported by Simon Josefsson.

--- tests/test-binary-io.c.orig Sun Nov 27 15:51:57 2011
+++ tests/test-binary-io.c      Sun Nov 27 15:36:17 2011
@@ -46,19 +46,10 @@
       exit (1);
     ASSERT (statbuf.st_size == 6);
   }
-  unlink ("t-bin-out2.tmp");
 
   /* Test the SET_BINARY macro.  */
   SET_BINARY (1);
   fputs ("Hello\n", stdout);
-  fclose (stdout);
-  fclose (stderr);
-  {
-    struct stat statbuf;
-    if (stat ("t-bin-out1.tmp", &statbuf) < 0)
-      exit (1);
-    ASSERT (statbuf.st_size == 6);
-  }
 
   return 0;
 }
--- tests/test-binary-io.sh.orig        Sun Nov 27 15:51:58 2011
+++ tests/test-binary-io.sh     Sun Nov 27 15:37:05 2011
@@ -5,6 +5,7 @@
 
 tmpfiles="$tmpfiles t-bin-out1.tmp t-bin-out2.tmp"
 ./test-binary-io${EXEEXT} > t-bin-out1.tmp || exit 1
+cmp t-bin-out1.tmp t-bin-out2.tmp > /dev/null || exit 1
 
 rm -fr $tmpfiles
 

-- 
In memoriam George Moscone <http://en.wikipedia.org/wiki/George_Moscone>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]