davecgh / go-spew

Implements a deep pretty printer for Go data structures to aid in debugging
ISC License
6.05k stars 364 forks source link

Bug with go 1.4.1 #25

Closed m0sth8 closed 9 years ago

m0sth8 commented 9 years ago

Hi! I used go-spew in long running process and had this error:

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x1 pc=0x8069ef0]

runtime stack:
runtime.gothrow(0x8416f68, 0x2a)
        /usr/local/go/src/runtime/panic.go:503 +0x67 fp=0xb63e2f4c sp=0xb63e2f40
runtime.sigpanic()
        /usr/local/go/src/runtime/sigpanic_unix.go:14 +0x53 fp=0xb63e2f74 sp=0xb63e2f4c
scanblock(0x189c89e8, 0x10, 0x8438b68)
        /usr/local/go/src/runtime/mgc0.c:311 +0x840 fp=0xb63e3014 sp=0xb63e2f74
scanframe(0xb63e30a0, 0x0, 0x1)
        /usr/local/go/src/runtime/mgc0.c:740 +0x186 fp=0xb63e3050 sp=0xb63e3014
runtime.gentraceback(0x80520d0, 0x189c89e4, 0x0, 0x1887adc0, 0x0, 0x0, 0x7fffffff, 0xb63e30f8, 0x0, 0x0, ...)
        /usr/local/go/src/runtime/traceback.go:311 +0x5c5 fp=0xb63e30cc sp=0xb63e3050
scanstack(0x1887adc0)
        /usr/local/go/src/runtime/mgc0.c:777 +0x1e0 fp=0xb63e3104 sp=0xb63e30cc
markroot(0x1870a050, 0xc4)
        /usr/local/go/src/runtime/mgc0.c:553 +0xcd fp=0xb63e313c sp=0xb63e3104
runtime.parfordo(0x1870a050)
        /usr/local/go/src/runtime/parfor.c:76 +0x99 fp=0xb63e3198 sp=0xb63e313c
gc(0xb63e32d4)
        /usr/local/go/src/runtime/mgc0.c:1439 +0x1fb fp=0xb63e32c4 sp=0xb63e3198
runtime.gc_m()
        /usr/local/go/src/runtime/mgc0.c:1368 +0xd2 fp=0xb63e32e4 sp=0xb63e32c4
runtime.onM(0x18710000)
        /usr/local/go/src/runtime/asm_386.s:266 +0x50 fp=0xb63e32e8 sp=0xb63e32e4
runtime.mstart()
        /usr/local/go/src/runtime/proc.c:818 fp=0xb63e32ec sp=0xb63e32e8

goroutine 6662130 [garbage collection]:
runtime.switchtoM()
        /usr/local/go/src/runtime/asm_386.s:208 fp=0x1881eae8 sp=0x1881eae4
runtime.gogc(0x0)
        /usr/local/go/src/runtime/malloc.go:469 +0x1aa fp=0x1881eb08 sp=0x1881eae8
runtime.mallocgc(0x10, 0x0, 0x3, 0x0)
        /usr/local/go/src/runtime/malloc.go:341 +0x2c4 fp=0x1881eb60 sp=0x1881eb08
runtime.rawmem(0x8, 0x8)
        /usr/local/go/src/runtime/malloc.go:371 +0x38 fp=0x1881eb74 sp=0x1881eb60
