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

x/net/http2/h2i: tool is broken #17661

Closed
RaeesBhatti opened this issue Oct 29, 2016 · 9 comments
Closed

x/net/http2/h2i: tool is broken #17661

RaeesBhatti opened this issue Oct 29, 2016 · 9 comments

Comments

@RaeesBhatti
Copy link

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

go version go1.7.1 windows/amd64

What operating system and processor architecture are you using (go env)?

Windows 10 Pro x64 1607

What did you do?

Follow the demo guide provided for h2i tool:

  • go get golang.org/x/net/http2/h2i
  • h2i google.com

What did you expect to see?

h2 debug log for connection to google.com. Something like this:

Connecting to google.com:443 ...
Connected to 74.125.224.41:443
Negotiated protocol "h2-14"
[FrameHeader SETTINGS len=18]
  [MAX_CONCURRENT_STREAMS = 100]
  [INITIAL_WINDOW_SIZE = 1048576]
  [MAX_FRAME_SIZE = 16384]
[FrameHeader WINDOW_UPDATE len=4]
  Window-Increment = 983041

What did you see instead?

Connecting to google.com:443 ...
Connected to 172.217.20.14:443
Negotiated protocol "h2"
The handle is invalid.
@bradfitz
Copy link
Contributor

I suspect the golang.org/x/crypto/ssh/terminal package doesn't work on Windows.

@bradfitz
Copy link
Contributor

Have you tried the Bash for Windows thing? Maybe it'll work there.

@RaeesBhatti
Copy link
Author

That didn't work also it results in some sys call error and then:

# golang.org/x/net/http2/hpack
/home/raees/go/src/golang.org/x/net/http2/hpack/huffman.go:14: undefined: sync.Pool

@bradfitz
Copy link
Contributor

Um, I think you're using some ancient version of Go then. I'm not convinced you're actually using Go 1.7 as you think you are.

@RaeesBhatti
Copy link
Author

I've verified the version and it is go version go1.7.1 linux/amd64 and here is the error:

raees@RAEES-PROBOOK:~$ go get golang.org/x/net/http2/h2i
# cd /home/raees/go/src/golang.org/x/crypto; git submodule update --init --recursive
package golang.org/x/crypto/ssh/terminal: read |0: interrupted system call

My guess is that Microsoft WSL team has not yet implemented the system calls used by this package.

@bradfitz
Copy link
Contributor

Okay, closing this bug then. I'm not sure there's anything I can do.

@RaeesBhatti
Copy link
Author

On a second try, it actually worked without changing anything. The output text is displayed in a wired way but the tool seems to be working fine.

@mikioh mikioh changed the title h2i tool is broken x/net/http2/h2i/: tool is broken Oct 30, 2016
@mikioh mikioh changed the title x/net/http2/h2i/: tool is broken x/net/http2/h2i: tool is broken Oct 30, 2016
@alexbrainman
Copy link
Member

I can reproduce this. And https://go-review.googlesource.com/32373 fixes my problem.

Alex

@alexbrainman alexbrainman reopened this Oct 30, 2016
@gopherbot
Copy link

CL https://golang.org/cl/32373 mentions this issue.

@golang golang locked and limited conversation to collaborators Oct 31, 2017
c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
Fixes golang/go#17661

Change-Id: Iff004af969c694dde9bc3c56add3a419ab1beac7
Reviewed-on: https://go-review.googlesource.com/32373
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants