new Windows build problem

Howard B. Golden howard_b_golden at
Fri Mar 7 23:00:26 UTC 2014

Hi Simon,

I have a hunch that the tcsetattr:... message is coming _after_ the segfault. On Windows (not in a command window) you are probably trying to pop-up a window, but what is running isn't a terminal, so the tcsetattr fails.

In other words, look for the cause of the segfault first.


 From: Simon Peyton Jones <simonpj at>
To: Simon Peyton Jones <simonpj at>; "ghc-devs at" <ghc-devs at> 
Sent: Friday, March 7, 2014 2:33 PM
Subject: RE: new Windows build problem

Is anyone able to help me here?  I have no idea how to hunt down a seg-fault in ghc-stage1.exe on Windows.
I thought of using git bisect to try to find the offending commit (though each bisection takes a couple of hours since it has to be a clean build).  But I was defeated by the fact that haddock is a separate repo, and the task of finding the haddock commit that matches the ghc commit defeated me.  There are probably other repos too, but they probably change less often.
In short, I’m stuck.  I can use Linux at work, but when I’m on the move I just have my Windows laptop.  What is frustrating is that GHC used to build on Windows just fine.  
Does anyone feel more competent than me feel able to bisect their way to the offending commit?
From:ghc-devs [mailto:ghc-devs-bounces at] On Behalf Of Simon Peyton Jones
Sent: 06 March 2014 23:42
To: ghc-devs at
Subject: RE: new Windows build problem
Actually, the two problems seem to be the same.  A fresh build from scratch yields
libraries/random/ recipe for target 'libraries/random/dist-install/build/System/Random.o' failed
make[1]: *** [libraries/random/dist-install/build/System/Random.o] Segmentation fault
Then sniping the command line that tried to build Random.o yields
"inplace/bin/ghc-stage2.exe" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Werror -Wall -H64m -O0    -package-name random- -hide-all-packages -i -ilibraries/random/. -ilibraries/random/dist-install/build -ilibraries/random/dist-install/build/autogen -Ilibraries/random/dist-install/build -Ilibraries/random/dist-install/build/autogen -Ilibraries/random/.    -optP-include -optPlibraries/random/dist-install/build/autogen/cabal_macros.h -package base- -package time-1.4.2 -O2 -XHaskell98 -XCPP -O2 -O -dcore-lint -fno-warn-amp  -fno-warn-deprecated-flags -dcore-lint  -no-user-package-db -rtsopts      -odir libraries/random/dist-install/build -hidir libraries/random/dist-install/build -stubdir libraries/random/dist-install/build   -c libraries/random/./System/Random.hs -o libraries/random/dist-install/build/System/Random.o
bash: [6536: 1 (255)] tcsetattr: Inappropriate ioctl for device
So this ioctl thing seems to be reported as a seg fault by the make system.
Running the same command from a ‘cmd’ window does give a seg-fault pop-up window.  Alas.
Running with –dshow-passes shows that it happens during code generation,
*** CorePrep:
Result size of CorePrep = {terms: 1,214, types: 912, coercions: 52}
*** Core Linted result of CorePrep:
*** Stg2Stg:
*** CodeOutput:
*** New CodeGen:
*** CPSZ:
*** CPSZ:
I am totally stuck.
From:Simon Peyton Jones 
Sent: 06 March 2014 22:11
To: ghc-devs at
Subject: new Windows build problem
Sigh.  Totally new problem with building GHC (HEAD) on Windows..  
"inplace/bin/ghc-stage2.exe" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Werror -Wall -H64m -O0    -package-name haskell98- -hide-all-packages -i -ilibraries/haskell98/. -ilibraries/haskell98/dist-install/build -ilibraries/haskell98/dist-install/build/autogen -Ilibraries/haskell98/dist-install/build -Ilibraries/haskell98/dist-install/build/autogen -Ilibraries/haskell98/.    -optP-include -optPlibraries/haskell98/dist-install/build/autogen/cabal_macros.h -package array- -package base- -package directory- -package old-locale- -package old-time- -package process- -package time-1.4.2 -Wall -XHaskell98 -O2 -O -dcore-lint -fno-warn-amp  -fno-warn-deprecated-flags -dcore-lint  -no-user-package-db -rtsopts      -odir libraries/haskell98/dist-install/build -hidir libraries/haskell98/dist-install/build -stubdir libraries/haskell98/dist-install/build   -c libraries/haskell98/./Directory.hs -o
bash: [6536: 1 (255)] tcsetattr: Inappropriate ioctl for device
What on earth is this ioctl stuff?
The above is repeatable; same command line, same result.
But I’m also getting random seg-faults when building libraries with the stage2 compiler 
libraries/random/ recipe for target 'libraries/random/dist-install/build/System/Random.o' failed
make[1]: *** [libraries/random/dist-install/build/System/Random.o] Segmentation fault
This is NOT repeatable.  Saying ‘make’ again gets further.
Any ideas?

ghc-devs mailing list
ghc-devs at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list