From 949dd102229453f8fb55816ea9c33fc762324780 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 6 Jan 2015 13:46:13 -0500 Subject: [PATCH] misc/cgo: disable TestAllocateFromC in wbshadow mode This test is doing pointer graph manipulation from C, and we cannot support that with concurrent GC. The wbshadow mode correctly diagnoses missing write barriers. Disable the test in that mode for now. There is a bigger issue behind it, namely SWIG, but for now we are focused on making all.bash pass with wbshadow enabled. Change-Id: I55891596d4c763e39b74082191d4a5fac7161642 Reviewed-on: https://go-review.googlesource.com/2346 Reviewed-by: Minux Ma Reviewed-by: Rick Hudson --- misc/cgo/test/callback.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/misc/cgo/test/callback.go b/misc/cgo/test/callback.go index 64fd4707d2..8c8ccbe34a 100644 --- a/misc/cgo/test/callback.go +++ b/misc/cgo/test/callback.go @@ -17,6 +17,7 @@ int returnAfterGrowFromGo(void); import "C" import ( + "os" "path" "runtime" "strings" @@ -211,6 +212,19 @@ func testPanicFromC(t *testing.T) { } func testAllocateFromC(t *testing.T) { + if strings.Contains(os.Getenv("GODEBUG"), "wbshadow=") { + // This test is writing pointers to Go heap objects from C. + // As such, those writes have no write barriers, and + // wbshadow=2 mode correctly discovers that and crashes. + // Disable test if any wbshadow mode is enabled. + // TODO(rsc): I am not sure whether the test is fundamentally + // incompatible with concurrent collection and should be + // turned off or rewritten entirely. The test is attempting to + // mimic some SWIG behavior, so it is important to work + // through what we expect before trying SWIG and C++ + // with the concurrent collector. + t.Skip("test is incompatible with wbshadow=") + } C.callCgoAllocate() // crashes or exits on failure } -- 2.50.0