gomdb icon indicating copy to clipboard operation
gomdb copied to clipboard

panic: runtime error: cgo argument has Go pointer to Go pointer

Open zhengxiaochuan-3 opened this issue 7 years ago • 2 comments

[root@localhost gomdb]# go version go version go1.8 linux/amd64

[root@localhost gomdb]# go test -bench .
--- FAIL: TestTest1 (0.00s)
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
	panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 23 [running, locked to thread]:
testing.tRunner.func1(0xc4200789c0)
	/usr/local/go/src/testing/testing.go:622 +0x29d
panic(0x543e00, 0xc420070f80)
	/usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/szferi/gomdb.(*Txn).Put.func1(0x217ce960, 0xc400000001, 0xc420070f60, 0xc420070f70, 0xc400000010, 0x5)
	/home/go-project/src/github.com/szferi/gomdb/txn.go:149 +0x8b
github.com/szferi/gomdb.(*Txn).Put(0xc4200820d8, 0x1, 0xc420070f50, 0x5, 0x8, 0xc420070f58, 0x5, 0x8, 0x10, 0x0, ...)
	/home/go-project/src/github.com/szferi/gomdb/txn.go:149 +0xf7
github.com/szferi/gomdb.TestTest1(0xc4200789c0)
	/home/go-project/src/github.com/szferi/gomdb/mdb_test.go:52 +0x7ec
testing.tRunner(0xc4200789c0, 0x572d90)
	/usr/local/go/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:697 +0x2ca
exit status 2
FAIL	github.com/szferi/gomdb	0.006s

zhengxiaochuan-3 avatar Aug 15 '17 05:08 zhengxiaochuan-3

IIRC go 1.8 checks for this issue while prior versions did not. I don't think this library will work until he fixes it. Unfortunately, this repo seems a little quiet :(

itsmontoya avatar Feb 03 '18 03:02 itsmontoya

I think the approach which https://github.com/bmatsuo/lmdb-go/commit/ee54e2707659a775ce40c351d7edb67f7868dabd#diff-0883e46e594b4d9e50c72005c5d390d9 implements (in a separate repo/project) is what needs to be done here as well.

stapelberg avatar Feb 16 '18 22:02 stapelberg