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

runtime: TestFutexsleep fails on freebsd/386 (10 and beyond) #7194

Closed
mikioh opened this issue Jan 23, 2014 · 4 comments
Closed

runtime: TestFutexsleep fails on freebsd/386 (10 and beyond) #7194

mikioh opened this issue Jan 23, 2014 · 4 comments
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Jan 23, 2014

Just a remainder.

--- FAIL: TestFutexsleep (0.00 seconds)
    futex_test.go:30: futexsleep finished early after 24.902us!
FAIL
FAIL    runtime 24.761s

But FreeBSD 10 (amd64) is fine.

% hg id
75adcf310434+ tip
@mikioh
Copy link
Contributor Author

mikioh commented Jan 23, 2014

Comment 1:

Hm, have they changed the behavior of _umtx_op syscall?

Labels changed: added repo-main.

@mikioh
Copy link
Contributor Author

mikioh commented Mar 3, 2014

Comment 2:

Looks like it's not a simple bug for remainder of timespec division on go runtime or
inside the kernel. C code does work well on freebsd10/386, hm...

Labels changed: added release-go1.3maybe.

@mikioh
Copy link
Contributor Author

mikioh commented Mar 6, 2014

Comment 3:

Sigh, looks like a simple Y2038 problem.
- Well, the epoch is 0x531823d1, test tv_sec is 0x7fffffff
- The timespecadd macro in abs_timeout_init2 simply does adding up
   https://github.com/freebsd/freebsd/blob/master/sys/sys/time.h#L252
- Yay! got 0xD31823d0
- do_wait calls abs_timeout_gethz 
   https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_umtx.c#L744
- Yay!! signed integer comparison
   https://github.com/freebsd/freebsd/blob/master/sys/sys/time.h#L248
- ETIMEDOUT
   https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_umtx.c#L769
Poor freebsd/386, tv_sec of timespec on both freebsd/amd64 and freebsd/arm is 64-bit.

@mikioh
Copy link
Contributor Author

mikioh commented Mar 7, 2014

Comment 4:

This issue was closed by revision a594f7d.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@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

3 participants