runtime.growslice(0x82e40e0, 0x1881ebd8, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/runtime/slice.go:83 +0x210 fp=0x1881ebb4 sp=0x1881eb74
github.com/davecgh/go-spew/spew.(*dumpState).dumpPtr(0x18878b80, 0x8379ec0, 0x1882f400, 0x36)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:107 +0x65b fp=0x1881ec6c sp=0x1881ebb4
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x8379ec0, 0x1882f400, 0x36)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:259 +0xdf fp=0x1881edc4 sp=0x1881ec6c
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x82ec860, 0x18737494, 0xf5)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:382 +0xdbd fp=0x1881ef1c sp=0x1881edc4
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x837c9a0, 0x18737480, 0xf9)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:412 +0x13e2 fp=0x1881f074 sp=0x1881ef1c
github.com/davecgh/go-spew/spew.(*dumpState).dumpPtr(0x18878b80, 0x8379ec0, 0x18737480, 0x36)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:154 +0x593 fp=0x1881f12c sp=0x1881f074
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x8379ec0, 0x18737480, 0x36)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:259 +0xdf fp=0x1881f284 sp=0x1881f12c
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x837c9a0, 0x188536e0, 0xf9)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:412 +0x13e2 fp=0x1881f3dc sp=0x1881f284
github.com/davecgh/go-spew/spew.(*dumpState).dumpPtr(0x18878b80, 0x8379ec0, 0x188536e0, 0x36)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:154 +0x593 fp=0x1881f494 sp=0x1881f3dc
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x8379ec0, 0x188536e0, 0x36)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:259 +0xdf fp=0x1881f5ec sp=0x1881f494
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x837e2a0, 0x1882b560, 0xd9)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:412 +0x13e2 fp=0x1881f744 sp=0x1881f5ec
github.com/davecgh/go-spew/spew.(*dumpState).dumpPtr(0x18878b80, 0x838bc80, 0x1882b560, 0x16)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:154 +0x593 fp=0x1881f7fc sp=0x1881f744
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x838bc80, 0x1882b560, 0x16)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:259 +0xdf fp=0x1881f954 sp=0x1881f7fc
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x837f2a0, 0x18853700, 0xd9)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:412 +0x13e2 fp=0x1881faac sp=0x1881f954
github.com/davecgh/go-spew/spew.(*dumpState).dumpPtr(0x18878b80, 0x837fda0, 0x18853700, 0x16)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:154 +0x593 fp=0x1881fb64 sp=0x1881faac
github.com/davecgh/go-spew/spew.(*dumpState).dump(0x18878b80, 0x837fda0, 0x18853700, 0x16)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:259 +0xdf fp=0x1881fcbc sp=0x1881fb64
github.com/davecgh/go-spew/spew.fdump(0x8570060, 0xb75b8470, 0x1882aae0, 0x1881fdbc, 0x1, 0x1)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:456 +0x22c fp=0x1881fd34 sp=0x1881fcbc
github.com/davecgh/go-spew/spew.Sdump(0x1881fdbc, 0x1, 0x1, 0x0, 0x0)
        /gopath/src/github.com/davecgh/go-spew/spew/dump.go:471 +0x8e fp=0x1881fd74 sp=0x1881fd34
davecgh commented 9 years ago

Thanks for the report.

That looks a lot more like a run-time error than a spew issue from a quick look at this trace, but I'll dig into this a bit more.

davecgh commented 9 years ago

Are you dumping C structs/data by chance? I'm fairly certain this means you got a SIGSEGV signal while running C code.

m0sth8 commented 9 years ago

Unfortunately not, I don't have a C structs/data dump. I've got this exception after a week of work under a loading. Also I didn't have this problem with Go 1.3. Spew dumps very complex structure with map, channels, slices and mutexes. Is it possible that go raised panic because structure was modified in another goroutine?

davecgh commented 9 years ago

You are running the most recent version of spew as well, right? (go get -u github.com/davecgh/go-spew/spew) I haven't had a chance to dig into this any more yet, but I figured I'd ask that first since older versions of spew before commit 128854244a4ac24b718da3d5f79cf5541c81ee56 will definitely panic with the go1.4+ runtime.

m0sth8 commented 9 years ago

I used this commit https://github.com/davecgh/go-spew/commit/3fdaf5cea8d23107b993d363e98992fa529dd713 . So I'll update spew and try again. Thank you!

davecgh commented 9 years ago

Alright. I'm pretty that was your issue. I'm going to close this, but please comment if you run into any more issues.