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

internal compiler error: Segmentation fault #22666

Closed
MauroMombelli opened this issue Nov 10, 2017 · 15 comments
Closed

internal compiler error: Segmentation fault #22666

MauroMombelli opened this issue Nov 10, 2017 · 15 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@MauroMombelli
Copy link

Please answer these questions before submitting your issue. Thanks!

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

go version go1.9.2 linux/amd64

Does this issue reproduce with the latest release?

it is latest

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mauro/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build324052906=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

trying to compile https://aur.archlinux.org/packages/gcp-cups-connector/ commit 428847ac80d2b9a19fc87f00afde4b9ae4d883aa

ps. I don't know go, but that is quite clearly a compiler bug

@randall77
Copy link
Contributor

@MauroMombelli : could you post more precise instructions to reproduce? If I do:

go get github.com/google/cloud-print-connector

I get no Go files...

@ALTree
Copy link
Member

ALTree commented Nov 10, 2017

That looks like a gccgo crash message. Can you confirm you are using gccgo?

It seems like it's crashing on x/net/context, which is a dependency of the repository you linked.

$ cd $GOPATH/src/golang.org/x/net/context

$ go build -compiler gccgo .
go build: when using gccgo toolchain, please pass compiler flags using -gccgoflags, not -gcflags
# golang.org/x/net/context
go1: internal compiler error: in fold_convert_loc, at fold-const.c:2391
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.

Can you please post the full crash message?

@ALTree ALTree added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 10, 2017
@MauroMombelli
Copy link
Author

MauroMombelli commented Nov 10, 2017

please look here. Let me know if the issue is from another repo

https://pastebin.com/sZtWA9Ay

@MauroMombelli
Copy link
Author

@randall77 the full command is

GOPATH="$srcdir" go get -fix -v -x github.com/google/cloud-print-connector/gcp-cups-connector

where $srcdir is the current dir

@randall77
Copy link
Contributor

Step one, it was complaining that I needed bzr, so I installed it (sudo apt-get install bzr).
Step two, missing cups/cups.h, fix with sudo apt-get install libcups2-dev.
Step three, missing avahi-client/publish.h, fix with ???

@MauroMombelli
Copy link
Author

MauroMombelli commented Nov 10, 2017

full build step in https://github.com/google/cloud-print-connector/wiki/Build-from-source

please note the package im using is on arch linux full default installations; i can't assure you can reproduce under ubuntu or even arch derivatives

@randall77
Copy link
Contributor

Ok, that helps. Missing magic was sudo apt-get install libavahi-client-dev.
I can't reproduce your error, I now get bin/gcp-cups-connector generated just fine.
I'm running gcc 4.8.4 if that makes a difference. I can't think of what else may matter.

@MauroMombelli
Copy link
Author

MauroMombelli commented Nov 10, 2017

gcc --version
gcc (GCC) 7.2.0

this is an huge difference :)

@randall77
Copy link
Contributor

I tried with gcc 7.2.0 and still I can't reproduce your error.

@ianlancetaylor, is there any way to verify which gcc was actually used to make a cgo binary? I just put gcc 7.2.0 ahead in my path from the default gcc, but I don't know If that's sufficient. How does the go tool find gcc anyway?

BTW, gcc 7.2.0 took ~3 hours to build from scratch. make.bash doesn't seem so slow anymore...

@bradfitz
Copy link
Contributor

@MauroMombelli, perhaps you can prepare a Dockerfile showing the repro in a docker container? That is, give @randall77 the repro on a silver platter.

@MauroMombelli
Copy link
Author

MauroMombelli commented Nov 11, 2017 via email

@ALTree
Copy link
Member

ALTree commented Nov 12, 2017

gcc 7.2 is the default on my system and I can't reproduce the crash. go build ./... works fine.

I still can easily get an internal compiler error with gccgo, but it looks like a different problem from the one in the log linked above.

@MauroMombelli
Copy link
Author

today I tried again (after switchng back to 1.8 yesterday, i re-uplaoded to 1.9.2) and the compilation completed successfully.

I have no ideas.

@ianlancetaylor
Copy link
Contributor

@randall77 You can see the version of GCC used to build a Go program that uses cgo by running readelf --debug=info EXECUTABLE | grep DW_AT_producer. That will show you both the Go version and the GCC version.

Also, next time you have to build an old version of GCC add --disable-bootstrap to the configure line. That will speed up the build considerably, at the cost of much less testing but you don't really care about that if you aren't planning to use the new version of GCC for anything important.

@ianlancetaylor
Copy link
Contributor

The segmentation fault was coming from the C compiler, not the Go compiler. It appears that the problem can not be recreated. I'm going to close this issue since I don't see anything we can do here. Please comment if you disagree.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants