Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(91)

Issue 102220043: code review 102220043: runtime: fix panic stack during runtime.Goexit during panic (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by rsc
Modified:
10 years, 11 months ago
Reviewers:
iant, dvyukov
CC:
iant, dvyukov, golang-codereviews
Visibility:
Public.

Description

runtime: fix panic stack during runtime.Goexit during panic A runtime.Goexit during a panic-invoked deferred call left the panic stack intact even though all the stack frames are gone when the goroutine is torn down. The next goroutine to reuse that struct will have a bogus panic stack and can cause the traceback routines to walk into garbage. Most likely to happen during tests, because t.Fatal might be called during a deferred func and uses runtime.Goexit. This "not enough cleared in Goexit" failure mode has happened to us multiple times now. Clear all the pointers that don't make sense to keep, not just gp->panic. Fixes issue 8158.

Patch Set 1 #

Patch Set 2 : diff -r c8e9255aed3f https://code.google.com/p/go/ #

Patch Set 3 : diff -r c8e9255aed3f https://code.google.com/p/go/ #

Patch Set 4 : diff -r c8e9255aed3f https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -0 lines) Patch
M src/pkg/runtime/proc.c View 1 1 chunk +6 lines, -0 lines 0 comments Download
A test/fixedbugs/issue8158.go View 1 1 chunk +41 lines, -0 lines 0 comments Download

Messages

Total messages: 4
rsc
Hello iant (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
10 years, 11 months ago (2014-06-06 20:34:08 UTC) #1
iant
LGTM
10 years, 11 months ago (2014-06-06 20:39:37 UTC) #2
dvyukov
LGTM
10 years, 11 months ago (2014-06-06 20:45:52 UTC) #3
rsc
10 years, 11 months ago (2014-06-06 20:52:14 UTC) #4
*** Submitted as https://code.google.com/p/go/source/detail?r=00224712f89e ***

runtime: fix panic stack during runtime.Goexit during panic

A runtime.Goexit during a panic-invoked deferred call
left the panic stack intact even though all the stack frames
are gone when the goroutine is torn down.
The next goroutine to reuse that struct will have a
bogus panic stack and can cause the traceback routines
to walk into garbage.

Most likely to happen during tests, because t.Fatal might
be called during a deferred func and uses runtime.Goexit.

This "not enough cleared in Goexit" failure mode has
happened to us multiple times now. Clear all the pointers
that don't make sense to keep, not just gp->panic.

Fixes issue 8158.

LGTM=iant, dvyukov
R=iant, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/102220043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b