Details
Description
stack:
goroutine 204247260 [running]:
github.com/couchbase/query/execution.(*Context).Recover(0xc433c8e420)
goproj/src/github.com/couchbase/query/execution/context.go:505 +0xbc
panic(0xe22d80, 0x1850150)
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/panic.go:489 +0x2cf
github.com/couchbase/query/datastore/couchbase.doFetch(0xc4282bb9c0, 0x14, 0xc48ba35560, 0xed388bf3e, 0xc4087ae0a8)
goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1063 +0x554
github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4211fbea0, 0xc45322a800, 0x1, 0x40, 0xc44935f920, 0x187d1c0, 0xc433c8e420, 0x0, 0x0, 0x0, ...)
goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1037 +0x779
github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc424cee5a0, 0xc433c8e420, 0x100000000aefc00)
goproj/src/github.com/couchbase/query/execution/fetch.go:115 +0x533
github.com/couchbase/query/execution.(*Fetch).afterItems(0xc424cee5a0, 0xc433c8e420)
goproj/src/github.com/couchbase/query/execution/fetch.go:72 +0x35
github.com/couchbase/query/execution.(*base).runConsumer.func1()
goproj/src/github.com/couchbase/query/execution/base.go:551 +0x296
github.com/couchbase/query/util.(*Once).Do(0xc424cee698, 0xc467061738)
goproj/src/github.com/couchbase/query/util/sync.go:51 +0x68
github.com/couchbase/query/execution.(*base).runConsumer(0xc424cee5a0, 0x187aa20, 0xc424cee5a0, 0xc433c8e420, 0x1899780, 0xc421ebfda0)
goproj/src/github.com/couchbase/query/execution/base.go:552 +0xaf
github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc424cee5a0, 0xc433c8e420, 0x1899780, 0xc421ebfda0)
goproj/src/github.com/couchbase/query/execution/fetch.go:56 +0x5c
created by github.com/couchbase/query/execution.(*Sequence).RunOnce.func1
goproj/src/github.com/couchbase/query/execution/sequence.go:95 +0x404
Source Forums:
https://forums.couchbase.com/t/perform-query-panic-runtime-error-slice-bounds-out-of-range/19236
Attachments
Issue Links
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Remote Link | This issue links to "forums (Web Link)" [ 17412 ] |
Summary | Check required header has present during Fetch avoid panic | Discard connection if there is out of bound data avoid panic |
Description |
There are too many panics in doFetch in datastore due to out of bound slice.
When ever data received successful data from KV we expect header, if the error is not properly set we access header unconditionally and causes panics. To protect this check if header length present if not return error. stack: goroutine 204247260 [running]: github.com/couchbase/query/execution.(*Context).Recover(0xc433c8e420) goproj/src/github.com/couchbase/query/execution/context.go:505 +0xbc panic(0xe22d80, 0x1850150) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/panic.go:489 +0x2cf github.com/couchbase/query/datastore/couchbase.doFetch(0xc4282bb9c0, 0x14, 0xc48ba35560, 0xed388bf3e, 0xc4087ae0a8) goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1063 +0x554 github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4211fbea0, 0xc45322a800, 0x1, 0x40, 0xc44935f920, 0x187d1c0, 0xc433c8e420, 0x0, 0x0, 0x0, ...) goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1037 +0x779 github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc424cee5a0, 0xc433c8e420, 0x100000000aefc00) goproj/src/github.com/couchbase/query/execution/fetch.go:115 +0x533 github.com/couchbase/query/execution.(*Fetch).afterItems(0xc424cee5a0, 0xc433c8e420) goproj/src/github.com/couchbase/query/execution/fetch.go:72 +0x35 github.com/couchbase/query/execution.(*base).runConsumer.func1() goproj/src/github.com/couchbase/query/execution/base.go:551 +0x296 github.com/couchbase/query/util.(*Once).Do(0xc424cee698, 0xc467061738) goproj/src/github.com/couchbase/query/util/sync.go:51 +0x68 github.com/couchbase/query/execution.(*base).runConsumer(0xc424cee5a0, 0x187aa20, 0xc424cee5a0, 0xc433c8e420, 0x1899780, 0xc421ebfda0) goproj/src/github.com/couchbase/query/execution/base.go:552 +0xaf github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc424cee5a0, 0xc433c8e420, 0x1899780, 0xc421ebfda0) goproj/src/github.com/couchbase/query/execution/fetch.go:56 +0x5c created by github.com/couchbase/query/execution.(*Sequence).RunOnce.func1 goproj/src/github.com/couchbase/query/execution/sequence.go:95 +0x404 Source Forums: https://forums.couchbase.com/t/perform-query-panic-runtime-error-slice-bounds-out-of-range/19236 |
stack: goroutine 204247260 [running]: github.com/couchbase/query/execution.(*Context).Recover(0xc433c8e420) goproj/src/github.com/couchbase/query/execution/context.go:505 +0xbc panic(0xe22d80, 0x1850150) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/panic.go:489 +0x2cf github.com/couchbase/query/datastore/couchbase.doFetch(0xc4282bb9c0, 0x14, 0xc48ba35560, 0xed388bf3e, 0xc4087ae0a8) goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1063 +0x554 github.com/couchbase/query/datastore/couchbase.(*keyspace).Fetch(0xc4211fbea0, 0xc45322a800, 0x1, 0x40, 0xc44935f920, 0x187d1c0, 0xc433c8e420, 0x0, 0x0, 0x0, ...) goproj/src/github.com/couchbase/query/datastore/couchbase/couchbase.go:1037 +0x779 github.com/couchbase/query/execution.(*Fetch).flushBatch(0xc424cee5a0, 0xc433c8e420, 0x100000000aefc00) goproj/src/github.com/couchbase/query/execution/fetch.go:115 +0x533 github.com/couchbase/query/execution.(*Fetch).afterItems(0xc424cee5a0, 0xc433c8e420) goproj/src/github.com/couchbase/query/execution/fetch.go:72 +0x35 github.com/couchbase/query/execution.(*base).runConsumer.func1() goproj/src/github.com/couchbase/query/execution/base.go:551 +0x296 github.com/couchbase/query/util.(*Once).Do(0xc424cee698, 0xc467061738) goproj/src/github.com/couchbase/query/util/sync.go:51 +0x68 github.com/couchbase/query/execution.(*base).runConsumer(0xc424cee5a0, 0x187aa20, 0xc424cee5a0, 0xc433c8e420, 0x1899780, 0xc421ebfda0) goproj/src/github.com/couchbase/query/execution/base.go:552 +0xaf github.com/couchbase/query/execution.(*Fetch).RunOnce(0xc424cee5a0, 0xc433c8e420, 0x1899780, 0xc421ebfda0) goproj/src/github.com/couchbase/query/execution/fetch.go:56 +0x5c created by github.com/couchbase/query/execution.(*Sequence).RunOnce.func1 goproj/src/github.com/couchbase/query/execution/sequence.go:95 +0x404 Source Forums: https://forums.couchbase.com/t/perform-query-panic-runtime-error-slice-bounds-out-of-range/19236 |
Fix Version/s | 5.5.3 [ 15520 ] | |
Fix Version/s | 6.0.1 [ 15522 ] |
Link | This issue blocks MB-31456 [ MB-31456 ] |
Link | This issue blocks MB-31466 [ MB-31466 ] |
Assignee | Keshav Murthy [ keshav ] | Mihir Kamdar [ mihir.kamdar ] |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Actual End | 2018-11-26 17:04 (issue has been resolved) |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Build couchbase-server-6.5.0-1708 contains go-couchbase commit 3e9b6e1 with commit message:
MB-32118. Discard connection for Out Of Bound data, NOT_SUPPORTED