Navigation Menu

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: segmentation fault #11526

Closed
dvyukov opened this issue Jul 2, 2015 · 3 comments
Closed

gccgo: segmentation fault #11526

dvyukov opened this issue Jul 2, 2015 · 3 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 2, 2015

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)

@gopherbot
Copy link

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

pbeeler pushed a commit to SaberMod/GCC_SaberMod that referenced this issue Aug 21, 2015
    
    When the print builtins are called with no arguments, the compiler
    issues a warning and crashes when trying to produce the backend
    representation for the arguments.
    
    Fixes golang/go#11526.
    
    Reviewed-on: https://go-review.googlesource.com/13131


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227039 138bc75d-0d04-0410-961f-82ee72b054a4
@gajju26
Copy link

gajju26 commented Oct 20, 2015

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

@dvyukov
Copy link
Member Author

dvyukov commented Oct 20, 2015

@gajju26 this issue is about compiler crash.

@golang golang locked and limited conversation to collaborators Oct 24, 2016
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

5 participants