[GHC] #12725: T7037 is broken on Windows

#12725: T7037 is broken on Windows --------------------------------------+--------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 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: --------------------------------------+--------------------------------- `T7037` appears to fail on Windows. Namely, `stdout` appears to be empty, whereas the expected output is `"ok"`. I had suspected that the issue was the `execv` call failing but this doesn't seem to be thew case; no code after `execv` is executed. A problem for another day... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 bgamari): I forgot to mention that stdout is only empty when the test is run via the testsuite driver (e.g. `make test TEST=T7037`). Running `make T3037`directly produces `"ok"` as expected. Presumably there is something funny going on with the testsuite driver's redirection of stdout. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 bgamari): It looks like Phab:D1234 is relevant here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 bgamari):
Unfortunately my naive attempt at a minimal reproduction case failed,
{{{#!bash
$ cat >test.py <

#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 bgamari): Adapting the above to call the `T7037_main.exe` executable produced by the testsuite also fails to replicate the failure. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Ben Gamari

#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

#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 Phyx-):
This is a good testcase and it illustrates the problem nicely.
I don't think it's GCC, I think ultimately, it's some emulation layer
somewhere.
`execv` is emulated somewhere, not by calling Windows's `CreateProcess`
but probably some other posix function. I suspect it's somewhere in
https://github.com/mirror/newlib-cygwin but that wouldn't explain the
mingw version of GCC.
If you replace `execv` with `CreateProcess` the example works correctly in
all compilers
{{{
#include

#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: | ---------------------------------+-------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12725: T7037 is broken on Windows ---------------------------------+-------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: patch 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): Phab:D2684 Wiki Page: | ---------------------------------+-------------------------------------- Changes (by Phyx-): * status: new => patch * differential: => Phab:D2684 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12725: T7037 is broken on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: patch 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): Phab:D2684 Wiki Page: | Phab:D2759 -------------------------------------+------------------------------------- Changes (by Phyx-): * differential: Phab:D2684 => Phab:D2684 Phab:D2759 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12725: T7037 is broken on Windows
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: patch
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): Phab:D2684
Wiki Page: | Phab:D2759
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12725: T7037 is broken on Windows
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: patch
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): Phab:D2684
Wiki Page: | Phab:D2759
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12725: T7037 is broken on Windows -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2684 Wiki Page: | Phab:D2759 -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed @@ -3,1 +3,1 @@ - the `execv` call failing but this doesn't seem to be thew case; no code + the `execv` call failing but this doesn't seem to be the case; no code New description: `T7037` appears to fail on Windows. Namely, `stdout` appears to be empty, whereas the expected output is `"ok"`. I had suspected that the issue was the `execv` call failing but this doesn't seem to be the case; no code after `execv` is executed. A problem for another day... -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12725#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC