canonical / go-dqlite

Go bindings for libdqlite
https://dqlite.io
Apache License 2.0
432 stars 69 forks source link

Nondeterministic nil Logger dereference in driver #294

Closed cole-miller closed 2 months ago

cole-miller commented 6 months ago

Link from LXD CI: https://github.com/canonical/lxd/actions/runs/8734959420/job/23966714710?pr=13348

Backtrace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x107c759]

goroutine 1636 [running]:
github.com/canonical/go-dqlite/driver.driverError(0x0, {0x25d4820, 0xc001008c60})
    /home/runner/go/pkg/mod/github.com/canonical/go-dqlite@v1.21.0/driver/driver.go:858 +0x599
github.com/canonical/go-dqlite/driver.(*Rows).Close(0xc002925d40)
    /home/runner/go/pkg/mod/github.com/canonical/go-dqlite@v1.21.0/driver/driver.go:724 +0x88
database/sql.(*Rows).close.func1()
    /opt/hostedtoolcache/go/1.22.2/x64/src/database/sql/sql.go:3412 +0x29
database/sql.withLock({0x25de3f8, 0xc000e24990}, 0xc000ef56a8)
    /opt/hostedtoolcache/go/1.22.2/x64/src/database/sql/sql.go:3530 +0x82
database/sql.(*Rows).close(0xc002925dd0, {0x25cee00, 0x3c78e40})
    /opt/hostedtoolcache/go/1.22.2/x64/src/database/sql/sql.go:3411 +0x152
database/sql.(*Rows).awaitDone(0xc002925dd0, {0x25e7840, 0xc000356700}, {0x25e77d0, 0xc0011c3b80}, {0x25e77d0, 0xc0012f7540})
    /opt/hostedtoolcache/go/1.22.2/x64/src/database/sql/sql.go:3001 +0x1fb
created by database/sql.(*Rows).initContextClose in goroutine 1611
    /opt/hostedtoolcache/go/1.22.2/x64/src/database/sql/sql.go:2977 +0x150
cole-miller commented 2 months ago

Closing as fixed by #308