Skip to content

time: Lack of monotonic time support on Solaris #33674

@AudriusButkevicius

Description

@AudriusButkevicius

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions