-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: internal compiler error: no function definition for [0xc42181a5a0] #23701
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
Comments
I assume this does not affect 1.9? |
Correct. |
Have you by any chance been able to come up with a small program/package to reproduce the same crash? That project is large and a bit complex to build, so it would help the compiler developers. |
I tried, but was not able to produce a reduced case. The defining feature
of this code is a helpers_test.go file that adds a test-only exported
method to an exported structure, but there are many examples of this
pattern in CockroachDB and this is the only one that crashes so another
ingredient must be required.
…On Feb 5, 2018 13:15, "Daniel Martí" ***@***.***> wrote:
Have you by any chance been able to come up with a small program/package
to reproduce the same crash? That project is large and a bit complex to
build, so it would help the compiler developers.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#23701 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABdsPOMdiXpfxJK9PBfFj70ANqwlsgAZks5tR0UqgaJpZM4R5rKE>
.
|
Note that adding methods in a |
@dgryski that's incorrect - in this case we're not going across packages, and this pattern works in Go 1.9. |
Same issue on my side with the following minimal example: $ cat a/a.go import "b" type Type struct {} func (*Type) M() b.T { return 0 } func (*T) Method() *T { return nil } type T int type I interface { M() T } $ cat b/b_test.go import ( func TestBroken(*testing.T) { |
package a
import "b"
type Type struct {}
func (*Type) M() b.T { return 0 }
package b
func (*T) Method() *T { return nil }
package b
type T int
type I interface { M() T }
package b_test
import (
"testing"
"a"
. "b"
)
func TestBroken(*testing.T) {
x := new(T)
x.Method()
_ = new(a.Type)
} Ah, I guess a second package is required. |
@ianlancetaylor I think the problem is 1.10 breaks an unsupported feature. |
I think it's OK to break this in Go 1.10 but we need a better error message. |
Going to be incovenient for CockroachDB.
|
I still think that it's OK to reject methods in tests if we end up needing to do that, but that doesn't look fundamental here. This looks to me like the go command is not rebuilding dependencies of test packages correctly. There was a related bug in this code a few weeks ago, and this report looks like a variant of that. It should be possible to fix this new bug and leave the disposition of #6204 for a less hurried time. I'll take a look at this for 1.10rc2, which we are thinking about doing on Wednesday. |
Change https://golang.org/cl/92215 mentions this issue: |
This was easy to make work after the simplifications done for the build cache: basically a 1/2-line change to cmd/go, simplifying an if condition. Given that we can now rebuild perfectly, I see no reason to go out of our way to disallow adding methods in test files, even though I might wish I had done that 5+ years ago. |
Should the release notes be updated to mention adding methods in a test file is now "officially" supported? |
Before we put it in the release notes we need to put it in the docs. Actually I'm not sure what the release notes would say. "This thing that used to work still works." Personally I think this is doc-worthy but not release-notes-worthy. |
Workaround go vet 'internal compiler error' when methods are defined in test files and cross package imports are used. The original ticket is: golang/go#23701 Although it is supposed to be fixed in 1.10 it does not appear to be so. Error reported by go vet: ./ifacestate_test.go:120:29: internal compiler error: no function definition for [0xc420a2fc80] FUNC-method(*ifacestate.InterfaceManager) func() Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Workaround go vet 'internal compiler error' when methods are defined in test files and cross package imports are used. The original ticket is: golang/go#23701 Although it is supposed to be fixed in 1.10 it does not appear to be so. Error reported by go vet: ./devicestate_test.go:403:38: internal compiler error: no function definition for [0xc4212363c0] FUNC-method(*devicestate.DeviceManager) func() asserts.KeypairManager Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
The test case provided in #23701 (comment) can still be reproduced with With master (
|
Workaround go vet 'internal compiler error' when methods are defined in test files and cross package imports are used. The original ticket is: golang/go#23701 Although it is supposed to be fixed in 1.10 it does not appear to be so. Error reported by go vet: ./ifacestate_test.go:120:29: internal compiler error: no function definition for [0xc420a2fc80] FUNC-method(*ifacestate.InterfaceManager) func() Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Workaround go vet 'internal compiler error' when methods are defined in test files and cross package imports are used. The original ticket is: golang/go#23701 Although it is supposed to be fixed in 1.10 it does not appear to be so. Error reported by go vet: ./devicestate_test.go:403:38: internal compiler error: no function definition for [0xc4212363c0] FUNC-method(*devicestate.DeviceManager) func() asserts.KeypairManager Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Change https://golang.org/cl/104315 mentions this issue: |
'go tool vet' uses out-of-date/incorrect type information, so, since Go 1.10, the Go team recommends using 'go vet' instead. Take them up on their recommendation. This unfortunately trips across an ICE (golang/go#23701), but I opened a CL to fix that: https://go-review.googlesource.com/c/go/+/104315. For now, just ignore the ICE. Release note: None
24454: lint: various fixes r=nvanbenschoten a=benesch Fill in a deep, deep linter rabbit hole. In order for #24104 to pass the linter, we need to run `go vet ./pkg/...` instead of `cd pkg && go tool vet .` so that intentionally-malformatted Go files in a testdata directory are ignored. That required reorganizing the lint rules. Then it required fixing a `go vet` violation that was previously missed, probably because `go tool vet` was using incorrect type information. It also required a workaround for an internal compiler error (golang/go#23701). @nvanbenschoten, any chance I can toss this your way? 24573: distsql: Refactor aggregator into a state machine r=couchand a=abhimadan This lays the groundwork for extending the aggregator to stream results if some of the group columns have an ordering. Release note: None ---- This is the first commit from #24113, extracted into its own PR. 24577: distsql: improve hashjoin performance r=jordanlewis a=jordanlewis - add a benchmark for the spilling hashjoiner - reset the disk iterator rather than creating a new one every probeRow - fix small flushing bug that caused a flush on an empty batch ``` name old time/op new time/op delta HashJoiner/spill=true/rows=256-8 11.7ms ± 3% 2.2ms ± 3% -81.43% (p=0.000 n=10+8) HashJoiner/spill=true/rows=4096-8 89.9ms ± 2% 18.4ms ± 1% -79.58% (p=0.000 n=10+9) HashJoiner/spill=true/rows=65536-8 1.02s ± 2% 0.28s ± 2% -72.16% (p=0.000 n=9+10) name old speed new speed delta HashJoiner/spill=true/rows=256-8 175kB/s ± 3% 941kB/s ± 3% +437.86% (p=0.000 n=10+8) HashJoiner/spill=true/rows=4096-8 364kB/s ± 2% 1780kB/s ± 2% +389.01% (p=0.000 n=10+10) HashJoiner/spill=true/rows=65536-8 517kB/s ± 1% 1850kB/s ± 2% +258.06% (p=0.000 n=9+10) name old alloc/op new alloc/op delta HashJoiner/spill=true/rows=256-8 500kB ± 0% 46kB ± 0% -90.82% (p=0.000 n=9+9) HashJoiner/spill=true/rows=4096-8 8.04MB ± 0% 0.79MB ± 0% -90.16% (p=0.000 n=9+9) HashJoiner/spill=true/rows=65536-8 129MB ± 0% 13MB ± 0% -90.09% (p=0.000 n=10+9) name old allocs/op new allocs/op delta HashJoiner/spill=true/rows=256-8 2.88k ± 0% 0.83k ± 0% -71.10% (p=0.000 n=10+10) HashJoiner/spill=true/rows=4096-8 45.4k ± 0% 12.7k ± 0% -72.13% (p=0.000 n=10+10) HashJoiner/spill=true/rows=65536-8 726k ± 0% 202k ± 0% -72.19% (p=0.000 n=10+10) ``` 24605: stats: invalidate table statistic caches through gossip r=RaduBerinde a=RaduBerinde This change makes the TableStatisticsCache stay up-to-date automatically: whenever we compute a stat, we gossip a "table stat added" key for that table, which triggers an invalidation in the cache. In the current form, this will add a key per table when we enable statistics automatically. A possible improvement would be to set a TTL on these keys and change the cache to always invalidate very old entries automatically. Fixes #24585. Release note: None 24619: storage: remove MVCCStats SpanSet declaration and assertion r=nvanbenschoten a=nvanbenschoten See #22317 (comment). Release note: None Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com> Co-authored-by: Abhishek Madan <abhishek@cockroachlabs.com> Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com> Co-authored-by: Radu Berinde <radu@cockroachlabs.com> Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
@gopherbot please open a 1.10 backport tracking issue. We'll need to cherry-pick both CL 92215 by @rsc and CL 104315 by @benesch. |
Backport issue(s) opened: #25039 (for 1.10). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
What version of Go are you using (
go version
)?go version go1.10rc1 linux/amd64
Does this issue reproduce with the latest release?
This affects the release candidate.
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Tests run.
What did you see instead?
The text was updated successfully, but these errors were encountered: