On 2013/03/16 22:49:01, minux wrote: > LGTM. is there a way to test this? I ...
11 years, 1 month ago
(2013-03-17 09:21:37 UTC)
#3
On 2013/03/16 22:49:01, minux wrote:
> LGTM. is there a way to test this?
I think a test would need to call semasleep/futexsleep (depending on OS)
directly to test the bug.
The following test fails before the patch and works after:
// +build linux freebsd
package runtime_test
import (
. "runtime"
"testing"
"time"
)
func TestFutexsleep(t *testing.T) {
ch := make(chan bool, 1)
var dummy uint32
start := time.Now()
go func() {
Entersyscall()
Futexsleep(&dummy, 0, (1<<31+100) * 1e9)
Exitsyscall()
ch <- true
}()
select {
case <-ch:
t.Errorf("futexsleep finished early after %s!", time.Since(start))
case <-time.After(time.Second):
Futexwakeup(&dummy, 1)
}
}
Issue 7876043: code review 7876043: runtime: fix tv_sec 32-bit overflows in sleep routines.
(Closed)
Created 11 years, 1 month ago by remyoudompheng
Modified 11 years, 1 month ago
Reviewers:
Base URL:
Comments: 0