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

time: ParseDuration overflowing with long decimal #6617

Closed
brad-burch opened this issue Oct 18, 2013 · 4 comments
Closed

time: ParseDuration overflowing with long decimal #6617

brad-burch opened this issue Oct 18, 2013 · 4 comments
Milestone

Comments

@brad-burch
Copy link
Contributor

What steps will reproduce the problem?
http://play.golang.org/p/MYhh1EUqQX
1. time.ParseDuration with a decimal longer than 9 digits
2. build for 386 architecture
3. notice the duration has not been parsed properly

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

Which operating system are you using?
windows/linux

Which version are you using?  (run 'go version')
go1.1.2

Please provide any additional information below.

I was able to correct the issue locally by changing this line in time.ParseDuration:
            scale := 1
to
            scale := float64(1)
@minux
Copy link
Member

minux commented Oct 18, 2013

Comment 1:

tentatively labeled Go1.2Maybe.
https://golang.org/cl/15080043/

Labels changed: added go1.2maybe.

Status changed to Accepted.

@minux
Copy link
Member

minux commented Oct 20, 2013

Comment 2:

upon further testing, this issue is not specific to 32-bit arch anymore.
http://play.golang.org/p/5FIOshkpIB

Labels changed: added priority-soon, go1.2, removed priority-triage, go1.2maybe.

Status changed to Started.

@minux
Copy link
Member

minux commented Oct 22, 2013

Comment 3:

This issue was closed by revision d220c99.

Status changed to Fixed.

@adg
Copy link
Contributor

adg commented Nov 1, 2013

Comment 4:

This issue was closed by revision 2d7e5747d2df.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
adg added a commit that referenced this issue May 11, 2015
…re than 9 digits on 32-bit arch

««« CL 15080043 / fbf3b853e00b
time: fix ParseDuration overflow when given more than 9 digits on 32-bit arch
Fixes #6617.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/15080043

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20050045
@golang golang locked and limited conversation to collaborators Jun 25, 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