Repository navigation
Failure recovering connection on Windows #72
Copy link
Copy link
Open
Description
Moved from haskell/cabal#2035.
Most pertinent: compiling and running this program with GHC 7.8.3 produces the following on my Windows 8.1 x64 machine. I have tried to reproduce on VMs but can't.
http-test> ghc --make Main.hs -o test.exe -prof -auto-all -caf-all
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking test.exe ...
http-test> .\test.exe +RTS -xc
Trying to download http://hackage.haskell.org/packages/archive/00-index.tar.gz
Sending:
GET /packages/archive/00-index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.18.0.5
Creating new connection to hackage.haskell.org
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.0
Date: Mon, 18 Aug 2014 22:29:21 GMT
Content-Type: text/plain; charset=UTF-8
Connection: keep-alive
Location: /packages/index.tar.gz
Content-Length: 0
301 - redirect
Redirecting to http://hackage.haskell.org/packages/index.tar.gz ...
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.18.0.5
Recovering connection to hackage.haskell.org
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
Main.main,
called from :Main.CAF:main
test.exe: <socket: 336>: hGetBufSome: failed (Unknown error)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
hsenag commentedon Aug 26, 2014
Could you check if this is a regression between 4000.2.16 and 4000.2.17? It turns out #68 is a regression caused by 5c1c7ba, though we don't yet know the details. As this problem is in vaguely the same area it seems worth checking.
3noch commentedon Aug 26, 2014
@hsenag Sure, I'll check.
3noch commentedon Sep 1, 2014
@hsenag Still no luck.
Here's what was linked (notice some interesting warnings):
3noch commentedon Oct 1, 2014
Anyway I can help further to track this bug down?
hsenag commentedon Oct 3, 2014
It's going to be hard unless we can isolate what is triggering it on your system.
I've recently got a new Windows 8.1 machine and I've tried your test program myself with GHC 7.8.3, both 32 bit and 64 bit versions, and it works fine. I don't get any of the ws2_32 warnings above.
Note that I do have msys2 installed, but I've also tried compiling and running directly from a command prompt.
Some random thoughts:
I also googled for your warning and found
https://ghc.haskell.org/trac/ghc/ticket/8918 and haskell/network#132
I'm not sure if they are relevant but it may be worth trying a recent version of the network package from github.
3noch commentedon Oct 4, 2014
Terrible news: I can no longer reproduce this! My only guess as to why it disappeared is some combination of the following:
My money is on the last one.
hsenag commentedon Oct 5, 2014
Well, at least your problem is fixed :-) Hopefully the record will be useful if anyone else has a random problem like this in future.
sapek commentedon Dec 8, 2014
I can reproduce the problem on my Windows Server 2012, both with cabal update and the test program. I built the test program against http 4000.2.10 (the version in Haskell Platform 2014.2.0.0).
The problem is intermittent, it doesn't fail every time. Sometimes the test program will succeed several times in a row and sometimes it will fail several times in a row.
hsenag commentedon Dec 8, 2014
Do you have any of the warnings the original reporter had from 'cabal repl'?
sapek commentedon Dec 8, 2014
Yes, I do see the same warnings.
sapek commentedon Jan 8, 2015
I think I know what the problem is. I'm getting the problem when running cabal behind a proxy. It seems like on my network the firewall allows outgoing connections w/o proxy but then kills them. On my network cabal also fails on Linux. The workaround that works both for Linux and Windows is to specify proxy via the environment variables HTTP_PROXY and HTTPS_PROXY.
I'm guessing that the HTTP library can no longer detect system proxy configuration on Windows 8.x. It appears to detect it on older versions of Windows.
3noch commentedon Jan 8, 2015
Could the linking warnings be related to the inability to detect the system proxy configuration? (Good find, by the way.)
sapek commentedon Jan 8, 2015
The build warning? I doubt that, proxy detection should be a runtime operation.
3noch commentedon Jan 8, 2015
Right, but I'm thinking that potentially linking the wrong functions at compile time could cause runtime failure.