Skip to content

Commit 63fced5

Browse files
DanielMorsingdr2chase
authored andcommitted
runtime/secret: restore goroutine behavior to proposal
During review of CL 704615, a suggestion was made that spawning a goroutine inside a call to secret.Do result in a panic. I agreed with this at the time, but had missed that this had been extensively discussed on the proposal. Revert the behavior back to what was agreed upon. Change-Id: Ifaa9e24bd03ecbd870ae2217137d1a9527c96842 Reviewed-on: https://go-review.googlesource.com/c/go/+/728920 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
1 parent 6455afb commit 63fced5

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/runtime/proc.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5286,10 +5286,6 @@ func malg(stacksize int32) *g {
52865286
// The compiler turns a go statement into a call to this.
52875287
func newproc(fn *funcval) {
52885288
gp := getg()
5289-
if goexperiment.RuntimeSecret && gp.secret > 0 {
5290-
panic("goroutine spawned while running in secret mode")
5291-
}
5292-
52935289
pc := sys.GetCallerPC()
52945290
systemstack(func() {
52955291
newg := newproc1(fn, gp, pc, false, waitReasonZero)

src/runtime/secret/secret.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
// - Currently only supported on linux/amd64 and linux/arm64. On unsupported
2929
// platforms, Do will invoke f directly.
3030
// - Protection does not extend to any global variables written by f.
31-
// - Any attempt to launch a goroutine by f will result in a panic.
31+
// - Protection does not extend to any new goroutines made by f.
3232
// - If f calls runtime.Goexit, erasure can be delayed by defers
3333
// higher up on the call stack.
3434
// - Heap allocations will only be erased if the program drops all

0 commit comments

Comments
 (0)