-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/playground: strict-time.patch does not apply conflict-free on Go 1.11.x #28036
Comments
Change https://golang.org/cl/140097 mentions this issue: |
Diff of applying the two .patches to Go 1.10.3 (mostly for my reference): diff --git a/src/runtime/os_nacl.go b/src/runtime/os_nacl.go
index 6830da4c4f..1754bd875d 100644
--- a/src/runtime/os_nacl.go
+++ b/src/runtime/os_nacl.go
@@ -293,6 +293,15 @@ type gsignalStack struct{}
var writelock uint32 // test-and-set spin lock for write
+// lastfaketime stores the last faketime value written to fd 1 or 2.
+var lastfaketime int64
+
+// lastfaketimefd stores the fd to which lastfaketime was written.
+//
+// Subsequent writes to the same fd may use the same timestamp,
+// but the timestamp must increase if the fd changes.
+var lastfaketimefd int32
+
/*
An attempt at IRT. Doesn't work. See end of sys_nacl_amd64.s.
diff --git a/src/runtime/rt0_nacl_amd64p32.s b/src/runtime/rt0_nacl_amd64p32.s
index 54e4b1de89..6ad8bea6c7 100644
--- a/src/runtime/rt0_nacl_amd64p32.s
+++ b/src/runtime/rt0_nacl_amd64p32.s
@@ -25,6 +25,6 @@ TEXT _rt0_amd64p32_nacl(SB),NOSPLIT,$16
TEXT main(SB),NOSPLIT,$0
// Uncomment for fake time like on Go Playground.
- //MOVQ $1257894000000000000, AX
- //MOVQ AX, runtime·faketime(SB)
+ MOVQ $1257894000000000000, AX
+ MOVQ AX, runtime·faketime(SB)
JMP runtime·rt0_go(SB)
diff --git a/src/runtime/sys_nacl_amd64p32.s b/src/runtime/sys_nacl_amd64p32.s
index ff4c2e7bb5..4c4d509576 100644
--- a/src/runtime/sys_nacl_amd64p32.s
+++ b/src/runtime/sys_nacl_amd64p32.s
@@ -89,6 +89,22 @@ playback:
CMPL BX, $0
JNE playback
+ MOVQ runtime·lastfaketime(SB), CX
+ MOVL runtime·lastfaketimefd(SB), BX
+ CMPL DI, BX
+ JE samefd
+
+ // If the current fd doesn't match the fd of the previous write,
+ // ensure that the timestamp is strictly greater. That way, we can
+ // recover the original order even if we read the fds separately.
+ INCQ CX
+ MOVL DI, runtime·lastfaketimefd(SB)
+
+samefd:
+ CMPQ AX, CX
+ CMOVQLT CX, AX
+ MOVQ AX, runtime·lastfaketime(SB)
+
// Playback header: 0 0 P B <8-byte time> <4-byte data length>
MOVL $(('B'<<24) | ('P'<<16)), 0(SP)
BSWAPQ AX |
It looks like strict-time.patch isn't applying because it has already been applied to the Go tree in Go 1.11 in CL 105235. If there's nothing unexpected, I expect the fix is as simple as removing strict-time.patch, it's no longer needed to be cherry-picked as of Go 1.11. |
Yup, looks like it. Only enable-fake-time.patch is needed. |
This issue has been resolved via CL 140097, and play.golang.org is running with Go 1.11.1 now: |
Go 1.11.1 has been released and should be used. Revert CL 106216 (other than the added test case), because the strict-time.patch has already been applied to the Go repository via CL 105235 in Go 1.11.1. Reference: https://groups.google.com/d/msg/golang-announce/pFXKAfoVJqw/eyDgSLVYAgAJ. Fixes golang/go#28036. Change-Id: Iacf9900a21c4b2f7bf5ac756be2cdbd8ac0be815 Reviewed-on: https://go-review.googlesource.com/c/140097 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Running
make test
with Dockerfile updated to use Go 1.11.x fails becausestrict-time.patch
no longer applies conflict-free.With Go 1.10.3 (the current version in Dockerfile), we had:
With Go 1.11.1, it currently is:
Resolving this is a prerequisite for updating the Go playground to Go 1.11.x.
CL 131435 and CL 140097 are related to this (and can't be merged without resolving this issue).
This issue is for tracking purposes. /cc @katiehockman @andybons @bradfitz
The text was updated successfully, but these errors were encountered: