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: inconsistent definition for func runtime.memclrNoHeapPointers during import #19185

Closed
davidlazar opened this issue Feb 19, 2017 · 2 comments

Comments

@davidlazar
Copy link
Member

This is purposefully one commit behind 1f77db9 and what we would see after we fix #19184.

$ go version
go version devel +8833af3f4b Wed Feb 15 21:14:37 2017 +0000 linux/amd64

In the runtime directory:

$ go test -a -short -gcflags '-l=4'
# runtime_test
./callers_test.go:8: cannot import "runtime" due to version skew - reinstall package (inconsistent definition for func runtime.memclrNoHeapPointers during import
	func(*byte, uintptr)
	func(unsafe.Pointer, uintptr))
FAIL	runtime [build failed]

One potential solution is to mark MemclrBytes noinline, but it's not clear if that is the right long-term solution.

@gopherbot
Copy link

CL https://golang.org/cl/37257 mentions this issue.

@cherrymui
Copy link
Member

The compiler thinks memclrNoHeapPointers has signature func(*byte, uintptr) (https://go.googlesource.com/go/+/master/src/cmd/compile/internal/gc/builtin/runtime.go#130), whereas the actual function in runtime has signature func(unsafe.Pointer, uintptr).
CL https://golang.org/cl/37257 changes the compiler's copy to match the runtime.
However, there are other functions marked as taking *byte or *any in the compiler, but actually takes a pointer to a specific runtime type, or arbitrary pointer type. There might be also problem if they get imported through inlining. Maybe we should let bimport's check allow this case?

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