Skip to content

cmd/go: go test -n SEGV since test caching commit #22644

@thanm

Description

@thanm

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

tip,
go version devel +89bcbf40b8 Fri Nov 3 20:12:07 2017 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Run any small test with "-n". Example:

$ cat blah.go
package blah

import "fmt"

func Blah() int {
	fmt.Print("Blah!\n")
	return 1
}
$ cat blah_test.go
package blah

import "testing"

func TestBlah(t *testing.T) {
	if Blah() != 1 {
		t.Errorf("not 1")
		return
	}
}
$ go test -n -test.v .

What did you expect to see?

$ go test -n -test.v .
<lots of output, but 0 exit status>

What did you see instead?

$ go test -n -test.v .
<lots of output>

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x7a27e6]

goroutine 63 [running]:
bytes.(*Buffer).Bytes(...)
	/ssd2/go/src/bytes/buffer.go:53
cmd/go/internal/test.builderPrintTest(0xc4201bbd60, 0xc4202ccfc0, 0x5aae03, 0xc4201bbdd0)
	/ssd2/go/src/cmd/go/internal/test/test.go:1475 +0x56
cmd/go/internal/work.(*Builder).Do.func1(0xc4202ccfc0)
	/ssd2/go/src/cmd/go/internal/work/exec.go:100 +0x72
cmd/go/internal/work.(*Builder).Do.func2(0xc4202c6530, 0xc4201bbd60, 0xc4202aa380)
	/ssd2/go/src/cmd/go/internal/work/exec.go:158 +0xbb
created by cmd/go/internal/work.(*Builder).Do
	/ssd2/go/src/cmd/go/internal/work/exec.go:145 +0x366

Git bisect blames bd95f88. @rsc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions