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
gollvm: crash llvm-goc with SIGSEGV #35586
Comments
I'll take a look. |
This I think is actually a front end oddity (gcc backend doesn't mind but it causes issues with gollvm). Reduced testcase: Package "a" package a var Avar int func D(_ string, _ int) (uint64, string) { return 101, "bad" } Package "b": package b import "a" func F(addr string) (uint64, string) { return a.D(addr, 32) } I will send a tentative fix shortly. |
Change https://golang.org/cl/207258 mentions this issue: |
Change https://golang.org/cl/207259 mentions this issue: |
@heylinn Thank you for reporting this bug. I have a fix out for review. |
When the compiler writes an inlinable function to the export data, parameter names are written out (in Export::write_name) using the Gogo::message_name as opposed to a raw/encoded name. This means that sink parameters (those named "_") get created with the name "_" instead of "._" (the name created by the lexer/parser). This confuses Gogo::is_sink_name, which looks for the latter sequence and not just "_". This can cause issues later on if an inlinable function is imported and fed through the rest of the compiler (things that are sinks are no recognized as such). To fix these issues, change Gogo::is_sink_name to return true for either variants ("_" or "._"). Fixes golang/go#35586. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/207259 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@278275 138bc75d-0d04-0410-961f-82ee72b054a4
Thank you! I am impressed how fast you fixed it. |
When the compiler writes an inlinable function to the export data, parameter names are written out (in Export::write_name) using the Gogo::message_name as opposed to a raw/encoded name. This means that sink parameters (those named "_") get created with the name "_" instead of "._" (the name created by the lexer/parser). This confuses Gogo::is_sink_name, which looks for the latter sequence and not just "_". This can cause issues later on if an inlinable function is imported and fed through the rest of the compiler (things that are sinks are no recognized as such). To fix these issues, change Gogo::is_sink_name to return true for either variants ("_" or "._"). Fixes golang/go#35586. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/207259 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@278275 138bc75d-0d04-0410-961f-82ee72b054a4
Reduced test case for gollvm compiler crash building docker-ce. Updates #35586. Change-Id: Ib805dc9ab7b63cc61f207f1f000bef9809cfd428 Reviewed-on: https://go-review.googlesource.com/c/go/+/207258 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
When the compiler writes an inlinable function to the export data, parameter names are written out (in Export::write_name) using the Gogo::message_name as opposed to a raw/encoded name. This means that sink parameters (those named "_") get created with the name "_" instead of "._" (the name created by the lexer/parser). This confuses Gogo::is_sink_name, which looks for the latter sequence and not just "_". This can cause issues later on if an inlinable function is imported and fed through the rest of the compiler (things that are sinks are no recognized as such). To fix these issues, change Gogo::is_sink_name to return true for either variants ("_" or "._"). Fixes golang/go#35586. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/207259 From-SVN: r278275
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
I tried to build a client for docker.
There are a few steps to reproduce the error:
What did you expect to see?
Clean compilation
What did you see instead?
The text was updated successfully, but these errors were encountered: