franela / goblin

Minimal and Beautiful Go testing framework
MIT License
887 stars 79 forks source link

Random panic on runtime.errorString conversion #25

Closed kachayev closed 11 years ago

kachayev commented 11 years ago

From time to time go test -v command fails with

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: interface conversion: interface is runtime.errorString, not string [recovered]
    panic: interface conversion: interface is runtime.errorString, not string
[signal 0xb code=0x1 addr=0x0 pc=0x3b924]

goroutine 4 [running]:
testing.func·004()
    /usr/local/Cellar/go/1.1/src/pkg/testing/testing.go:348 +0xcd
github.com/franela/goblin.func·001()
    ~/src/github.com/franela/goblin/goblin.go:156 +0x9d

Unfortunately, I can't find appropriate scenario to reproduce this situation, but it happens quite often.

marcosnils commented 11 years ago

Can you please provide further information about the system you're running Goblin in?.

Does this happens always with the same test or it just crashes randomly?

Thanks,

Marcos.

kachayev commented 11 years ago

I'm not sure what information can help you:

$ go version
go version go1.1 darwin/amd64
$ uname -a
Darwin local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GORACE=""
GOTOOLDIR="/usr/local/Cellar/go/1.1/pkg/tool/darwin_amd64"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common"
CGO_ENABLED="1"
$ cat /src/github.com/franela/goblin/.git/HEAD
42acea7b160991b24bf413d8c43140dafca60fca

It crashes randomly.

marcosnils commented 11 years ago

Thx for the update.

One last question. Are you using Gomega assertions in your test?

marcosnils commented 11 years ago

We've identified the issue. Fix is on the way.

kachayev commented 11 years ago

Are you using Gomega assertions in your test?

Nope.

Fix is on the way.

Great, thanks!

xetorthio commented 11 years ago

Fixed with pull request #26

Could you please update goblin to the last version and check if you are still getting the same error?

We'll wait for your feedback before closing this.

kachayev commented 11 years ago

Ah, now it works fine. Thanks!

marcosnils commented 11 years ago

Awsome.

Closed!.