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: Lack of monotonic time support on Solaris #33674

Closed
AudriusButkevicius opened this issue Aug 15, 2019 · 2 comments
Closed

time: Lack of monotonic time support on Solaris #33674

AudriusButkevicius opened this issue Aug 15, 2019 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Solaris
Milestone

Comments

@AudriusButkevicius
Copy link
Contributor

AudriusButkevicius commented Aug 15, 2019

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

1.12.17

Does this issue reproduce with the latest release?

I have no means of testing due to lack of access to the platform, but looking at the code it seems it should still happen on master.

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

solaris amd64

What did you do?

Compared two values of time.Now() not that far from each other.
The latter time.Now() value was smaller than the value acquired first.

Essentially:

	x := time.Now()
	y := time.Now()
	fmt.Println(y.Sub(x))

resulted in a negative difference

What did you expect to see?

Difference in time to be zero or positive

What did you see instead?

The time difference was negative 87ms.

It seems that the problem stems from:
https://github.com/golang/go/blob/master/src/runtime/sys_solaris_amd64.s#L42

which still uses CLOCK_REALTIME

This originates from: quic-go/quic-go#2059

@smasher164 smasher164 added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 15, 2019
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Aug 17, 2019
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 17, 2019
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 17, 2019
@ianlancetaylor
Copy link
Contributor

It does seem like we should change walltime to use CLOCK_REALTIME and change nanotime to use CLOCK_MONOTONIC. That's how it works on GNU/Linux.

@gopherbot
Copy link

Change https://golang.org/cl/199502 mentions this issue: runtime: make nanotime use monotonic clock in Solaris

@golang golang locked and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Solaris
Projects
None yet
Development

No branches or pull requests

5 participants