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

cmd/go: go get Segmentation Fault after using setfacl #13586

Closed
orian opened this issue Dec 11, 2015 · 10 comments
Closed

cmd/go: go get Segmentation Fault after using setfacl #13586

orian opened this issue Dec 11, 2015 · 10 comments

Comments

@orian
Copy link

orian commented Dec 11, 2015

The following script allows to replicate the environment.

#!/bin/bash

FP=/tmp2/$USER/raid/$USER
sudo mkdir -p $FP
sudo chmod 755 /tmp2
sudo chmod 750 /tmp2/$USER
sudo setfacl -m user:$USER:r-x /tmp2/$USER
sudo chmod 705 /tmp2/$USER/raid
sudo chmod 755 $FP
sudo chown $USER.$USER $FP
export GOPATH=$FP/gopath
go get google.golang.org/grpc

The failures I got were:

unexpected fault address 0x0
fatal error: fault
[signal 0xb code=0x80 addr=0x0]

goroutine 25 [running]:
Segmentation fault (core dumped)

or

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x80 addr=0x0]

goroutine 25 [running]:
Segmentation fault (core dumped)

or just

Segmentation fault (core dumped)

Now the funny part:
I've rerun the tool many times in hope for some more useful error, and probably after 10th run it run successfully. I guess it means some race condition?

System: Linux; Ubuntu 15.04; filesystem: ext4
Kernel: Linux xx 3.19.0-30-generic #33-Ubuntu SMP Mon Sep 21 20:58:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Go: 1.4.2 and 1.5.2 (both from golang.org)

@ianlancetaylor
Copy link
Contributor

What comment are you running when you see the crash? It's not clear.

Can you provide a complete crash dump?

Have you tried using the race detector?

@ianlancetaylor
Copy link
Contributor

Are you saying that running go get gives you a segmentation fault?

@orian
Copy link
Author

orian commented Dec 12, 2015

Yes, sorry for not being specific. Running go get causes problem:

go get google.golang.org/grpc

@ianlancetaylor
Copy link
Contributor

Can you provide the complete crash output?

@ianlancetaylor ianlancetaylor changed the title go get Segmentation Fault cmd/go: go get Segmentation Fault after using setfacl Dec 12, 2015
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Dec 12, 2015
@ianlancetaylor
Copy link
Contributor

I tried following your instructions, and was unable to recreate the problem. I tried both go tip and the Go 1.5.2 release.

@orian
Copy link
Author

orian commented Dec 12, 2015

The above output is everything i've got, from time to time also (go 1.5.2):

munmap of stack space failed: errno 22
Aborted

reflect.kind.N13_reflect.Value
    ../../../src/libgo/go/reflect/value.go:74
reflect.Len.N13_reflect.Value
    ../../../src/libgo/go/reflect/value.go:870
reflect.Copy
    ../../../src/libgo/go/reflect/value.go:1711
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:700
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:778
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:778
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:778
encoding_asn1.UnmarshalWithParams
    ../../../src/libgo/go/encoding/asn1/asn1.go:917
encoding_asn1.Unmarshal
    ../../../src/libgo/go/encoding/asn1/asn1.go:910
crypto_x509.ParseCertificate
    ../../../src/libgo/go/crypto/x509/x509.go:1093
crypto_x509.AppendCertsFromPEM.pN20_crypto_x509.CertPool
    ../../../src/libgo/go/crypto/x509/cert_pool.go:96
x509.initSystemRoots
    ../../../src/libgo/go/crypto/x509/root_unix.go:38
sync.Do.pN9_sync.Once
    ../../../src/libgo/go/sync/once.go:44
x509.systemRootsPool
    ../../../src/libgo/go/crypto/x509/root.go:15
crypto_x509.Verify.pN23_crypto_x509.Certificate
    ../../../src/libgo/go/crypto/x509/verify.go:219
crypto_tls.doFullHandshake.pN31_crypto_tls.clientHandshakeState
    ../../../src/libgo/go/crypto/tls/handshake_client.go:262
crypto_tls.clientHandshake.pN15_crypto_tls.Conn
    ../../../src/libgo/go/crypto/tls/handshake_client.go:197
crypto_tls.Handshake.pN15_crypto_tls.Conn
    ../../../src/libgo/go/crypto/tls/conn.go:977
http.$nested21
    ../../../src/libgo/go/net/http/transport.go:637

goroutine 16 [select]:
net_http.getConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:525
net_http.RoundTrip.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:228
http.send
    ../../../src/libgo/go/net/http/client.go:219
net_http.send.pN15_net_http.Client
    ../../../src/libgo/go/net/http/client.go:142
net_http.doFollowingRedirects.pN15_net_http.Client
    ../../../src/libgo/go/net/http/client.go:367
net_http.Get.pN15_net_http.Client
    ../../../src/libgo/go/net/http/client.go:299
main.$nested15
    ../../src/gotools/../libgo/go/cmd/go/http.go:57
main.httpsOrHTTP
    ../../src/gotools/../libgo/go/cmd/go/http.go:65
main.repoRootForImportDynamic
    ../../src/gotools/../libgo/go/cmd/go/vcs.go:592
main.repoRootForImportPath
    ../../src/gotools/../libgo/go/cmd/go/vcs.go:482
main.downloadPackage
    ../../src/gotools/../libgo/go/cmd/go/get.go:301
main.download
    ../../src/gotools/../libgo/go/cmd/go/get.go:179
main.runGet
    ../../src/gotools/../libgo/go/cmd/go/get.go:79
main.main
    ../../src/gotools/../libgo/go/cmd/go/main.go:163
created by main
    ../../../src/libgo/runtime/go-main.c:42

goroutine 18 [finalizer wait]:
created by runtime_createfing
    ../../../src/libgo/runtime/mgc0.c:2572

goroutine 19 [syscall]:
    goroutine in C code; stack unavailable
created by os_signal..import
    ../../../src/libgo/go/os/signal/signal_unix.go:25

goroutine 22 [chan receive]:
net_http.dialConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:643
http.$nested18
    ../../../src/libgo/go/net/http/transport.go:520
created by net_http.getConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:519
end

and go 1.4.2:

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x9]

runtime stack:
runtime_dopanic
    ../../../src/libgo/runtime/panic.c:135
runtime_throw
    ../../../src/libgo/runtime/panic.c:193
sig_panic_leadin
    ../../../src/libgo/runtime/go-signal.c:247
sig_panic_info_handler
    ../../../src/libgo/runtime/go-signal.c:281

    :0
__splitstack_find
    ../../../src/libgcc/generic-morestack.c:905
addstackroots
    ../../../src/libgo/runtime/mgc0.c:1525
markroot
    ../../../src/libgo/runtime/mgc0.c:1362
runtime_parfordo
    ../../../src/libgo/runtime/parfor.c:88
gc
    ../../../src/libgo/runtime/mgc0.c:2266
mgc
    ../../../src/libgo/runtime/mgc0.c:2211
runtime_mstart
    ../../../src/libgo/runtime/proc.c:1000

goroutine 25 [garbage collection]:
runtime_mcall
    ../../../src/libgo/runtime/proc.c:295
runtime_gc
    ../../../src/libgo/runtime/mgc0.c:2187
runtime_mallocgc
    ../../../src/libgo/runtime/malloc.goc:259
reflect.kind.N13_reflect.Value
    ../../../src/libgo/go/reflect/value.go:74
reflect.Kind.N13_reflect.Value
    ../../../src/libgo/go/reflect/value.go:864
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:739
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:778
asn1.parseSequenceOf
    ../../../src/libgo/go/encoding/asn1/asn1.go:494
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:794
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:778
asn1.parseField
    ../../../src/libgo/go/encoding/asn1/asn1.go:778
encoding_asn1.UnmarshalWithParams
    ../../../src/libgo/go/encoding/asn1/asn1.go:917
encoding_asn1.Unmarshal
    ../../../src/libgo/go/encoding/asn1/asn1.go:910
crypto_x509.ParseCertificate
    ../../../src/libgo/go/crypto/x509/x509.go:1093
crypto_tls.doFullHandshake.pN31_crypto_tls.clientHandshakeState
    ../../../src/libgo/go/crypto/tls/handshake_client.go:240
crypto_tls.clientHandshake.pN15_crypto_tls.Conn
    ../../../src/libgo/go/crypto/tls/handshake_client.go:197
crypto_tls.Handshake.pN15_crypto_tls.Conn
    ../../../src/libgo/go/crypto/tls/conn.go:977
http.$nested21
    ../../../src/libgo/go/net/http/transport.go:637
kickoff
    ../../../src/libgo/runtime/proc.c:235
created by net_http.dialConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:636

goroutine 16 [select]:
runtime_mcall
    ../../../src/libgo/runtime/proc.c:295
selectgo
    ../../../src/libgo/runtime/chan.goc:815
net_http.getConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:525
net_http.RoundTrip.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:228
http.send
    ../../../src/libgo/go/net/http/client.go:219
net_http.send.pN15_net_http.Client
    ../../../src/libgo/go/net/http/client.go:142
net_http.doFollowingRedirects.pN15_net_http.Client
    ../../../src/libgo/go/net/http/client.go:367
