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

Issue 4203042: code review 4203042: runtime: pass to signal handler value of g at time of signal (Closed)

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

Description

runtime: pass to signal handler value of g at time of signal The existing code assumed that signals only arrived while executing on the goroutine stack (g == m->curg), not while executing on the scheduler stack (g == m->g0). Most of the signal handling trampolines correctly saved and restored g already, but the sighandler C code did not have access to it. Some rewriting of assembly to make the various implementations as similar as possible. Will need to change Windows too but I don't understand how sigtramp gets called there.

Patch Set 1 #

Patch Set 2 : diff -r 4c45d4ff1665 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 4c45d4ff1665 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r ef0c9689828e https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -87 lines) Patch
M src/pkg/runtime/darwin/386/signal.c View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/darwin/386/sys.s View 1 2 1 chunk +15 lines, -14 lines 0 comments Download
M src/pkg/runtime/darwin/amd64/signal.c View 1 2 3 3 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/darwin/amd64/sys.s View 1 2 2 chunks +11 lines, -8 lines 0 comments Download
M src/pkg/runtime/freebsd/386/signal.c View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/freebsd/386/sys.s View 1 2 1 chunk +24 lines, -18 lines 0 comments Download
M src/pkg/runtime/freebsd/amd64/signal.c View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/freebsd/amd64/sys.s View 1 1 chunk +19 lines, -5 lines 0 comments Download
M src/pkg/runtime/linux/386/signal.c View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/linux/386/sys.s View 1 2 chunks +4 lines, -3 lines 0 comments Download
M src/pkg/runtime/linux/amd64/signal.c View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/linux/amd64/sys.s View 1 2 chunks +6 lines, -4 lines 0 comments Download
M src/pkg/runtime/linux/arm/signal.c View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/linux/arm/sys.s View 1 2 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 4
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-02-23 04:51:12 UTC) #1
rsc
Only tested linux/amd64. Will test the other linux and darwin ports tomorrow.
14 years ago (2011-02-23 04:51:54 UTC) #2
r
LGTM but i'm hardly in a position of confidence when it comes to unix signal ...
14 years ago (2011-02-23 04:59:23 UTC) #3
rsc
14 years ago (2011-02-23 19:47:45 UTC) #4
*** Submitted as 9fb768bbf24f ***

runtime: pass to signal handler value of g at time of signal

The existing code assumed that signals only arrived
while executing on the goroutine stack (g == m->curg),
not while executing on the scheduler stack (g == m->g0).

Most of the signal handling trampolines correctly saved
and restored g already, but the sighandler C code did not
have access to it.

Some rewriting of assembly to make the various
implementations as similar as possible.

Will need to change Windows too but I don't
understand how sigtramp gets called there.

R=r
CC=golang-dev
http://codereview.appspot.com/4203042
Sign in to reply to this message.

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