Crdb panic when run benchmarksql

I use benchmarksql to test crdb, and find it panic when run test.

you can use benchmarksql init data to postgresql, then import the pg_dump data. i init 100 warehouses.

after that, you can use benchmarksql-cockroachdb to run the benchmark which modify some sql for crdb.

    ERROR: [client=172.16.73.173:58410,user=root,n1] a SQL panic has occurred!
*
*
* ERROR: [client=172.16.73.173:58415,user=root,n1] a SQL panic has occurred!
*
*
* ERROR: [n1] a panic has occurred!
*
*
* ERROR: [n1] a panic has occurred!
*
*
* ERROR: [client=172.16.73.173:58412,user=root,n1] a SQL panic has occurred!
*
*
* ERROR: [n1] a panic has occurred!
*
panic while executing "ROLLBACK": txn: unexpected 39966680 leftover bytes

goroutine 513 [running]:
runtime/debug.Stack(0x7fd0362ce180, 0xc420306270, 0xc420048c00)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x79
github.com/cockroachdb/cockroach/pkg/util/log.ReportPanic(0x7fd0362ce180, 0xc420306270, 0xc420048c00, 0x1b44e00, 0xc426ee30c0, 0x1)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/log/crash_reporting.go:133 +0x180
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).Recover(0xc4207143f0, 0x7fd0362ce180, 0xc420306270)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:181 +0xee
panic(0x1b44e00, 0xc426ee30c0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).serve.func1(0xc420772900, 0x7fd0362ce180, 0xc42516db60)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:423 +0xa1
panic(0x1b44e00, 0xc426ee30c0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql.(*Session).maybeRecover(0xc42562c000, 0x1d08e47, 0x9, 0xc42825ce0d, 0x8)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/session.go:1381 +0x28d
panic(0x1a890a0, 0xc421132be0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql/mon.(*BytesMonitor).doStop(0xc42562c140, 0x7fd036234268, 0xc425737b80, 0xc42562cc01)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/mon/bytes_usage.go:390 +0x27e
github.com/cockroachdb/cockroach/pkg/sql/mon.(*BytesMonitor).Stop(0xc42562c140, 0x7fd036234268, 0xc425737b80)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/mon/bytes_usage.go:375 +0x44
github.com/cockroachdb/cockroach/pkg/sql.(*txnState).finishSQLTxn(0xc42562c088, 0xc42562c000)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/session.go:1151 +0x59
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).execParsed(0xc4209f6000, 0xc42562c000, 0xc42ff0c480, 0x1, 0x1, 0xc4242a31a0, 0x0, 0xb08fc2, 0xed1753699)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:869 +0x857
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).execPrepared(0xc4209f6000, 0xc42562c000, 0xc430955980, 0xc4242a31a0, 0x9, 0xc42825ce0d)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:685 +0x145
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).ExecutePreparedStatement(0xc4209f6000, 0xc42562c000, 0xc430955980, 0xc4242a31a0, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:663 +0x13f
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).handleExecute(0xc420772900, 0xc420772928, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:958 +0x269
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).serve(0xc420772900, 0x7fd0362ce180, 0xc42516db60, 0xc42516a900, 0x5400, 0xc4200d8168, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:526 +0xdd7
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*Server).ServeConn(0xc4200d8000, 0x7fd036234268, 0xc42516e940, 0x2ad4d80, 0xc423a18320, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/server.go:421 +0x96c
github.com/cockroachdb/cockroach/pkg/server.(*Server).Start.func9.1(0x2ad4d80, 0xc423a18320)
        /go/src/github.com/cockroachdb/cockroach/pkg/server/server.go:748 +0x149
github.com/cockroachdb/cockroach/pkg/util/netutil.(*Server).ServeWith.func1(0xc4207143f0, 0x7fd0362ce180, 0xc420306270, 0xc42072c018, 0x2ad4d80, 0xc423a18320, 0xc42033acf0)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/netutil/net.go:140 +0xa9
created by github.com/cockroachdb/cockroach/pkg/util/netutil.(*Server).ServeWith
        /go/src/github.com/cockroachdb/cockroach/pkg/util/netutil/net.go:142 +0x267

panic while executing "ROLLBACK": txn: unexpected 36280296 leftover bytes

goroutine 623 [running]:
runtime/debug.Stack(0x7fd0362ce180, 0xc420306270, 0xc420048c00)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x79
github.com/cockroachdb/cockroach/pkg/util/log.ReportPanic(0x7fd0362ce180, 0xc420306270, 0xc420048c00, 0x1b44e00, 0xc42e6a0240, 0x1)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/log/crash_reporting.go:133 +0x180
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).Recover(0xc4207143f0, 0x7fd0362ce180, 0xc420306270)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:181 +0xee
panic(0x1b44e00, 0xc42e6a0240)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).serve.func1(0xc42063e600, 0x7fd0362ce180, 0xc425164090)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:423 +0xa1
panic(0x1b44e00, 0xc42e6a0240)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql.(*Session).maybeRecover(0xc423a24000, 0x1d08e47, 0x9, 0xc423a20112, 0x8)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/session.go:1381 +0x28d
panic(0x1a890a0, 0xc4220da7c0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql/mon.(*BytesMonitor).doStop(0xc423a24140, 0x7fd036234268, 0xc4225c2580, 0xc423a24c01)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/mon/bytes_usage.go:390 +0x27e
github.com/cockroachdb/cockroach/pkg/sql/mon.(*BytesMonitor).Stop(0xc423a24140, 0x7fd036234268, 0xc4225c2580)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/mon/bytes_usage.go:375 +0x44
github.com/cockroachdb/cockroach/pkg/sql.(*txnState).finishSQLTxn(0xc423a24088, 0xc423a24000)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/session.go:1151 +0x59
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).execParsed(0xc4209f6000, 0xc423a24000, 0xc42ce7c540, 0x1, 0x1, 0xc4215671a0, 0x0, 0xb08fc2, 0xed1753699)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:869 +0x857
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).execPrepared(0xc4209f6000, 0xc423a24000, 0xc42538e000, 0xc4215671a0, 0x9, 0xc423a20112)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:685 +0x145
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).ExecutePreparedStatement(0xc4209f6000, 0xc423a24000, 0xc42538e000, 0xc4215671a0, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:663 +0x13f
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).handleExecute(0xc42063e600, 0xc42063e628, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:958 +0x269
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).serve(0xc42063e600, 0x7fd0362ce180, 0xc425164090, 0xc423a1c030, 0x5400, 0xc4200d8168, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:526 +0xdd7
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*Server).ServeConn(0xc4200d8000, 0x7fd036234268, 0xc423a1e000, 0x2ad4d80, 0xc423a18000, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/server.go:421 +0x96c
github.com/cockroachdb/cockroach/pkg/server.(*Server).Start.func9.1(0x2ad4d80, 0xc423a18000)
        /go/src/github.com/cockroachdb/cockroach/pkg/server/server.go:748 +0x149
github.com/cockroachdb/cockroach/pkg/util/netutil.(*Server).ServeWith.func1(0xc4207143f0, 0x7fd0362ce180, 0xc420306270, 0xc42072c018, 0x2ad4d80, 0xc423a18000, 0xc42033acf0)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/netutil/net.go:140 +0xa9
created by github.com/cockroachdb/cockroach/pkg/util/netutil.(*Server).ServeWith
        /go/src/github.com/cockroachdb/cockroach/pkg/util/netutil/net.go:142 +0x267

panic while executing "ROLLBACK": txn: unexpected 17561544 leftover bytes

goroutine 624 [running]:
runtime/debug.Stack(0x7fd0362ce180, 0xc420306270, 0xc420048c00)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x79
github.com/cockroachdb/cockroach/pkg/util/log.ReportPanic(0x7fd0362ce180, 0xc420306270, 0xc420048c00, 0x1b44e00, 0xc42ea205c0, 0x1)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/log/crash_reporting.go:133 +0x180
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).Recover(0xc4207143f0, 0x7fd0362ce180, 0xc420306270)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:181 +0xee
panic(0x1b44e00, 0xc42ea205c0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).serve.func1(0xc42063ec00, 0x7fd0362ce180, 0xc4251645a0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:423 +0xa1
panic(0x1b44e00, 0xc42ea205c0)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql.(*Session).maybeRecover(0xc424ea7000, 0x1d08e47, 0x9, 0xc42952c813, 0x8)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/session.go:1381 +0x28d
panic(0x1a890a0, 0xc421b1bc70)
        /usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/cockroachdb/cockroach/pkg/sql/mon.(*BytesMonitor).doStop(0xc424ea7140, 0x7fd036234268, 0xc421c76180, 0xc424ea7c01)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/mon/bytes_usage.go:390 +0x27e
github.com/cockroachdb/cockroach/pkg/sql/mon.(*BytesMonitor).Stop(0xc424ea7140, 0x7fd036234268, 0xc421c76180)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/mon/bytes_usage.go:375 +0x44
github.com/cockroachdb/cockroach/pkg/sql.(*txnState).finishSQLTxn(0xc424ea7088, 0xc424ea7000)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/session.go:1151 +0x59
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).execParsed(0xc4209f6000, 0xc424ea7000, 0xc4228a2200, 0x1, 0x1, 0xc4273e51a0, 0x0, 0xb08fc2, 0xed1753699)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:869 +0x857
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).execPrepared(0xc4209f6000, 0xc424ea7000, 0xc423bf7b80, 0xc4273e51a0, 0x9, 0xc42952c813)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:685 +0x145
github.com/cockroachdb/cockroach/pkg/sql.(*Executor).ExecutePreparedStatement(0xc4209f6000, 0xc424ea7000, 0xc423bf7b80, 0xc4273e51a0, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/executor.go:663 +0x13f
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).handleExecute(0xc42063ec00, 0xc42063ec28, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:958 +0x269
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*v3Conn).serve(0xc42063ec00, 0x7fd0362ce180, 0xc4251645a0, 0xc423a1c210, 0x5400, 0xc4200d8168, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/v3.go:526 +0xdd7
github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*Server).ServeConn(0xc4200d8000, 0x7fd036234268, 0xc423a1e200, 0x2ad4d80, 0xc423a18140, 0x0, 0x0)
        /go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/server.go:421 +0x96c
github.com/cockroachdb/cockroach/pkg/server.(*Server).Start.func9.1(0x2ad4d80, 0xc423a18140)
        /go/src/github.com/cockroachdb/cockroach/pkg/server/server.go:748 +0x149
github.com/cockroachdb/cockroach/pkg/util/netutil.(*Server).ServeWith.func1(0xc4207143f0, 0x7fd0362ce180, 0xc420306270, 0xc42072c018, 0x2ad4d80, 0xc423a18140, 0xc42033acf0)
        /go/src/github.com/cockroachdb/cockroach/pkg/util/netutil/net.go:140 +0xa9
created by github.com/cockroachdb/cockroach/pkg/util/netutil.(*Server).ServeWith
        /go/src/github.com/cockroachdb/cockroach/pkg/util/netutil/net.go:142 +0x267

Thanks for the report. Opened https://github.com/cockroachdb/cockroach/issues/19276