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

net/http/httputil: DumpRequest() / DumpRequestOut() non-functional for SSL URLs #3135

Closed
gopherbot opened this issue Feb 26, 2012 · 9 comments
Milestone

Comments

@gopherbot
Copy link

by jason.swank:

What steps will reproduce the problem? Invoke httputil.DumpRequestOut() with a request
to an SSL URL

What is the expected output? []byte, err

What do you see instead?

sync.runtime_Semacquire(0x18913cb8, 0x18913cb8)
        /home/jswank/go/src/pkg/runtime/zsema_386.c:146 +0x29
sync.(*Cond).Wait(0x18839dc4, 0x8096506)
        /home/jswank/go/src/pkg/sync/cond.go:67 +0xa8
io.(*pipe).write(0x18839d80, 0x18934400, 0x7, 0x400, 0x0, ...)
        /home/jswank/go/src/pkg/io/pipe.go:90 +0x133
io.(*PipeWriter).Write(0x18853410, 0x18934400, 0x7, 0x400, 0x80547d2, ...)
        /home/jswank/go/src/pkg/io/pipe.go:157 +0x41
io.(*multiWriter).Write(0x18837360, 0x18934400, 0x7, 0x400, 0x18934400, ...)
        /home/jswank/go/src/pkg/io/multi.go:40 +0x7e
net/http/httputil.(*dumpConn).Write(0x18837370, 0x18934400, 0x7, 0x400, 0x2, ...)
        /home/jswank/go/src/pkg/net/http/httputil/chunked.go:0 +0x4f
crypto/tls.(*Conn).writeRecord(0x18877000, 0x15, 0x18877168, 0x2, 0x10, ...)
        /home/jswank/go/src/pkg/crypto/tls/conn.go:636 +0x1b7
----- stack segment boundary -----
crypto/tls.(*Conn).sendAlertLocked(0x18877000, 0x416, 0x400, 0x188cd400)
        /home/jswank/go/src/pkg/crypto/tls/conn.go:598 +0xb8
crypto/tls.(*Conn).sendAlert(0x18877000, 0x1893a716, 0x0, 0x0)
        /home/jswank/go/src/pkg/crypto/tls/conn.go:611 +0x6d
crypto/tls.(*Conn).readRecord(0x18877000, 0x18837316, 0x18934400, 0x59)
        /home/jswank/go/src/pkg/crypto/tls/conn.go:496 +0x2a2
crypto/tls.(*Conn).readHandshake(0x18877000, 0x1891ea16, 0x1891ea74)
        /home/jswank/go/src/pkg/crypto/tls/conn.go:668 +0x8f
crypto/tls.(*Conn).clientHandshake(0x18877000, 0x0, 0x0)
        /home/jswank/go/src/pkg/crypto/tls/handshake_client.go:51 +0x59f
crypto/tls.(*Conn).Handshake(0x18877000, 0x0, 0x0)
        /home/jswank/go/src/pkg/crypto/tls/conn.go:808 +0xc3
net/http.(*Transport).getConn(0x18834660, 0x1884ca60, 0x1884ca60, 0x0)
        /home/jswank/go/src/pkg/net/http/transport.go:367 +0x398
net/http.(*Transport).RoundTrip(0x18834660, 0x188571c0, 0x18853400, 0x0, 0x0, ...)
        /home/jswank/go/src/pkg/net/http/transport.go:153 +0x23b
net/http/httputil.DumpRequestOut(0x188571c0, 0x0, 0xbfba2b20, 0x18)
        /home/jswank/go/src/pkg/net/http/httputil/dump.go:82 +0x1de
main.main()
        /home/jswank/repos/golangfu.com/examples/httputil-test.go:25 +0x1fb
created by _rt0_386
        /home/jswank/go/src/pkg/runtime/asm_386.s:80 +0xc0


Which compiler are you using (5g, 6g, 8g, gccgo)?

Which operating system are you using? Linux x86

Which revision are you using?  (hg identify)
Both "weekly-2012-02-22" and "tip" return this error.

Please provide any additional information below. Attached example program.

Attachments:

  1. httputil-test.go (913 bytes)
@robpike
Copy link
Contributor

robpike commented Feb 26, 2012

Comment 1:

Labels changed: added priority-go1, go1-must, removed priority-triage.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Feb 26, 2012

Comment 2:

Owner changed to builder@golang.org.

@dsymonds
Copy link
Contributor

Comment 3:

Labels changed: added packagebug.

Owner changed to @bradfitz.

@bradfitz
Copy link
Contributor

Comment 4:

http://golang.org/cl/5709050

@bradfitz
Copy link
Contributor

Comment 5:

This issue was closed by revision 1b1039a.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Feb 29, 2012

Comment 6:

I don't believe the fix is safe.  Reopening so we don't forget.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Mar 1, 2012

Comment 7:

*** Submitted as
http://code.google.com/p/go/source/detail?r=3cfa14662422 ***
net/http/httputil: make https DumpRequestOut less racy
It's still racy in that it mutates req.Body, though.  *shrug*
R=golang-dev, rsc
CC=golang-dev
http://golang.org/cl/5709054

Status changed to Fixed.

@gopherbot
Copy link
Author

Comment 8 by pkorotkov:

Could you please specify what's wrong with the current implementation and why you can't
exclude the race? Perhaps, it's good idea to make a relevant note the documentation
about possible race in some cases.

@rsc
Copy link
Contributor

rsc commented Mar 2, 2012

Comment 9:

There's nothing wrong with the current implementation: the second CL
fixed the race.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

5 participants