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

Issue 13421048: code review 13421048: runtime: avoid inconsistent goroutine state in profiler (Closed)

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

Description

runtime: avoid inconsistent goroutine state in profiler Because profiling signals can arrive at any time, we must handle the case where a profiling signal arrives halfway through a goroutine switch. Luckily, although there is much to think through, very little needs to change. Fixes issue 6000. Fixes issue 6015.

Patch Set 1 #

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

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

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

Total comments: 8

Patch Set 5 : diff -r d428d4ae674f https://code.google.com/p/go #

Total comments: 1

Patch Set 6 : diff -r 0f036b4b1da5 https://code.google.com/p/go/ #

Patch Set 7 : diff -r 0f036b4b1da5 https://code.google.com/p/go/ #

Total comments: 2

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

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+225 lines, -29 lines) Patch
M src/pkg/runtime/arch_386.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/arch_amd64.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/arch_arm.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A src/pkg/runtime/export_test.c View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M src/pkg/runtime/export_test.go View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/runtime/pprof/pprof_test.go View 1 2 4 chunks +88 lines, -28 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 1 chunk +76 lines, -1 line 1 comment Download
M src/pkg/runtime/runtime_test.go View 1 2 3 4 5 2 chunks +43 lines, -0 lines 0 comments Download

Messages

Total messages: 13
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 8 months ago (2013-09-13 04:25:37 UTC) #1
dvyukov
https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/proc.c#newcode2118 src/pkg/runtime/proc.c:2118: // consistent. uh I am curious can't it be ...
11 years, 8 months ago (2013-09-13 04:44:06 UTC) #2
dvyukov
https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/proc.c#newcode2061 src/pkg/runtime/proc.c:2061: // signal handler. The operating system updates PC and ...
11 years, 8 months ago (2013-09-13 04:50:33 UTC) #3
dvyukov
https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/proc.c#newcode2074 src/pkg/runtime/proc.c:2074: // When switching from a system g to a ...
11 years, 8 months ago (2013-09-13 04:51:50 UTC) #4
dvyukov
https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/asm_amd64.s File src/pkg/runtime/asm_amd64.s (right): https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/asm_amd64.s#newcode151 src/pkg/runtime/asm_amd64.s:151: MOVQ SI, g(CX) will it be simpler (and possible) ...
11 years, 8 months ago (2013-09-13 05:03:18 UTC) #5
rsc
https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/asm_amd64.s File src/pkg/runtime/asm_amd64.s (right): https://codereview.appspot.com/13421048/diff/8001/src/pkg/runtime/asm_amd64.s#newcode151 src/pkg/runtime/asm_amd64.s:151: MOVQ SI, g(CX) On 2013/09/13 05:03:18, dvyukov wrote: > ...
11 years, 7 months ago (2013-09-13 13:52:44 UTC) #6
dvyukov
https://codereview.appspot.com/13421048/diff/19001/src/pkg/runtime/crash_cgo_test.go File src/pkg/runtime/crash_cgo_test.go (right): https://codereview.appspot.com/13421048/diff/19001/src/pkg/runtime/crash_cgo_test.go#newcode15 src/pkg/runtime/crash_cgo_test.go:15: t.Skip("FAIL") is it related?
11 years, 7 months ago (2013-09-13 16:00:08 UTC) #7
rsc
Sorry, you've caught my CL in an inconsistent state. :-) I uploaded it because I ...
11 years, 7 months ago (2013-09-13 16:30:02 UTC) #8
rsc
PTAL Even simpler. Ignoring tests and comments, the CL is now 5 lines of C ...
11 years, 7 months ago (2013-09-13 17:22:18 UTC) #9
dvyukov
LGTM yes, this is much simpler, thanks https://codereview.appspot.com/13421048/diff/27001/src/pkg/runtime/runtime_test.go File src/pkg/runtime/runtime_test.go (right): https://codereview.appspot.com/13421048/diff/27001/src/pkg/runtime/runtime_test.go#newcode107 src/pkg/runtime/runtime_test.go:107: out, err ...
11 years, 7 months ago (2013-09-13 18:11:31 UTC) #10
rsc
https://codereview.appspot.com/13421048/diff/27001/src/pkg/runtime/runtime_test.go File src/pkg/runtime/runtime_test.go (right): https://codereview.appspot.com/13421048/diff/27001/src/pkg/runtime/runtime_test.go#newcode107 src/pkg/runtime/runtime_test.go:107: out, err = exec.Command("go", "tool", "nm", "-S", dir+"/hello").CombinedOutput() On ...
11 years, 7 months ago (2013-09-13 18:19:05 UTC) #11
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=6112d74a00fa *** runtime: avoid inconsistent goroutine state in profiler Because profiling signals ...
11 years, 7 months ago (2013-09-13 18:19:26 UTC) #12
brainman
11 years, 7 months ago (2013-09-14 05:42:01 UTC) #13
Message was sent while issue was closed.
https://codereview.appspot.com/13421048/diff/33001/src/pkg/runtime/proc.c
File src/pkg/runtime/proc.c (right):

https://codereview.appspot.com/13421048/diff/33001/src/pkg/runtime/proc.c#new...
src/pkg/runtime/proc.c:2119: ((uint8*)runtime·gogo <= pc && pc <
(uint8*)runtime·gogo + RuntimeGogoBytes))
This new condition does not work on windows (broken runtime/pprof tests). I
suspect some of these assumptions don't hold on windows. It has been a while
:-), I don't remember how it is. I will try to fix it when I have time.
Sign in to reply to this message.

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