[go] runtime: add a test for issue 78081

0 views
Skip to first unread message

Keith Randall (Gerrit)

unread,
12:19 PM (6 hours ago) 12:19 PM
to Keith Randall, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Keith Randall, Michael Pratt, Go LUCI, golang-co...@googlegroups.com

Keith Randall submitted the change

Change information

Commit message:
runtime: add a test for issue 78081

Contrive to have a bunch of stack shrinking going on during
memclrNoHeapPointersPreemptible calls.

Fails at tip with this patch:

--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -2184,6 +2184,7 @@ func reusableSize(size uintptr) bool {
// Use this with care; if the data being cleared is tagged to contain
// pointers, this allows the GC to run before it is all cleared.
func memclrNoHeapPointersChunked(size uintptr, x unsafe.Pointer) {
+ y := uintptr(x)
if getg().preempt {
// TODO: no need for this, except to test that
// the preemption point is ok for small zeroings.
@@ -2193,6 +2194,7 @@ func memclrNoHeapPointersChunked(size uintptr, x unsafe.Pointer) {
// may hold locks, e.g., profiling
goschedguarded()
}
+ x = unsafe.Pointer(y)
// got this from benchmarking. 128k is too small, 512k is too large.
const chunkBytes = 256 * 1024
for size > chunkBytes {

Update #78081
Change-Id: Id8f87a4b0d0970cbf971c90ab87703a9e5b3f121
Reviewed-by: Michael Pratt <mpr...@google.com>
Reviewed-by: Keith Randall <k...@google.com>
Files:
  • A test/fixedbugs/issue78081.go
Change size: S
Delta: 1 file changed, 47 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Keith Randall, +2 by Michael Pratt
  • 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: Id8f87a4b0d0970cbf971c90ab87703a9e5b3f121
Gerrit-Change-Number: 755942
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages