Skip to content
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

internal/poll: AcceptEx bug on unpatched Windows 8 / Server 2012 #41251

Closed
zhangyoufu opened this issue Sep 7, 2020 · 9 comments
Closed

internal/poll: AcceptEx bug on unpatched Windows 8 / Server 2012 #41251

zhangyoufu opened this issue Sep 7, 2020 · 9 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@zhangyoufu
Copy link
Contributor

zhangyoufu commented Sep 7, 2020

A known issue exists in afd.sys on Windows 8 / Server 2012 that may stop TCP sockets from accepting incoming connections. KB2779768 is required to fix this issue. This may worth a workaround in Go runtime.

The root cause of this issue is documented in a SQL Server KB article KB2919863.
This issue can also be found on stackoverflow and a blog article.

What version of Go are you using (go version)?

$ go version
go version go1.15.1 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system are you using?

Unpatched Windows Server 2012 (w/o R2), build 6.2.9200

What did you do?

go test -v -run TestScript/mod_verify cmd/go

What did you expect to see?

The test should pass.

What did you see instead?

The test proxy did not respond to the HTTP request (observed in Wireshark).
The test proxy is not aware of incoming TCP connection, and there are two blocking ReadFile calls around (observed in Rohitab API Monitor).
The test timeouts after 9 minutes.

log
=== RUN   TestScript
=== RUN   TestScript/mod_verify
=== PAUSE TestScript/mod_verify
=== CONT  TestScript/mod_verify
go test proxy running at GOPROXY=http://127.0.0.1:49158/mod
    script_test.go:210:
        WORK=$WORK
        PATH=C:\Users\ZHANGY~1\AppData\Local\Temp\cmd-go-test-838701599\tmpdir16
2621170\testbin;C:\go1.15.1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System
32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\
mingw64\bin
        USERPROFILE=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
        GOCACHE=C:\Users\zhangyoufu\AppData\Local\go-build
        GODEBUG=
        GOEXE=.exe
        GOEXPSTRING=framepointer
        GOOS=windows
        GOPATH=$WORK\gopath
        GOPROXY=http://127.0.0.1:49158/mod
        GOPRIVATE=
        GOROOT=C:\go1.15.1
        GOROOT_FINAL=
        TESTGO_GOROOT=C:\go1.15.1
        GOSUMDB=localhost.localdev/sumdb+00000c67+AcTrnkbUA+TU4heY3hkjiSES/DSQni
BqIeQ/YppAUtK6
        GONOPROXY=
        GONOSUMDB=
        PWD=$WORK\gopath\src
        TMP=$WORK\tmp
        devnull=NUL
        goversion=1.15
        :=;
        SYSTEMROOT=C:\Windows
        WINDIR=C:\Windows

        > env GO111MODULE=on
        > [short] skip
        # With good go.sum, verify succeeds by avoiding download. (539.992s)
        > cp go.sum.good go.sum
        > go mod verify
        [context deadline exceeded]
        FAIL: testdata\script\mod_verify.txt:6: test timed out while running com
mand

--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/mod_verify (540.03s)
FAIL
FAIL    cmd/go  541.760s
FAIL
@ianlancetaylor
Copy link
Contributor

Is there a way to work around the problem other than applying the Windows patch?

@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows labels Sep 7, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone Sep 7, 2020
@davecheney
Copy link
Contributor

According this page

https://github.com/golang/go/wiki/MinimumRequirements#windows

Windows server 2012, non r2 is not supported. Also please note that Microsoft’s support for this version terminated in January 2020

@zhangyoufu
Copy link
Contributor Author

@davecheney Windows Server 2012 (non-R2) is supported by Go per my understanding. The doc only says that Go team tests on 2012 R2.

@zhangyoufu
Copy link
Contributor Author

zhangyoufu commented Sep 8, 2020

Is there a way to work around the problem other than applying the Windows patch?

@ianlancetaylor The blog article mentioned that avoid blocking I/O on the thread issued AcceptEx. I didn’t test that. And I don’t know if it’s acceptable to re-introduce ioSrv for Windows netpoll.

@ianlancetaylor
Copy link
Contributor

I think the correct resolution here is to simply require R2 for Windows 2012. It came out seven years ago, it doesn't seem like an unreasonable requirement.

@zhangyoufu
Copy link
Contributor Author

Windows Server 2012 (non-R2) is supported by Microsoft until 2023-10-10.

@ianlancetaylor
Copy link
Contributor

But the question is: why should we support it? The Go team has limited resources and we can't support everything. What is the case for supporting Windows 2012 without R2?

@zhangyoufu
Copy link
Contributor Author

I'm not asking Go team to continue support for Windows 2012 without R2.
I just want to correct @davecheney's comment (Microsoft’s support for this version terminated in January 2020).

The whole ecosystem that relies on Windows does not move as fast as Go, especially in some enterprise environment.
Not my fault, not Go's fault, but someone (it's me) just have to compose dirty hacks to support outdated Windows. Sigh.

@ianlancetaylor
Copy link
Contributor

Understood, thanks.

@golang golang locked and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
None yet
Development

No branches or pull requests

4 participants