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: integer overflow in ParseDuration #3374

Closed
gopherbot opened this issue Mar 22, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@gopherbot
Copy link

commented Mar 22, 2012

by jsawczuk:

Using the weekly.2012-03-13 build, I'm trying to parse some duration strings and came up
with what I think are unexpected results. I've attached a source file with 4 test cases,
in which cases 1 and 3 fail, but 2 and 4 succeed. I haven't been able to find in
documentation why this would be the case.

What steps will reproduce the problem?
1. Run the attached file which specify the test cases.

What is the expected output?
I would expect all four cases to succeed in returning valid durations.

What do you see instead?
Cases 1 and 3 fail, while cases 2 and 4 succeed.

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

Which operating system are you using?
Tested on Mac OS X and Ubuntu Linux (64-bit)

Which revision are you using?  (hg identify)
3cdba7b0650c weekly/weekly.2012-03-13

Please provide any additional information below.



Let me know if I can provide any further information or if I'm missing something here.

Attachments:

  1. duration.go (423 bytes)
@robpike

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2012

Comment 1:

This is integer overflow. The value must be 31 bits or shorter, which is unfortunate.
Worth fixing after Go 1.

Labels changed: added priority-later, packagechange, removed priority-triage.

Status changed to Accepted.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2012

Comment 3:

Labels changed: added go1.1.

@dsymonds

This comment has been minimized.

Copy link
Member

commented Oct 8, 2012

Comment 4:

Owner changed to @dsymonds.

@dsymonds

This comment has been minimized.

Copy link
Member

commented Oct 14, 2012

Comment 5:

This issue was closed by revision f2045aa.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015

@rsc rsc removed the go1.1 label Apr 14, 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.
You can’t perform that action at this time.