Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit 308f5f1b2fae699cb38474136205cbab8f081019 - "Treat []byte{} as empty bytes instead of NULL." causes cgo argument has Go pointer to Go pointer panic #428

Closed
emakeev opened this issue Jun 20, 2017 · 0 comments

Comments

@emakeev
Copy link

emakeev commented Jun 20, 2017

Commit 308f5f1 reverted "bind: pass &v[0] in direct call to C" fix (commit b76c610) and we started seeing the following cgo panic on some of our unit tests:

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

panic(0xacd980, 0xc42036eaf0)
/usr/lib/go-1.8/src/runtime/panic.go:489 +0x2cf
github.com/mattn/go-sqlite3.(*SQLiteStmt).bind.func11(0x7f9680015a08, 0xc400000002, 0xc420403bb0, 0xc40000003c, 0x0)
/home/vagrant/external/src/github.com/mattn/go-sqlite3/sqlite3.go:795 +0x8b
github.com/mattn/go-sqlite3.(*SQLiteStmt).bind(0xc4202fa030, 0xc42039caf0, 0x2, 0x2, 0x7f9680015a08, 0x7f9600000002)
/home/vagrant/external/src/github.com/mattn/go-sqlite3/sqlite3.go:795 +0x3a3
github.com/mattn/go-sqlite3.(*SQLiteStmt).exec(0xc4202fa030, 0x7f9698b98890, 0xc420062e38, 0xc42039caf0, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0)
/home/vagrant/external/src/github.com/mattn/go-sqlite3/sqlite3.go:872 +0x86
github.com/mattn/go-sqlite3.(*SQLiteConn).exec(0xc420060f00, 0x7f9698b98890, 0xc420062e38, 0xc42039c9b0, 0x50, 0xc42039caf0, 0x2, 0x2, 0x0, 0x0, ...)
/home/vagrant/external/src/github.com/mattn/go-sqlite3/sqlite3.go:449 +0x2f9
github.com/mattn/go-sqlite3.(*SQLiteConn).ExecContext(0xc420060f00, 0x10b0340, 0xc420062e38, 0xc42039c9b0, 0x50, 0xc42039caa0, 0x2, 0x2, 0xc42045d800, 0xc4203dab60, ...)
/home/vagrant/external/src/github.com/mattn/go-sqlite3/sqlite3_go18.go:40 +0x25b
database/sql.ctxDriverExec(0x10b0340, 0xc420062e38, 0x7f9698b99948, 0xc420060f00, 0xc42039c9b0, 0x50, 0xc42039caa0, 0x2, 0x2, 0x431dee, ...)
/usr/lib/go-1.8/src/database/sql/ctxutil.go:31 +0x28d
database/sql.(*Tx).ExecContext.func1()
/usr/lib/go-1.8/src/database/sql/sql.go:1690 +0x99
database/sql.withLock(0x10aa0c0, 0xc4200ae5b0, 0xc420477340)
/usr/lib/go-1.8/src/database/sql/sql.go:2545 +0x65
database/sql.(*Tx).ExecContext(0xc420071300, 0x10b0340, 0xc420062e38, 0xc42039c9b0, 0x50, 0xc420477588, 0x2, 0x2, 0x0, 0x0, ...)
/usr/lib/go-1.8/src/database/sql/sql.go:1691 +0x535
database/sql.(*Tx).Exec(0xc420071300, 0xc42039c9b0, 0x50, 0xc420477588, 0x2, 0x2, 0x50, 0x0, 0x0, 0x0)
/usr/lib/go-1.8/src/database/sql/sql.go:1716 +0x85

@emakeev emakeev changed the title Commit 308f5f1b2fae699cb38474136205cbab8f081019 (Treat []byte{} as empty bytes instead of NULL.) causes runtime error: cgo argument has Go pointer to Go pointer Commit 308f5f1b2fae699cb38474136205cbab8f081019 - "Treat []byte{} as empty bytes instead of NULL." causes cgo argument has Go pointer to Go pointer panic Jun 20, 2017
emakeev added a commit to emakeev/go-sqlite3 that referenced this issue Jun 21, 2017
@mattn mattn closed this as completed Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants