dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

Tests in query package crash

Open ashwin95r opened this issue 9 years ago • 3 comments

2017/01/20 17:16:48 lists.go:136: Commit counters. done:     1 noop:     0
[   1] Writing batch of size: 1
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x9120fb]

runtime stack:
runtime.throw(0xa4a43f, 0x2a)
	/usr/local/go/src/runtime/panic.go:566 +0x95
runtime.sigpanic()
	/usr/local/go/src/runtime/sigpanic_unix.go:12 +0x2cc

goroutine 2135 [syscall, locked to thread]:
runtime.cgocall(0x911270, 0xc42668ebb8, 0xc400000000)
	/usr/local/go/src/runtime/cgocall.go:131 +0x110 fp=0xc42668eb88 sp=0xc42668eb48
github.com/dgraph-io/dgraph/rdb._Cfunc_rdb_write(0x7f1ff0145380, 0x7f1ff0157910, 0x7f1fe0001000, 0xc4226ba030)
	github.com/dgraph-io/dgraph/rdb/_obj/_cgo_gotypes.go:721 +0x45 fp=0xc42668ebb8 sp=0xc42668eb88
github.com/dgraph-io/dgraph/rdb.(*DB).Write(0xc427f34d40, 0xc427f38090, 0xc4226ba640, 0x0, 0x0)
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/rdb/db.go:136 +0x27e fp=0xc42668ec60 sp=0xc42668ebb8
github.com/dgraph-io/dgraph/store.(*Store).WriteBatch(0xc427efb9b0, 0xc4226ba640, 0xf, 0xf)
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/store/store.go:129 +0x41 fp=0xc42668ec98 sp=0xc42668ec60
github.com/dgraph-io/dgraph/posting.batchSync()
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/posting/lists.go:479 +0x504 fp=0xc42668efb0 sp=0xc42668ec98
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42668efb8 sp=0xc42668efb0
created by github.com/dgraph-io/dgraph/posting.Init
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/posting/lists.go:336 +0x1a2

goroutine 1 [chan receive]:
testing.(*T).Run(0xc420192180, 0xa40de8, 0x1b, 0xa854f0, 0xc42015fd01)
	/usr/local/go/src/testing/testing.go:647 +0x316
testing.RunTests.func1(0xc420192180)
	/usr/local/go/src/testing/testing.go:793 +0x6d
testing.tRunner(0xc420192180, 0xc42003ce18)
	/usr/local/go/src/testing/testing.go:610 +0x81
testing.RunTests(0xa867f0, 0xeedca0, 0x5d, 0x5d, 0xc42002e018)
	/usr/local/go/src/testing/testing.go:799 +0x2f5
testing.(*M).Run(0xc42003cef8, 0xc420070058)
	/usr/local/go/src/testing/testing.go:743 +0x85
github.com/dgraph-io/dgraph/query.TestMain(0xc42003cef8)
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/query/query_test.go:2837 +0x37
main.main()
	github.com/dgraph-io/dgraph/query/_test/_testmain.go:236 +0xc6

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2086 +0x1

goroutine 19 [chan receive]:
github.com/dgraph-io/dgraph/uid.(*lockManager).clean(0xc420188f00)
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/uid/assigner.go:55 +0x88
created by github.com/dgraph-io/dgraph/uid.init.1
	/home/ashwin/go/src/github.com/dgraph-io/dgraph/uid/assigner.go:74 +0xeb

ashwin95r avatar Jan 20 '17 06:01 ashwin95r

This seems like an issue specific to testing. The pstore pointer is probably being replaced from underneath the goroutine which is writing data to that pstore.

I also can't reproduce it on my machine. Tests in query package pass 3/3 times.

manishrjain avatar Jan 23 '17 00:01 manishrjain

https://github.com/dgraph-io/dgraph/pull/520

manishrjain avatar Jan 23 '17 02:01 manishrjain

Okay. Fixed now. Remove all the race conditions.

manishrjain avatar Jan 23 '17 03:01 manishrjain