set GOTRACEBACK=crash when running cockroach #2088
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default, when Go encounters a fatal runtime error, it dumps some state (some Goroutine stack traces) and exits the process with a non-zero status code. It'd be nice to get core files for these fatal failures. Such core files proved invaluable for debugging #1146 and friends. Go provides a mechanism to dump core on fatal failures by setting
GOTRACEBACK=crash
in the environment. This causes it to dump its state like normal and then raiseSIGABRT
. This is how I generated most of the core files that I used to debug those issues.Getting a core file also requires having configured
coreadm
properly and potentially updatingulimit -c
. These are properties of the developer's environment and I think we should not take ownership of these. In production, I assume we have already configured them or will do so.There are two places where this needs to be changed:
omicron-dev db-run
developer toolThis change:
cockroach
process-- I'm using
pargs -e PID
to get the environment of the child process)cockroach version