lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.98k stars 909 forks source link

runtime error: index out of range #1008

Open streamer45 opened 3 years ago

streamer45 commented 3 years ago

Hi, we've recently received a crash report that points at pq. Unfortunately I wasn't able to reproduce this yet.

This is pretty much all the information I have:

runtime.boundsError: runtime error: index out of range [7] with length 1
  File "error.go", line 488, in (*conn).errRecover
  File "binary.go", line 125, in bigEndian.Uint64
  File "encode.go", line 77, in binaryDecode
  File "encode.go", line 64, in decode
  File "conn.go", line 1537, in (*rows).Next
  File "sql.go", line 2787, in (*Rows).nextLocked
  File "sql.go", line 2765, in (*Rows).Next.func1
  File "sql.go", line 3204, in withLock
  File "sql.go", line 2764, in (*Rows).Next

Go version is go1.14.6. pq version is v1.7.0.

Let me know if there's anything else I could provide to help investigating this.

agarciamontoro commented 6 months ago

We're still seeing this issue in our crash reports (with a different minor version now: v1.10.9)

runtime.boundsError: runtime error: index out of range [7] with length 0
  File "github.com/lib/pq@v1.10.9/error.go", line 493, in (*conn).errRecover
  File "encoding/binary/binary.go", line 179, in bigEndian.Uint64
  File "github.com/lib/pq@v1.10.9/encode.go", line 77, in binaryDecode
  File "github.com/lib/pq@v1.10.9/encode.go", line 64, in decode
  File "github.com/lib/pq@v1.10.9/conn.go", line 1618, in (*rows).Next
  File "database/sql/sql.go", line 2974, in (*Rows).nextLocked
  File "database/sql/sql.go", line 2952, in (*Rows).Next.func1
  File "database/sql/sql.go", line 3405, in withLock
  File "database/sql/sql.go", line 2951, in (*Rows).Next
  File "github.com/jmoiron/sqlx@v1.3.5/sqlx.go", line 952, in scanAll
  File "github.com/jmoiron/sqlx@v1.3.5/sqlx_context.go", line 61, in SelectContext
  File "github.com/jmoiron/sqlx@v1.3.5/sqlx_context.go", line 140, in (*DB).SelectContext