-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/idna: ToASCII bug causes memory and cpu leak #22184
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
Comments
/cc @mpvl |
Reproduces on linux/amd64 (x/net/idna master).
|
any updates here? |
So this is an issue in the |
@ALTree Can I take a look this issue? |
@corona10 sure! I'm not working on this. |
Change https://golang.org/cl/73610 mentions this issue: |
@ALTree I submitted the patch PTAL! |
Change https://golang.org/cl/73630 mentions this issue: |
Change https://golang.org/cl/73730 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.9.1 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
program exit with an error of
no such host
orinvalid domain name
in go1.8
in go1.7 or before
What did you see instead?
program fataled until oom, and more than 100% cpu usage.
the problem code is:
https://github.com/golang/go/blob/release-branch.go1.9/src/vendor/golang_org/x/net/idna/tables.go#L484-L487
https://github.com/golang/go/blob/release-branch.go1.9/src/vendor/golang_org/x/net/idna/idna.go#L401-L404
https://github.com/golang/go/blob/release-branch.go1.9/src/vendor/golang_org/x/net/idna/idna.go#L423
len(s) == 1
andlookupString()
return0, 0
;in
validateAndMap
, sz=0, i+=0, i not changed, so the for loop cannot break, this is a cpu leak;v=0
hitselect unknown
branch, callb = append(b, "\ufffd"...)
, this is a memory leak.The text was updated successfully, but these errors were encountered: