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

gccgo: ICE in mangled_name for packagepath with .0 #33871

Closed
thanm opened this issue Aug 27, 2019 · 2 comments
Closed

gccgo: ICE in mangled_name for packagepath with .0 #33871

thanm opened this issue Aug 27, 2019 · 2 comments
Milestone

Comments

@thanm
Copy link
Contributor

thanm commented Aug 27, 2019

What version of Go are you using (go version)?

gccgo tip, linux/amd64

$ go version
go version go1.12.2 gccgo (GCC) 10.0.0 20190822 (experimental) linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

This actually cropped up while building a package in module mode, via

  git clone https://go.googlesource.com/protobuf
  cd protobuf
  go test ./proto 

due to a module path of the form "protobuf/internal/testprotos/legacy/proto2.v0.0.0-20160225-2fc053c5". There is a simpler way to reproduce, however, via the following.

In $GOPATH/src, create a subdir "a.0.0", then in that dir place this file:

package a

type T struct {
	q interface{}
	x uint64
}

func (t T) X() uint64 {
	return t.x
}

Then do:

cd $GOPATH/src/a.0.0
go build .

What did you expect to see?

Clean build.

What did you see instead?

This error:

# a.0.0
go1: internal compiler error: in mangled_name, at go/gofrontend/names.cc:590
0x66d873 Type::mangled_name[abi:cxx11](Gogo*) const
	../../gcc-trunk/gcc/go/gofrontend/names.cc:590
0x8c12ea Gogo::specific_type_function_names(Type const*, Named_type const*, std::__cxx11::basic_string, std::allocator >*, std::__cxx11::basic_string, std::allocator >*)
	../../gcc-trunk/gcc/go/gofrontend/names.cc:302
0x9045c7 Type::specific_type_functions(Gogo*, Named_type*, long, Function_type*, Function_type*, Named_object**, Named_object**)
	../../gcc-trunk/gcc/go/gofrontend/types.cc:2023
0x903075 Type::type_functions(Gogo*, Named_type*, Function_type*, Function_type*, Named_object**, Named_object**)
	../../gcc-trunk/gcc/go/gofrontend/types.cc:1955
0x890342 Specific_type_functions::type(Type*)
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:2755
0x890342 Specific_type_functions::type(Type*)
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:2743
0x8e9f32 Type::traverse(Type*, Traverse*)
	../../gcc-trunk/gcc/go/gofrontend/types.cc:318
0x89371c Bindings::traverse(Traverse*, bool)
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:9158
0x893941 Gogo::traverse(Traverse*)
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:2829
0x8939d7 Gogo::write_specific_type_functions()
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:2805
0x88ed33 go_parse_input_files(char const**, unsigned int, bool, bool)
	../../gcc-trunk/gcc/go/gofrontend/go.cc:173
0x88a89f go_langhook_parse_file
	../../gcc-trunk/gcc/go/go-lang.c:330
Please submit a full bug report,
@gopherbot gopherbot added this to the Gccgo milestone Aug 27, 2019
@thanm thanm self-assigned this Aug 27, 2019
@gopherbot
Copy link

Change https://golang.org/cl/200837 mentions this issue: cmd/go: add test for gccgo name mangling crash

@gopherbot
Copy link

Change https://golang.org/cl/200838 mentions this issue: compiler: mangle dots in pkgpath

kraj pushed a commit to kraj/gcc that referenced this issue Oct 12, 2019
    
    We need to mangle dots to avoid problems with -fgo-pkgpath=a.0.
    That will confuse the name mangling, which assumes that names
    entering the mangling cannot contain arbitrary dot characters.
    We don't need to mangle other characters; go_encode_id will handle them.
    
    Fixes golang/go#33871
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/200838


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276913 138bc75d-0d04-0410-961f-82ee72b054a4
gopherbot pushed a commit that referenced this issue Oct 15, 2019
Updates #33871

Change-Id: I73b1513a89ad89126159ce03ee72b922cd01916c
Reviewed-on: https://go-review.googlesource.com/c/go/+/200837
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
emsr pushed a commit to emsr/gcc that referenced this issue Nov 2, 2019
    
    We need to mangle dots to avoid problems with -fgo-pkgpath=a.0.
    That will confuse the name mangling, which assumes that names
    entering the mangling cannot contain arbitrary dot characters.
    We don't need to mangle other characters; go_encode_id will handle them.
    
    Fixes golang/go#33871
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/200838


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276913 138bc75d-0d04-0410-961f-82ee72b054a4
@golang golang locked and limited conversation to collaborators Oct 11, 2020
asiekierka pushed a commit to WonderfulToolchain/gcc-ia16 that referenced this issue May 16, 2022
    
    We need to mangle dots to avoid problems with -fgo-pkgpath=a.0.
    That will confuse the name mangling, which assumes that names
    entering the mangling cannot contain arbitrary dot characters.
    We don't need to mangle other characters; go_encode_id will handle them.
    
    Fixes golang/go#33871
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/200838

From-SVN: r276913
@rsc rsc unassigned thanm Jun 23, 2022
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

2 participants