[go] runtime/secret: reorganize tests to fix -buildmode=shared

4 views
Skip to first unread message

Daniel Morsing (Gerrit)

unread,
Nov 27, 2025, 2:03:49 AM (3 days ago) Nov 27
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Daniel Morsing has uploaded the change for review

Commit message

runtime/secret: reorganize tests to fix -buildmode=shared

The testing assembly methods had some linknames that were implicitly
satisfied during the regular build but not there during the shared
build. Fix by moving the testing routine into the package itself.

For good measure, section off the assembly files from the non-experiment
build. Should prevent further build failures as we work on this.
Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7

Change diff

diff --git a/src/runtime/secret/asm_amd64.s b/src/runtime/secret/asm_amd64.s
index 7011afc..0f2a474 100644
--- a/src/runtime/secret/asm_amd64.s
+++ b/src/runtime/secret/asm_amd64.s
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

+//go:build goexperiment.runtimesecret
+
// Note: this assembly file is used for testing only.
// We need to access registers directly to properly test
// that secrets are erased and go test doesn't like to conditionally
@@ -208,6 +210,6 @@
// registers contain secrets.
// It also tests the path from G stack to M stack
// to scheduler and back.
- CALL ·delay(SB)
+ CALL runtime∕secret·delay(SB)

RET
diff --git a/src/runtime/secret/asm_arm64.s b/src/runtime/secret/asm_arm64.s
index 1d7f7c1..6fa625a 100644
--- a/src/runtime/secret/asm_arm64.s
+++ b/src/runtime/secret/asm_arm64.s
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

+//go:build goexperiment.runtimesecret
+
// Note: this assembly file is used for testing only.
// We need to access registers directly to properly test
// that secrets are erased and go test doesn't like to conditionally
diff --git a/src/runtime/secret/stubs.go b/src/runtime/secret/stubs.go
index ec66ef2..3438d97 100644
--- a/src/runtime/secret/stubs.go
+++ b/src/runtime/secret/stubs.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

-//go:build arm64 || amd64
+//go:build goexperiment.runtimesecret && (arm64 || amd64)

// testing stubs, these are implemented in assembly in
// asm_$GOARCH.s
@@ -13,7 +13,10 @@

package secret

-import "unsafe"
+import (
+ "time"
+ "unsafe"
+)

// Load data from p into test registers.
//
@@ -30,3 +33,8 @@
//
//go:noescape
func useSecret(secret []byte)
+
+// callback from assembly
+func delay() {
+ time.Sleep(1 * time.Millisecond)
+}
diff --git a/src/runtime/secret/testdata/crash.go b/src/runtime/secret/testdata/crash.go
index cf48fb7..1ee1ea6 100644
--- a/src/runtime/secret/testdata/crash.go
+++ b/src/runtime/secret/testdata/crash.go
@@ -18,13 +18,6 @@
"weak"
)