net_http.Get.pN15_net_http.Client
    ../../../src/libgo/go/net/http/client.go:299
main.$nested15
    ../../src/gotools/../libgo/go/cmd/go/http.go:57
main.httpsOrHTTP
    ../../src/gotools/../libgo/go/cmd/go/http.go:65
main.repoRootForImportDynamic
    ../../src/gotools/../libgo/go/cmd/go/vcs.go:592
main.repoRootForImportPath
    ../../src/gotools/../libgo/go/cmd/go/vcs.go:482
main.downloadPackage
    ../../src/gotools/../libgo/go/cmd/go/get.go:301
main.download
    ../../src/gotools/../libgo/go/cmd/go/get.go:179
main.runGet
    ../../src/gotools/../libgo/go/cmd/go/get.go:79
main.main
    ../../src/gotools/../libgo/go/cmd/go/main.go:163
runtime_main
    ../../../src/libgo/runtime/proc.c:550
created by main
    ../../../src/libgo/runtime/go-main.c:42

goroutine 17 [syscall]:
    goroutine in C code; stack unavailable
created by runtime_main
    ../../../src/libgo/runtime/proc.c:537

goroutine 18 [finalizer wait]:
runtime_mcall
    ../../../src/libgo/runtime/proc.c:295
runfinq
    ../../../src/libgo/runtime/mgc0.c:2507
kickoff
    ../../../src/libgo/runtime/proc.c:235
created by runtime_createfing
    ../../../src/libgo/runtime/mgc0.c:2572

goroutine 19 [syscall]:
    goroutine in C code; stack unavailable
created by os_signal..import
    ../../../src/libgo/go/os/signal/signal_unix.go:25

goroutine 22 [chan receive]:
runtime_mcall
    ../../../src/libgo/runtime/proc.c:295
chanrecv
    ../../../src/libgo/runtime/chan.goc:299
net_http.dialConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:643
http.$nested18
    ../../../src/libgo/go/net/http/transport.go:520

    ../../../src/libgo/go/net/http/transport.go:636
kickoff
    ../../../src/libgo/runtime/proc.c:235
created by net_http.getConn.pN18_net_http.Transport
    ../../../src/libgo/go/net/http/transport.go:519

goroutine 21 [GC sweep wait]:
runtime_mcall
    ../../../src/libgo/runtime/proc.c:295
bgsweep
    ../../../src/libgo/runtime/mgc0.c:1842
kickoff
    ../../../src/libgo/runtime/proc.c:235
created by mgc
    ../../../src/libgo/runtime/mgc0.c:2211

goroutine 23 [syscall]:
    goroutine in C code; stack unavailable
created by addtimer
    ../../../src/libgo/runtime/time.goc:147
end

I'm fine with assuming it's something wrong with my system (however I don't have any other problems I've noticed). Let's see if anyone else have similar problem. I've added kernel/filesystem to description.

@davecheney
Copy link
Contributor

@orian above you stated that

System: Linux; Ubuntu 15.04; filesystem: ext4
Kernel: Linux xx 3.19.0-30-generic #33-Ubuntu SMP Mon Sep 21 20:58:04 UTC 2015 x86_64 x86_64 >x86_64 GNU/Linux
Go: 1.4.2 and 1.5.2 (both from golang.org)

But the stack trace you have posted is from a Go program which has been compiled with gccgo.

You mentioned you were using Ubuntu. Can I ask you to check and confirm that you have removed all the operating system provided go packages, specifically gccgo-go and golang-go.

which go should point to whichever version of Go

Go: 1.4.2 and 1.5.2 (both from golang.org)

You have downloaded an installed on your machine.

@orian
Copy link
Author

orian commented Jan 5, 2016

I just returned from holidays and looked closer to error. So it looks that I installed gccgo from Ubuntu and it messed up with my settings.

Please close the issue as a buggy environment ;-)

For others:
Do NOT user Ubuntu gccgo with own custom settings.

@cybafelo
Copy link

cybafelo commented Jul 8, 2016

[08] 11:12 tj@cybafelo C:~> $ go version
go version xgcc (Ubuntu 4.9.3-0ubuntu4) 4.9.3 linux/amd64

its the one in the ubuntu repository - probably its buggy - i will compile from source and try again another day.. thanks for the links they are exactly the same problem i've been having - unpredictable results (i.e. concurrency) - probably related to a buggy go version.

@davecheney
Copy link
Contributor

This issue is closed. Please do not comment on closed issues. Please see https://golang.org/wiki/Questions for good places to ask. Thanks.

@golang golang locked and limited conversation to collaborators Jul 8, 2017
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

6 participants