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

Issue 10696043: code review 10696043: runtime: fix goroutine status corruption (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by dvyukov
Modified:
12 years ago
Reviewers:
rsc
CC:
golang-dev, rsc
Visibility:
Public.

Description

runtime: fix goroutine status corruption runtime.entersyscall() sets g->status = Gsyscall, then calls runtime.lock() which causes stack split. runtime.newstack() resets g->status to Grunning. This will lead to crash during GC (world is not stopped) or GC will scan stack incorrectly.

Patch Set 1 #

Patch Set 2 : diff -r 3a9551481ad1 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 3a9551481ad1 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r 8648a001bbca https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 8648a001bbca https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -4 lines) Patch
M src/pkg/runtime/stack.c View 1 2 3 6 chunks +13 lines, -4 lines 0 comments Download

Messages

Total messages: 5
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
12 years ago (2013-06-27 17:52:35 UTC) #1
rsc
https://codereview.appspot.com/10696043/diff/6001/src/pkg/runtime/stack.c File src/pkg/runtime/stack.c (right): https://codereview.appspot.com/10696043/diff/6001/src/pkg/runtime/stack.c#newcode157 src/pkg/runtime/stack.c:157: oldstatus = gp->status; move to top of block: // ...
12 years ago (2013-06-27 20:16:10 UTC) #2
dvyukov
On 2013/06/27 20:16:10, rsc wrote: > https://codereview.appspot.com/10696043/diff/6001/src/pkg/runtime/stack.c > File src/pkg/runtime/stack.c (right): > > https://codereview.appspot.com/10696043/diff/6001/src/pkg/runtime/stack.c#newcode157 > ...
12 years ago (2013-06-27 20:39:19 UTC) #3
rsc
LGTM
12 years ago (2013-06-27 20:41:58 UTC) #4
dvyukov
12 years ago (2013-06-27 20:50:01 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=cf7a2eb3a4d4 ***

runtime: fix goroutine status corruption
runtime.entersyscall() sets g->status = Gsyscall,
then calls runtime.lock() which causes stack split.
runtime.newstack() resets g->status to Grunning.
This will lead to crash during GC (world is not stopped) or GC will scan stack
incorrectly.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/10696043
Sign in to reply to this message.

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