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
plugin: impossible type kind 0 #17709
Comments
CL 32313 might be tripping up on this same issue. |
I believe this is fixed by https://golang.org/cl/29692. Someone want to try it out/review it? |
The good news is I have replicated this reliably, and it does not appear to be related to threads. Bad news is CL 29692 does not fix it. |
The problem appears to be overly aggressive dead code elimination. I can fix it by marking all itablinks in a plugin as reachable. |
CL https://golang.org/cl/32532 mentions this issue. |
OK that doesn't work. Here's what I know so far. With this extra diagnostics:
I get:
Instrumenting the dead code analysis in the linker shows the symbol "type.error" being processed, along with its method signature "Error() (type.string)". The two relevant symbols Right now the most interesting thing in this is that |
When I looked at this I dumped the raw data that |
Yeah I suspect an offset is being resolved against the wrong module. Ugh. |
I think I've got it. The underlying array in interfacetype.mhdr is dynamically relocated in the freshly loaded module to equivalent array in an earlier module. Then typesEqual attempts to resolve offsets from inside that array agains the _type in the outer interfacetype, which is a different module. The full fix is to finish the project of removing pointers from the type information. But that's a substantial undertaking that will have to wait for 1.9. For now I'm going to read through this code, find any potential typeOff/nameOff method calls matching against the wrong module and switch to using the slice array as the base pointer. |
CL https://golang.org/cl/32513 mentions this issue. |
cc @mwhudson, as I suspect this is a problem for -buildmode=shared on Go 1.7. |
On 2 November 2016 at 08:51, David Crawshaw notifications@github.com
|
On 2 November 2016 at 07:55, David Crawshaw notifications@github.com
|
In CL 32513 I swap the typeOff method for resolveTypeOff. You can modify it to do both, compare the outputs, and if they're not equal, panic.
I think you could fix this explicit problem with local symbols, yes. But it's a little tricky because you don't want the symbols in the type section that turn into *_type to be local in case there are still dynamic relocations hanging about. Overall this change seemed easier. |
What version of Go are you using (
go version
)?go version devel +f9e1adb Mon Oct 31 21:58:08 2016 +0000 linux/386
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
PASS
What did you see instead?
I noticed this failure on the dashboard, where linux-386, linux-386-clang, and linux-386-sid all failed at commit f9e1adb. I was also able to reproduce it locally. This seems to be completely deterministic at this commit, but cleared up in the very next commit. Neither commit has anything to do with plugins, and f9e1adb was basically a trivial refactoring of a runtime function, so I suspect this has something to do with particular load addresses or alignment.
The text was updated successfully, but these errors were encountered: