golang/go

gccgo: segmentation fault

dvyukov opened this issue · 3 comments

gccgo crashes on the following program:

package a
func f() { print() }
go.go:2:12: warning: no arguments for builtin function ‘print’
 func f() { print() }
            ^
go1: internal compiler error: Segmentation fault
0xb4170f crash_signal
    ../../gcc/toplev.c:360
0x5e3570 Expression::get_backend(Translate_context*)
    ../../gcc/go/gofrontend/expressions.cc:408
0x5eeb18 Builtin_call_expression::do_get_backend(Translate_context*)
    ../../gcc/go/gofrontend/expressions.cc:8213
0x64c5ac Expression_statement::do_get_backend(Translate_context*)
    ../../gcc/go/gofrontend/statements.cc:1740
0x61d9a7 Block::get_backend(Translate_context*)
    ../../gcc/go/gofrontend/gogo.cc:5811
0x61f1dc Function::build(Gogo*, Named_object*)
    ../../gcc/go/gofrontend/gogo.cc:5417
0x6206f7 Named_object::get_backend(Gogo*, std::vector<Bexpression*, std::allocator<Bexpression*> >&, std::vector<Btype*, std::allocator<Btype*> >&, std::vector<Bfunction*, std::allocator<Bfunction*> >&)
    ../../gcc/go/gofrontend/gogo.cc:7136
0x626912 Gogo::write_globals()
    ../../gcc/go/gofrontend/gogo.cc:1345

gcc version 6.0.0 2015070 (experimental) (GCC)

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

I would like to know did you face this issue for x86 architecture?Because currently I am also facing one issue with glog tries to print with %V and having some null verb values then it causes segmentation fault. When I debugged it, I found it is failing at following location. So I was trying to relate this issue.
(gdb) bt
#0 k8s_io_kubernetes_pkg_util.String.N31_k8s_io_kubernetes_pkg_util.Time ($this77.pointer=0xc20ab81000)
at /home/kubernetes/_output/local/go/src/k8s.io/kubernetes/pkg/util/backoff.go:22
#1 0x000003fffd7a9ef4 in fmt.handleMethods.pN6_fmt.pp (p=0xc2088585b0, verb=, depth=3)
at ../../../libgo/go/fmt/print.go:720
#2 0x000003fffd7aa3d6 in fmt.printValue.pN6_fmt.pp (p=0xc2088585b0, param=..., verb=, depth=3)
at ../../../libgo/go/fmt/print.go:832
#3 0x000003fffd7ac2c4 in fmt.printReflectValue.pN6_fmt.pp (p=0xc2088585b0, param=..., verb=, depth=2)
at ../../../libgo/go/fmt/print.go:918
#4 0x000003fffd7aa506 in fmt.printValue.pN6_fmt.pp (p=0xc2088585b0, param=..., verb=, depth=2)
at ../../../libgo/go/fmt/print.go:836
#5 0x000003fffd7ac2c4 in fmt.printReflectValue.pN6_fmt.pp (p=0xc2088585b0, param=..., verb=, depth=1)
at ../../../libgo/go/fmt/print.go:918
#6 0x000003fffd7aa506 in fmt.printValue.pN6_fmt.pp (p=0xc2088585b0, param=..., verb=, depth=1)
at ../../../libgo/go/fmt/print.go:836

@gajju26 this issue is about compiler crash.