-// callback from assembly
-//
-//go:linkname delay main.delay
-func delay() {
- time.Sleep(1 * time.Millisecond)
-}
-
// Same secret as in ../../crash_test.go
var secretStore = [8]byte{
0x00,

Change information

Files:
  • M src/runtime/secret/asm_amd64.s
  • M src/runtime/secret/asm_arm64.s
  • M src/runtime/secret/stubs.go
  • M src/runtime/secret/testdata/crash.go
Change size: S
Delta: 4 files changed, 15 insertions(+), 10 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
Gerrit-Change-Number: 724001
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Daniel Morsing (Gerrit)

unread,
Nov 27, 2025, 2:26:58 AM (3 days ago) Nov 27
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Austin Clements, Keith Randall and Michael Knyszek

Daniel Morsing uploaded new patchset

Daniel Morsing uploaded patch set #2 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Keith Randall
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
Gerrit-Change-Number: 724001
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Michael Knyszek <mkny...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Daniel Morsing (Gerrit)

unread,
Nov 27, 2025, 2:29:19 AM (3 days ago) Nov 27
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Austin Clements, Keith Randall and Michael Knyszek

Daniel Morsing uploaded new patchset

Daniel Morsing uploaded patch set #3 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Keith Randall
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
Gerrit-Change-Number: 724001
Gerrit-PatchSet: 3
unsatisfied_requirement
satisfied_requirement
open
diffy

Filippo Valsorda (Gerrit)

unread,
Nov 27, 2025, 5:45:04 AM (3 days ago) Nov 27
to Filippo Valsorda, Daniel Morsing, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Austin Clements, David Chase, Filippo Valsorda, Keith Randall and Michael Knyszek

Filippo Valsorda uploaded new patchset

Filippo Valsorda uploaded patch set #4 to the change originally created by Daniel Morsing.
Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • David Chase
  • Filippo Valsorda
  • Keith Randall
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
Gerrit-Change-Number: 724001
Gerrit-PatchSet: 4
Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
Gerrit-Attention: David Chase <drc...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Filippo Valsorda (Gerrit)

unread,
Nov 27, 2025, 5:50:19 AM (3 days ago) Nov 27
to Filippo Valsorda, Daniel Morsing, goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Austin Clements, Keith Randall, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Austin Clements, Daniel Morsing, David Chase, Keith Randall and Michael Knyszek

Filippo Valsorda voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Daniel Morsing
  • David Chase
  • Keith Randall
  • Michael Knyszek
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
Gerrit-Change-Number: 724001
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: David Chase <drc...@google.com>
Gerrit-Attention: Daniel Morsing <daniel....@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Michael Knyszek <mkny...@google.com>
Gerrit-Comment-Date: Thu, 27 Nov 2025 10:50:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

David Chase (Gerrit)

unread,
Nov 27, 2025, 8:46:24 AM (3 days ago) Nov 27
to Filippo Valsorda, Daniel Morsing, goph...@pubsubhelper.golang.org, Go LUCI, Austin Clements, Keith Randall, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Austin Clements, Daniel Morsing, Filippo Valsorda, Keith Randall and Michael Knyszek

David Chase voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Daniel Morsing
  • Filippo Valsorda
  • Keith Randall
  • Michael Knyszek
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
Gerrit-Change-Number: 724001
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
Gerrit-Reviewer: Austin Clements <aus...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
Gerrit-Attention: Daniel Morsing <daniel....@gmail.com>
Gerrit-Attention: Austin Clements <aus...@google.com>
Gerrit-Attention: Michael Knyszek <mkny...@google.com>
Gerrit-Comment-Date: Thu, 27 Nov 2025 13:46:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Dmitri Shuralyov (Gerrit)

unread,
Nov 27, 2025, 8:52:12 AM (3 days ago) Nov 27
to Filippo Valsorda, Daniel Morsing, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, David Chase, Go LUCI, Austin Clements, Keith Randall, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Austin Clements, Daniel Morsing, Filippo Valsorda, Keith Randall and Michael Knyszek

Dmitri Shuralyov voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Daniel Morsing
  • Filippo Valsorda
  • Keith Randall
  • Michael Knyszek
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
    Gerrit-Change-Number: 724001
    Gerrit-PatchSet: 5
    Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
    Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Keith Randall <k...@golang.org>
    Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
    Gerrit-Attention: Daniel Morsing <daniel....@gmail.com>
    Gerrit-Attention: Austin Clements <aus...@google.com>
    Gerrit-Attention: Michael Knyszek <mkny...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 13:52:09 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Gopher Robot (Gerrit)

    unread,
    Nov 27, 2025, 8:54:31 AM (3 days ago) Nov 27
    to Daniel Morsing, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Dmitri Shuralyov, Dmitri Shuralyov, David Chase, Filippo Valsorda, Go LUCI, Austin Clements, Keith Randall, Michael Knyszek, golang-co...@googlegroups.com

    Gopher Robot submitted the change

    Change information

    Commit message:
    runtime/secret: reorganize tests to fix -buildmode=shared

    The testing assembly methods had a linkname that was implicitly

    satisfied during the regular build but not there during the shared
    build. Fix by moving the testing routine into the package itself.

    For good measure, section off the assembly files from the non-experiment
    build. Should prevent further build failures as we work on this.
    Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-arm64-longtest
    Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
    Reviewed-by: David Chase <drc...@google.com>
    Auto-Submit: Filippo Valsorda <fil...@golang.org>
    Reviewed-by: Filippo Valsorda <fil...@golang.org>
    Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
    Files:
    • M src/runtime/secret/asm_amd64.s
    • M src/runtime/secret/asm_arm64.s
    • M src/runtime/secret/stubs.go
    • M src/runtime/secret/testdata/crash.go
    Change size: S
    Delta: 4 files changed, 17 insertions(+), 9 deletions(-)
    Branch: refs/heads/master
    Submit Requirements:
    • requirement satisfiedCode-Review: +2 by Filippo Valsorda, +2 by David Chase, +1 by Dmitri Shuralyov
    • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I2b45668e44641ae7880ff14f6402d982c7eaedd7
    Gerrit-Change-Number: 724001
    Gerrit-PatchSet: 6
    Gerrit-Owner: Daniel Morsing <daniel....@gmail.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages