gorequest
gorequest copied to clipboard
Crashing in Ubuntu 16.10,17.10
Using Go Version 1.10.1
go env vadmin@ubuntu12:~$ go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/vadmin/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build829417275=/tmp/go-build" 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"
I am building Production binary in Ubuntu 12.04 LTS With Below Command.
root@ubuntu12:~/g2agent/src/opsramp/core# go build -ldflags '-s -extldflags "-static"' main.go
command-line-arguments
/tmp/go-link-193707333/000002.o: In function mygetgrouplist': /tmp/workdir/go/src/os/user/getgrouplist_unix.go:15: warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /tmp/go-link-193707333/000002.o: In function
mygetgrgid_r':
/tmp/workdir/go/src/os/user/cgo_lookup_unix.go:38: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-193707333/000002.o: In function mygetgrnam_r': /tmp/workdir/go/src/os/user/cgo_lookup_unix.go:43: warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /tmp/go-link-193707333/000002.o: In function
mygetpwnam_r':
/tmp/workdir/go/src/os/user/cgo_lookup_unix.go:33: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-193707333/000002.o: In function mygetpwuid_r': /tmp/workdir/go/src/os/user/cgo_lookup_unix.go:28: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /tmp/go-link-193707333/000000.o: In function
_cgo_b0c710f30cfd_C2func_getaddrinfo':
/tmp/go-build/net/_obj/cgo-gcc-prolog:46: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
When Same Binary Executed in Ubuntu 16.10,17.10 It is Crashing.
cat /var/log/syslog
Jun 21 05:18:18 ubuntu17 systemd[1]: Agent.service: Failed with result 'exit-code'. Jun 21 05:18:18 ubuntu17 Agent[1164]: thirdparty/github.com/parnurzeal/gorequest.(*SuperAgent).Timeout.func1(0x192419d, 0x3, 0xc420340ec0, 0x12, 0xc420049c90, 0xc420048a00, 0xc4201c3ae8, 0x6202f9) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/home/vadmin/g2agent/src/thirdparty/github.com/parnurzeal/gorequest/gorequest.go:454 +0x7e Jun 21 05:18:18 ubuntu17 Agent[1164]: net/http.(*Transport).dial(0xc420320000, 0x1b64940, 0xc42003c018, 0x192419d, 0x3, 0xc420340ec0, 0x12, 0x0, 0x0, 0x0, ...) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/http/transport.go:901 +0x78 Jun 21 05:18:18 ubuntu17 Agent[1164]: net/http.(*Transport).dialConn(0xc420320000, 0x1b64940, 0xc42003c018, 0x0, 0xc420040f30, 0x5, 0xc420340ec0, 0x12, 0x0, 0x0, ...) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/http/transport.go:1143 +0x317 Jun 21 05:18:18 ubuntu17 Agent[1164]: net/http.(*Transport).getConn.func4(0xc420320000, 0x1b64940, 0xc42003c018, 0xc4200202d0, 0xc42021ecc0) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/http/transport.go:957 +0x78 Jun 21 05:18:18 ubuntu17 Agent[1164]: created by net/http.(*Transport).getConn Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/http/transport.go:956 +0x363 Jun 21 05:18:18 ubuntu17 Agent[1164]: goroutine 104 [select]: Jun 21 05:18:18 ubuntu17 Agent[1164]: net.cgoLookupIP(0x1b64900, 0xc4202f1200, 0xc420340ec0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/cgo_unix.go:212 +0x19f Jun 21 05:18:18 ubuntu17 Agent[1164]: net.(*Resolver).lookupIP(0x26b2920, 0x1b64900, 0xc4202f1200, 0xc420340ec0, 0xe, 0x0, 0xc420397080, 0xc42003a300, 0x0, 0x0) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/lookup_unix.go:95 +0x12d Jun 21 05:18:18 ubuntu17 Agent[1164]: net.(*Resolver).(net.lookupIP)-fm(0x1b64900, 0xc4202f1200, 0xc420340ec0, 0xe, 0x42c7a9, 0x8, 0xc42003a300, 0x0, 0xc4205806a0) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/lookup.go:192 +0x56 Jun 21 05:18:18 ubuntu17 Agent[1164]: net.glob..func10(0x1b64900, 0xc4202f1200, 0xc42016c700, 0xc420340ec0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/hook.go:19 +0x52 Jun 21 05:18:18 ubuntu17 Agent[1164]: net.(*Resolver).LookupIPAddr.func1(0x0, 0x0, 0x0, 0x0) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/net/lookup.go:206 +0xd8 Jun 21 05:18:18 ubuntu17 Agent[1164]: internal/singleflight.(*Group).doCall(0x26b2910, 0xc4202e7270, 0xc420340ec0, 0xe, 0xc420020390) Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/internal/singleflight/singleflight.go:95 +0x2e Jun 21 05:18:18 ubuntu17 Agent[1164]: created by internal/singleflight.(*Group).DoChan Jun 21 05:18:18 ubuntu17 Agent[1164]: #011/usr/local/go/src/internal/singleflight/singleflight.go:88 +0x2d0
Any code to replicate this?