-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: failed build, compile and use compiled binary on macOS Sierra Beta 4(16A270f) #16570
Comments
Oh, I forgot. If that problem was the macOS feature specification rather than a macOS's bug, I think the very impact issue. |
From an email thread,
@zchee, thanks for confirming that it does indeed break things. |
@zchee, can you test this patch: diff --git a/src/runtime/sys_darwin_386.s b/src/runtime/sys_darwin_386.s
index 83f4709..9f877fc 100644
--- a/src/runtime/sys_darwin_386.s
+++ b/src/runtime/sys_darwin_386.s
@@ -199,6 +199,7 @@ systime:
LEAL 12(SP), AX // must be non-nil, unused
MOVL AX, 4(SP)
MOVL $0, 8(SP) // time zone pointer
+ MOVL $0, DX // required as of Sierra; Issue 16570
MOVL $116, AX
INT $0x80
CMPL AX, $0
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
index e4837ce..ea2cc06 100644
--- a/src/runtime/sys_darwin_amd64.s
+++ b/src/runtime/sys_darwin_amd64.s
@@ -157,6 +157,7 @@ systime:
// Fall back to system call (usually first call in this thread).
MOVQ SP, DI
MOVQ $0, SI
+ MOVQ $0, DX // required as of Sierra; Issue 16570
MOVL $(0x2000000+116), AX
SYSCALL
CMPQ AX, $0 It's at least harmless for me on OS X 10.11. |
CL https://golang.org/cl/25400 mentions this issue. |
@bradfitz Thanks! oh, it's known issue :) Now tested that patch only
diff --git a/src/runtime/sys_darwin_386.s b/src/runtime/sys_darwin_386.s
index 83f4709..f86840e 100644
--- a/src/runtime/sys_darwin_386.s
+++ b/src/runtime/sys_darwin_386.s
@@ -199,6 +199,7 @@ systime:
LEAL 12(SP), AX // must be non-nil, unused
MOVL AX, 4(SP)
MOVL $0, 8(SP) // time zone pointer
+ MOVQ $0, DX // required as of Sierra; Issue 16570
MOVL $116, AX
INT $0x80
CMPL AX, $0
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
index e4837ce..ea2cc06 100644
--- a/src/runtime/sys_darwin_amd64.s
+++ b/src/runtime/sys_darwin_amd64.s
@@ -157,6 +157,7 @@ systime:
// Fall back to system call (usually first call in this thread).
MOVQ SP, DI
MOVQ $0, SI
+ MOVQ $0, DX // required as of Sierra; Issue 16570
MOVL $(0x2000000+116), AX
SYSCALL
CMPQ AX, $0
./make.bash : |
@zchee, no, my fault probably. We'll take a look tomorrow. Thanks for the report and for trying that patch. |
@bradfitz I got it. Thanks :) and FYI, I have macOS Sierra Beta1 ~ Beta4 upgrade |
It's true that there are some changes in gettimeofday but is this related to runtime.systime in sys_darwin_amd64.s fixed in #16272 ? I wonder if it's about runtime.switchtoM in asm_amd64.s according to the error messages. |
@sekimura I think so, too. It's have not to the related of As @bradfitz says, surely libsystem_kernel.dylib has been changed, but It does not hit those that related to I cannot read |
This may not be relevant... I don't know where to use. but just to be sure, post the those disassemble results.
libsystem_kernel.dylib`__gettimeofday:
libsystem_kernel.dylib[0x195e1] <+0>: movl $0x2000074, %eax ; imm = 0x2000074
libsystem_kernel.dylib[0x195e6] <+5>: movq %rcx, %r10
libsystem_kernel.dylib[0x195e9] <+8>: syscall
libsystem_kernel.dylib[0x195eb] <+10>: jae 0x195f5 ; <+20>
libsystem_kernel.dylib[0x195ed] <+12>: movq %rax, %rdi
libsystem_kernel.dylib[0x195f0] <+15>: jmp 0x12d8f ; cerror_nocancel
libsystem_kernel.dylib[0x195f5] <+20>: cmpq $0x0, %rax
libsystem_kernel.dylib[0x195f9] <+24>: je 0x19603 ; <+34>
libsystem_kernel.dylib[0x195fb] <+26>: movq %rax, (%rdi)
libsystem_kernel.dylib[0x195fe] <+29>: movl %edx, 0x8(%rdi)
libsystem_kernel.dylib[0x19601] <+32>: xorl %eax, %eax
libsystem_kernel.dylib[0x19603] <+34>: retq
libsystem_kernel.dylib`__gettimeofday:
libsystem_kernel.dylib[0x195d9] <+0>: movq $0x0, %rdx
libsystem_kernel.dylib[0x195e0] <+7>: movl $0x2000074, %eax ; imm = 0x2000074
libsystem_kernel.dylib[0x195e5] <+12>: movq %rcx, %r10
libsystem_kernel.dylib[0x195e8] <+15>: syscall
libsystem_kernel.dylib[0x195ea] <+17>: jae 0x195f4 ; <+27>
libsystem_kernel.dylib[0x195ec] <+19>: movq %rax, %rdi
libsystem_kernel.dylib[0x195ef] <+22>: jmp 0x12d6f ; cerror_nocancel
libsystem_kernel.dylib[0x195f4] <+27>: cmpq $0x0, %rax
libsystem_kernel.dylib[0x195f8] <+31>: je 0x19602 ; <+41>
libsystem_kernel.dylib[0x195fa] <+33>: movq %rax, (%rdi)
libsystem_kernel.dylib[0x195fd] <+36>: movl %edx, 0x8(%rdi)
libsystem_kernel.dylib[0x19600] <+39>: xorl %eax, %eax
libsystem_kernel.dylib[0x19602] <+41>: retq
libsystem_kernel.dylib[0x19603] <+42>: nop
libsystem_kernel.dylib`__gettimeofday_with_mach:
libsystem_kernel.dylib[0x195c4] <+0>: movl $0x2000074, %eax ; imm = 0x2000074
libsystem_kernel.dylib[0x195c9] <+5>: movq %rcx, %r10
libsystem_kernel.dylib[0x195cc] <+8>: syscall
libsystem_kernel.dylib[0x195ce] <+10>: jae 0x195d8 ; <+20>
libsystem_kernel.dylib[0x195d0] <+12>: movq %rax, %rdi
libsystem_kernel.dylib[0x195d3] <+15>: jmp 0x12d94 ; cerror
libsystem_kernel.dylib[0x195d8] <+20>: retq |
@zchee the error you are reporting is coming from the Go 1.4 distribution you are using. (Note the first position listed in the stack trace, /usr/local/go/src/runtime/mheap.c:692.) If you are applying @bradfitz's patch to your GOROOT, it won't fix the error you are seeing because the 1.4 binary is already built and not being rebuilt. Do you have another machine not running Beta4? If so, could you please:
If you don't have another machine I could build you a patched Go release and put it somewhere for you to download. |
@crawshaw Thanks for the advice! I understood your intentions regarding that.
Thanks. As a result, If the workaround is successful, does it mean that We must use the patched bootstrap go toolchain on the macOS? Sorry, it's off topic. Can I ask a question? I didn't understand the reason that why to use the 1.4 version to bootstrap toolchain than 1.6 stable or etc. So simply, shorten the time to build the latest Golang? or Will it also affect the latest(devel) go binary of the performance if we use it? |
Go used to be written in C, so it could be built from source on a system that didn't have Go already on it. Starting with Go 1.5, this was changed; now Go is written in Go, and you need a Go installation to build Go from source. So if you want to build the latest version of Go entirely from source, you have two options:
|
@andlabs Thanks. But why gophers use the 1.4(.3) to bootstrap? Go's default |
It would be, but you would need to use a binary distribution, such as the downloads on golang.org. If Docker comes with 1.5 by default, you can use that by just setting the env var. |
Let's move unrelated discussion to the mailing list. See https://golang.org/wiki/Questions |
Wanted to add this also happens with 1.6.3 |
I just tried building on beta 4 with the patch above and it fails at the following test.
|
@definitelycarter, yes, it should happen with all previous Go releases. See #16352 also. |
@MattAitchison, interesting. Does that test fail consistently? |
@bradfitz Yes it does. |
I can confirm. I cannot bootstrap on 10.12b4 using any binary distribution. Looks like https://go-review.googlesource.com/#/c/24967 is re-emerging. I don't understand what Apple's trying to do here — basically, since FOREVER, Is there a better fix now in place? Or... what? |
@bradfitz Here is the entire log. |
I should mention I've tried bootstrapping from every binary release from 1.4.2 to 1.7rc4. |
This is a cherry-pick of https://go-review.googlesource.com/25400 to the release-branch-go1.4 macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes #16570 Change-Id: I714325a7749a145d23cf03251db38196ac9c481a Reviewed-on: https://go-review.googlesource.com/31750 Reviewed-by: Brad Fitzpatrick <[email protected]>
macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes golang#16570 Change-Id: I9f537e552682045325cdbb68b7d0b4ddafade14a Reviewed-on: https://go-review.googlesource.com/25400 Reviewed-by: David Crawshaw <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Quentin Smith <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> Reviewed-by: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
@bradfitz I'm running into these issues with a bunch of golang binaries that have been built against go1.5/1.6. I saw a note about fixes being backported to 1.4 (but not released yet?). Are there similar plans to backport fixes to 1.6.x and 1.5.x? If so, any idea when to the expect official releases? Specifically, I tried building via gox on golang1.6.3 (which claimed sierra compatibility on https://golang.org/doc/devel/release.html) using a linux container, am still getting crashes. Homebrew won't allow me to install 1.6.3 on my sierra mac to test non-gox, due to compatibility issues. |
@geofffranks I don't think they'll be backported to 1.6.x and 1.5.x. See #17234 (and #16352). |
I'm curious why the backport to 1.4 (but not other also unsupported golang versions), and why the golang website claims 1.6.3 has macOS Sierra compatibility then (https://golang.org/doc/devel/release.html#go1.6.minor https://golang.org/doc/devel/release.html#go1.6.minor)...
|
@geofffranks, the claim that macOS Sierra works on Go 1.6.3 was made prematurely: Go 1.6.3 was released in July and Sierra was released in September. Go 1.6.3 worked with the available Sierra beta at the time but changes made in Sierra after that broke the support. In retrospect, it was a mistake to claim support for a future operating system that was not yet officially released. We are going to update the notes. See #17234 for additional notes about Sierra and Go 1.6.3, including a Git ref for the adventurous. |
Ok, thanks!
|
I had this issue on my MAC and just reinstalling the GO package fixed it: https://golang.org/doc/install |
This is a cherry-pick of https://go-review.googlesource.com/25400 to the release-branch-go1.4 macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes golang#16570 Change-Id: I714325a7749a145d23cf03251db38196ac9c481a Reviewed-on: https://go-review.googlesource.com/31750 Reviewed-by: Brad Fitzpatrick <[email protected]>
This is a cherry-pick of https://go-review.googlesource.com/25400 to the release-branch-go1.4 macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes golang#16570 Change-Id: I714325a7749a145d23cf03251db38196ac9c481a Reviewed-on: https://go-review.googlesource.com/31750 Reviewed-by: Brad Fitzpatrick <[email protected]>
This is a cherry-pick of https://go-review.googlesource.com/25400 to the release-branch-go1.4 macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes golang#16570 Change-Id: I714325a7749a145d23cf03251db38196ac9c481a Reviewed-on: https://go-review.googlesource.com/31750 Reviewed-by: Brad Fitzpatrick <[email protected]>
This is a cherry-pick of https://go-review.googlesource.com/25400 to the release-branch-go1.4 macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes golang#16570 Change-Id: I714325a7749a145d23cf03251db38196ac9c481a Reviewed-on: https://go-review.googlesource.com/31750 Reviewed-by: Brad Fitzpatrick <[email protected]>
This is a cherry-pick of https://go-review.googlesource.com/25400 to the release-branch-go1.4 macOS Sierra beta4 changed the kernel interface for getting time. DX now optionally points to an address for additional info. Set it to zero to avoid corrupting memory. Fixes golang#16570 Change-Id: I714325a7749a145d23cf03251db38196ac9c481a Reviewed-on: https://go-review.googlesource.com/31750 Reviewed-by: Brad Fitzpatrick <[email protected]>
At first, I'm not good at English. If you can't understand, please point out.
1 . What version of Go are you using (
go version
)?go version devel +f575873 Tue Aug 2 01:58:14 2016 +0000 darwin/amd64
2 . What operating system and processor architecture are you using (
go env
)?3 . What did you do?
On macOS Sierra Beta 4(16A270f), all of the go compiled tools can not be used.
Broken go runtime on Sierra again :(
It's related upgrade of macOS kernel to Beta 4, also there is no direct relationship to Xcode and Command Line Tools.
It is certainly. Because I know way of the downgrade to macOS kernel and I had tested.
Also, now my kernel version is the downgrade to
Beta3 (16A254g)
.but If you want to more debug, I can try to upgrade again and any debugging.
The error log is described below. Please click to ▶︎.
First and second is building
go
binary use./make.bash
.Second is set
GODEBUG=gctrace=1,schedtrace=100,scheddetail=1
because suggests at #16272 (comment). But maybe it's for__commpage_gettimeofday
?If so, and if you want to more debug log with other flags, Please feel free to instruct.
./all.bash
also fail in the same way, so does not put it.That result will occur
runtime.MSpanList_Insert
error and more.env:
$GOROOT_BOOTSTRAP=/usr/local/bootstrap/go/go1.4.3
which clang
:/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
./make.bash
:GODEBUG=gctrace=1,schedtrace=100,scheddetail=1 ./make.bash
:Next is compiling package, e.g.
gb
.env:
$GOROOT=/usr/local/bootstrap/go/go1.7rc3
/usr/local/go/bin/go
was broken.which clang
:/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
go get -u -v -x github.com/constabulary/gb/...
:Finally, use
peco
cli tools.https://asciinema.org/a/81537
or
I don't know why to occur that error and go runtime source, but I think related goroutine.
Because If does not use the goroutine (than
main
) cli tool, does not occur. such asgotype
.4 . What did you expect?
Build the go binary to complete successfully, also package.
and use go compiled tools successfully.
5 . What did you see instead?
build, compile, use cli.
The text was updated successfully, but these errors were encountered: