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

runtime, os: Go program run in docker pid 1 does not generate core dump #34177

Closed
strrchr opened this issue Sep 8, 2019 · 3 comments
Closed

runtime, os: Go program run in docker pid 1 does not generate core dump #34177

strrchr opened this issue Sep 8, 2019 · 3 comments

Comments

@strrchr
Copy link

@strrchr strrchr commented Sep 8, 2019

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

$ go version
1.13rc1

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/opt/PyAutoPush/opt/go1.13beta1/gopath"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/opt/PyAutoPush/opt/go1.13beta1/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/PyAutoPush/opt/go1.13beta1/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/opt/PyAutoPush/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build096703828=/tmp/go-build -gno-record-gcc-switches"

What did you do?

GOTRACEBACK=crash
golang program run in docker pid 1 does not generate core dump

What did you expect to see?

I want to generate a core dump.

What did you see instead?

No core dump generated.

@odeke-em odeke-em changed the title golang program run in docker pid 1 does not generate core dump runtime, os: Go program run in docker pid 1 does not generate core dump Sep 8, 2019
@odeke-em
Copy link
Member

@odeke-em odeke-em commented Sep 8, 2019

Hello @strrchr, thank you for this question and welcome to the Go project!

To make this issue actionable:
a) could you please provide a sample/minimal reproducing program and how you ran it, that you used to come to this conclusion? For example, you could report that it could have been

package main

func main() {
    panic("Bye")
}

Please report the source code of what you could use to reproduce the problem.

b) Please list how you are starting the container in your Dockerfile. The step with which you passed in GOTRACEBACK when running your dockerize app might show you why it failed e.g. if you used CMD ["GOTRACEBACK=1", "./proc"] I believe this doesn't work
c) I've heard about issues with PID 1 ignoring signals unless explicitly coded to do so https://docs.docker.com/v17.12/engine/reference/run/#foreground but I am not a Docker expert
d) Do other process successfully generate the core dump and not just the PID 1 process?

Thank you!

@strrchr
Copy link
Author

@strrchr strrchr commented Sep 9, 2019

Thank you!
Finally, I figure out that it's PID 1 problem.
When go program run as PID 1 and panic, no core dump generated.

@odeke-em
Copy link
Member

@odeke-em odeke-em commented Sep 9, 2019

Thank you for the confirmation that it is a PID 1 issue that's agnostic of the binary's source. Please examine how to get your binaries running as non-PID 1. I shall close this issue as the issue is related to Docker and not to Go but please don't hesitate to reach out in case of any other issues.

@odeke-em odeke-em closed this Sep 9, 2019
@golang golang locked and limited conversation to collaborators Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.