-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure recovering connection on Windows #72
Comments
@hsenag Sure, I'll check. |
@hsenag Still no luck. http-test> dist\build\http-test\http-test.exe
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
Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.0
Date: Mon, 01 Sep 2014 16:00:40 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
http-test.exe: <socket: 336>: hGetBufSome: failed (Unknown error) Here's what was linked (notice some interesting warnings): http-test> cabal repl
Preprocessing executable 'http-test' for http-test-0.1.0.0...
GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package Win32-2.3.0.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package text-1.1.0.0 ... linking ... done.
Loading package hashable-1.2.2.0 ... linking ... done.
Loading package case-insensitive-1.1.0.3 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.4.2.3 ... linking ... ghc.exe: warning: inet_ntoa from ws2_32 is linked instead of __imp_inet_ntoa
ghc.exe: warning: getnameinfo from ws2_32 is linked instead of __imp_getnameinfo
ghc.exe: warning: getaddrinfo from ws2_32 is linked instead of __imp_getaddrinfo
ghc.exe: warning: freeaddrinfo from ws2_32 is linked instead of __imp_freeaddrinfo
ghc.exe: warning: accept from ws2_32 is linked instead of __imp_accept
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc.exe: warning: WSAStartup from ws2_32 is linked instead of __imp_WSAStartup
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package HTTP-4000.2.16 ... linking ... done.
Ok, modules loaded: Main. |
Anyway I can help further to track this bug down? |
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 I'm not sure if they are relevant but it may be worth trying a recent version of the network package from github. |
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. |
Well, at least your problem is fixed :-) Hopefully the record will be useful if anyone else has a random problem like this in future. |
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. |
Do you have any of the warnings the original reporter had from 'cabal repl'?
|
Yes, I do see the same warnings. |
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. |
Could the linking warnings be related to the inability to detect the system proxy configuration? (Good find, by the way.) |
The build warning? I doubt that, proxy detection should be a runtime operation. |
Right, but I'm thinking that potentially linking the wrong functions at compile time could cause runtime failure. |
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.
The text was updated successfully, but these errors were encountered: