type largePointer [UserArenaChunkBytes/unsafe.Sizeof(&smallPointer{}) + 1]*smallPointer
func TestUserArena(t *testing.T) {
+ if Clobberfree() {
+ // This test crashes with SEGV in clobberfree in mgcsweep.go with GODEBUG=clobberfree=1.
+ t.Skip("triggers SEGV with GODEBUG=clobberfree=1")
+ }
+
// Set GOMAXPROCS to 2 so we don't run too many of these
// tests in parallel.
defer GOMAXPROCS(GOMAXPROCS(2))
}
func TestUserArenaLiveness(t *testing.T) {
+ if Clobberfree() {
+ // This test crashes with SEGV in clobberfree in mgcsweep.go with GODEBUG=clobberfree=1.
+ t.Skip("triggers SEGV with GODEBUG=clobberfree=1")
+ }
+
t.Run("Free", func(t *testing.T) {
testUserArenaLiveness(t, false)
})
}
func TestUserArenaClearsPointerBits(t *testing.T) {
+ if Clobberfree() {
+ // This test crashes with SEGV in clobberfree in mgcsweep.go with GODEBUG=clobberfree=1.
+ t.Skip("triggers SEGV with GODEBUG=clobberfree=1")
+ }
+
// This is a regression test for a serious issue wherein if pointer bits
// aren't properly cleared, it's possible to allocate scalar data down
// into a previously pointer-ful area, causing misinterpretation by the GC.
const PtrSize = goarch.PtrSize
+const ClobberdeadPtr = clobberdeadPtr
+
+func Clobberfree() bool {
+ return debug.clobberfree != 0
+}
+
var ForceGCPeriod = &forcegcperiod
// SetTracebackEnv is like runtime/debug.SetTraceback, but it raises