snowflakedb / gosnowflake

Go Snowflake Driver
Apache License 2.0
285 stars 116 forks source link

Add log to debug null pointer deference #1133

Closed madisonchamberlain closed 3 weeks ago

madisonchamberlain commented 2 months ago

Description

We are seeing a decent amount of panics in the chunk downloader. The panic looks like this

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

goroutine 149662 [running]:
github.com/snowflakedb/gosnowflake.decodeChunk({0x291d658, 0xc00235b3b0}, 0xc003c9cc00, 0xa, 0xc002540000)
    /go/pkg/mod/github.com/snowflakedb/gosnowflake@v1.9.1-0.20240419071412-c8216932b807/chunk_downloader.go:461 +0x593
github.com/snowflakedb/gosnowflake.downloadChunkHelper({0x291d658, 0xc00235b3b0}, 0xc003c9cc00, 0xa)
    /go/pkg/mod/github.com/snowflakedb/gosnowflake@v1.9.1-0.20240419071412-c8216932b807/chunk_downloader.go:392 +0x88e
github.com/snowflakedb/gosnowflake.downloadChunk({0x291d658, 0xc00235b3b0}, 0xc003c9cc00, 0xa)
    /go/pkg/mod/github.com/snowflakedb/gosnowflake@v1.9.1-0.20240419071412-c8216932b807/chunk_downloader.go:348 +0x147
created by github.com/snowflakedb/gosnowflake.(*snowflakeChunkDownloader).schedule
    /go/pkg/mod/github.com/snowflakedb/gosnowflake@v1.9.1-0.20240419071412-c8216932b807/chunk_downloader.go:151 +0x187

I know that something on the downloader's connection is null. Either the connection itself or the cfg. This is the only way for me to really know