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

go get github.com/mailhog/MailHog causes segmentation fault #103

Closed
cybafelo opened this issue Jul 7, 2016 · 4 comments
Closed

go get github.com/mailhog/MailHog causes segmentation fault #103

cybafelo opened this issue Jul 7, 2016 · 4 comments

Comments

@cybafelo
Copy link

cybafelo commented Jul 7, 2016

it worked the first time - complained about bzr not installed

every successive attempt to run 'go get github.com/mailhog/MailHog' produces the following output

Segmentation fault (core dumped)

really annoying. especially since claiming 'mailcatcher - just easier to install' - yeah right.

@ian-kent
Copy link
Member

ian-kent commented Jul 7, 2016

Sorry @cybafelo, I can't reproduce this, could you give more info (OS, go version, etc)

I've just pushed some updates to import paths which may have caused a problem, but I'd have expected a uses insecure protocol error rather than a segfault

My attempt, which seems to work ok:

vagrant init hashicorp/precise64
vagrant up
vagrant ssh
# in VM
sudo apt-get install -y git
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
tar -xvf go1.6.2.linux-amd64.tar.gz
export GOROOT=/home/vagrant/go
mkdir ~/dev
export GOPATH=/home/vagrant/dev
export PATH=$PATH:/home/vagrant/go/bin:$GOPATH/bin
go get github.com/mailhog/MailHog
MailHog

which outputs

2016/07/07 20:53:50 Using in-memory storage
2016/07/07 20:53:50 [SMTP] Binding to address: 0.0.0.0:1025
[HTTP] Binding to address: 0.0.0.0:8025
2016/07/07 20:53:50 Serving under http://0.0.0.0:8025/
Creating API v1 with WebPath: 
Creating API v2 with WebPath: 

@cybafelo
Copy link
Author

cybafelo commented Jul 8, 2016

hey - thanks for the reply - i tried again this morning - with the same results

go version xgcc (Ubuntu 4.9.3-0ubuntu4) 4.9.3 linux/amd64

Linux version 4.2.0-41-generic (buildd@lgw01-56) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu114.04.3) ) #4814.04.1-Ubuntu SMP Fri Jun 24 17:09:15 UTC 2016 (Ubuntu 4.2.0-41.48~14.04.1-generic 4.2.8-ckt11)

i've installed it over a mac - debian version jessie -

I got the idea to start a 'fresh' go environment (changing my GOPATH) and running again i don't get the segfault - first time was this output
# github.com/gorilla/websocket gocodev/src/github.com/gorilla/websocket/client.go:361:32: error: reference to undefined field or method ‘GetCertificate’ GetCertificate: cfg.GetCertificate, ^ gocodev/src/github.com/gorilla/websocket/client.go:370:32: error: reference to undefined field or method ‘ClientSessionCache’ ClientSessionCache: cfg.ClientSessionCache, ^ gocodev/src/github.com/gorilla/websocket/client.go:373:32: error: reference to undefined field or method ‘CurvePreferences’ CurvePreferences: cfg.CurvePreferences, ^ gocodev/src/github.com/gorilla/websocket/client.go:361:3: error: unknown field ‘GetCertificate’ in ‘tls.Config’ GetCertificate: cfg.GetCertificate, ^ ``# github.com/tinylib/msgp/msgp gocodev/src/github.com/tinylib/msgp/msgp/read.go:13:23: error: reference to undefined identifier ‘sync.Pool’ var readerPool = sync.Pool{New: func() interface{} { return &Reader{} }} ^ gocodev/src/github.com/tinylib/msgp/msgp/read.go:13:27: error: expected ‘;’ or newline after top level declaration var readerPool = sync.Pool{New: func() interface{} { return &Reader{} }} ^ gocodev/src/github.com/tinylib/msgp/msgp/write.go:29:20: error: reference to undefined identifier ‘sync.Pool’ writerPool = sync.Pool{ ^ gocodev/src/github.com/tinylib/msgp/msgp/write.go:29:24: error: missing ‘)’ writerPool = sync.Pool{ ^ gocodev/src/github.com/tinylib/msgp/msgp/write.go:30:15: error: expected ‘;’ or newline after top level declaration New: func() interface{} { ^ gocodev/src/github.com/tinylib/msgp/msgp/write.go:32:3: error: expected declaration }, ^ gocodev/src/github.com/tinylib/msgp/msgp/write.go:34:1: error: expected declaration ) ^

And then - changing the path - trying again

`
unexpected fault address 0x7fbae0fd5c74
fatal error: fault
[signal 0xb code=0x2 addr=0x7fbae0fd5c74]

goroutine 72 [running]:

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

:0

goroutine 1 [select]:
main.$nested27
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/http.go:57
main.httpsOrHTTP
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/http.go:65
main.repoRootForImportDynamic
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/vcs.go:468
main.repoRootForImportPath
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/vcs.go:362
main.downloadPackage
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/get.go:269
main.download
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/get.go:166
main.download
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/get.go:232
main.download
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/get.go:232
main.runGet
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/get.go:72
main.main
/build/gccgo-go-6budhK/gccgo-go-1.2.1/src/cmd/go/main.go:161

goroutine 3 [syscall]:
goroutine in C code; stack unavailable

goroutine 7 [finalizer wait]:

goroutine 61 [chan receive]:

goroutine 62 [select]:
`

so i don't know - the output is different every time - seems like a concurrency problem - first time it was failing with some executable missing - install it - then get segfault - then get first output - then get different second output - now i'm getting segfault again -

we will use capto now - its more in line with our technology stack - i think its a badly written go module (or modules) - or go itself which needs to become more mature - good luck -

@ian-kent
Copy link
Member

ian-kent commented Jul 8, 2016

Thanks for the extra info - could you confirm which version of Go you're using as output by go version

The stack trace and errors point to the crypto/tls package or the go command being at fault (which both seem unlikely), and since MailHog builds as expected on a clean Vagrant VM it suggests it might be a problem with your local environment

It could be worth having a look at these possibly related issues:
golang/go#13586
https://groups.google.com/forum/#!topic/golang-dev/jJZAhCxg7G8
which may be caused by using the gccgo packages provided by Ubuntu?

@cybafelo
Copy link
Author

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.

@cybafelo cybafelo closed this as completed Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants