[GHC] #12725: T7037 is broken on Windows

GHC ghc-devs at haskell.org
Mon Oct 17 21:17:45 UTC 2016


#12725: T7037 is broken on Windows
---------------------------------+--------------------------------------
        Reporter:  bgamari       |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:  8.2.1
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by thomie):

 The version or type (msys2/mingw) of `gcc` seems to have something to do
 with it.

 I can reproduce the problem with the following version of `gcc`:
 {{{
 "C:\msys64\opt\ghc\8.0.0.20160421\lib/../mingw/bin/gcc.exe" -v
 Using built-in specs.
 COLLECT_GCC=C:\msys64\opt\ghc\8.0.0.20160421\mingw\bin/realgcc.exe
 COLLECT_LTO_WRAPPER=C:/msys64/opt/ghc/8.0.0.20160421/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0
 /lto-wrapper.exe
 Target: x86_64-w64-mingw32
 Configured with: ../gcc-5.2.0/configure --prefix=/mingw64 --with-local-
 prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32
 --target=x86_64-w64-mingw32 --with-native-system-header-
 dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-
 gxx-include-dir=/mingw64/include/c++/5.2.0 --enable-bootstrap --with-
 arch=x86-64 --with-tune=generic --enable-
 languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-
 static --enable-libatomic --enable-threads=posix --enable-graphite
 --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-
 libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-
 libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-
 multilib --enable-checking=release --disable-rpath --disable-
 win32-registry --disable-nls --disable-werror --disable-symvers --with-
 libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64
 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by
 MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-
 gnu-as --with-gnu-ld
 Thread model: posix
 gcc version 5.2.0 (Rev3, Built by MSYS2 project)
 }}}

 ok.c:
 {{{
 #include <stdio.h>

 int main() {
         printf("ok\n");
         return 0;
 }
 }}}

 main.c:
 {{{
 #include <unistd.h>

 int main(int argc, char *argv[]) {
     char * args[2] = {"ok", NULL};
     execv("./ok", args);
 }
 }}}

 test.py:
 {{{
 import subprocess
 import time

 stdout='test.out'

 def test(f):
     with open(stdout, 'w') as fout:
         subprocess.call([f], stdout=fout)

     with open(stdout, 'r') as fin:
         print('1:', fin.read().strip())

     time.sleep(0.1)

     with open(stdout, 'r') as fin:
         print('2:', fin.read().strip())

 test('./main')
 }}}

 run:
 {{{
 $ "C:\msys64\opt\ghc\8.0.0.20160421\lib/../mingw/bin/gcc.exe" -o main
 main.c
 $ "C:\msys64\opt\ghc\8.0.0.20160421\lib/../mingw/bin/gcc.exe" -o ok ok.c
 $ python test.py
 ('1:', '')     # expected: ok
 ('2:', 'ok')
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12725#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list