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

cmd/cgo: panics when building crypto/x509 on darwin and android #28540

Closed
YoshikiShibata opened this issue Nov 1, 2018 · 4 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Android OS-Darwin Soon This needs to be done soon. (regressions, serious bugs, outages)
Milestone

Comments

@YoshikiShibata
Copy link

Please answer these questions before submitting your issue. Thanks!

What did you do?

Tried to rebuild the latest tip version on my Mac.

What did you expect to see?

The rebuilding is done successfully.

What did you see instead?

$ git rev-parse HEAD
90df37769d6441ce550443fa7e0c008d38e53455
$ ./all.bash
Building Go cmd/dist using /usr/local/go.
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/amd64.
# crypto/x509
panic: overlapping edits: [5892,5966)->"(_cgo0, _cgo1); }()", [5908,5908)->"func() *_Ctype_UInt8{ _cgo0 := data; _cgoCheckPointer(_cgo0); return "

goroutine 1 [running]:
cmd/internal/edit.(*Buffer).Bytes(0xc000066990, 0xc00033c200, 0x11e4e48, 0xe)
	/Users/yoshiki/tools/go/src/cmd/internal/edit/edit.go:79 +0x5b1
main.(*Package).writeOutput(0xc0000a8000, 0xc00009c140, 0x7ffeefbff414, 0x3a)
	/Users/yoshiki/tools/go/src/cmd/cgo/out.go:547 +0x397
main.main()
	/Users/yoshiki/tools/go/src/cmd/cgo/main.go:345 +0xaee
go tool dist: FAILED: /Users/yoshiki/tools/go/pkg/tool/darwin_amd64/go_bootstrap install -gcflags=all= -ldflags=all= std cmd: exit status 2

Does this issue reproduce with the latest release (go1.11.1)?

N/A

System details

go version devel +3553eca27c Wed Oct 31 20:08:50 2018 +0000 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/yoshiki/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/yoshiki/gocode:/Users/yoshiki/exercises/gpl:/Users/yoshiki/oak"
GOPROXY=""
GORACE=""
GOROOT="/Users/yoshiki/tools/go"
GOTMPDIR=""
GOTOOLDIR="/Users/yoshiki/tools/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version devel +3553eca27c Wed Oct 31 20:08:50 2018 +0000 darwin/amd64
GOROOT/bin/go tool compile -V: compile version devel +90df37769d Thu Nov 1 21:54:54 2018 +0000
uname -v: Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.14.1
BuildVersion:	18B75
lldb --version: lldb-1000.0.38.2
  Swift-4.2
@YoshikiShibata YoshikiShibata changed the title crypto/x509: failed to be build (latest tip version) crypto/x509: failed to be built (latest tip version) Nov 1, 2018
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) labels Nov 2, 2018
@dmitshur dmitshur added this to the Go1.12 milestone Nov 2, 2018
@dmitshur dmitshur added OS-Darwin OS-Android NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Nov 2, 2018
@dmitshur
Copy link
Contributor

dmitshur commented Nov 2, 2018

This is caused by CL 142884 (which is commit that the original issue mentions). I can reproduce locally on my Mac. /cc @ianlancetaylor @bradfitz

Strange that trybots didn't catch it.

@ianlancetaylor Can you look into this please? We can/should revert the original CL if the fix will take some time.

@dmitshur dmitshur changed the title crypto/x509: failed to be built (latest tip version) cmd/cgo: panics when building crypto/x509 on darwin and android Nov 2, 2018
@bradfitz
Copy link
Contributor

bradfitz commented Nov 2, 2018

We don't have Mac trybots at the moment.

@ianlancetaylor
Copy link
Contributor

I have a patch. Will send shortly.

@gopherbot
Copy link

Change https://golang.org/cl/146860 mentions this issue: cmd/cgo: don't update each call in place

@golang golang locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Android OS-Darwin Soon This needs to be done soon. (regressions, serious bugs, outages)
Projects
None yet
Development

No branches or pull requests

5 participants