Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-32118

Discard connection if there is out of bound data avoid panic

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.5.0, 6.0.0
    • 6.5.0, 5.5.3, 6.0.1
    • query
    • None
    • Untriaged
    • Unknown

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            Sitaram.Vemulapalli Sitaram Vemulapalli created issue -
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Field Original Value New Value
            Remote Link This issue links to "forums (Web Link)" [ 17412 ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Summary Check required header has present during Fetch avoid panic Discard connection if there is out of bound data avoid panic
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            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
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Fix Version/s 5.5.3 [ 15520 ]
            Fix Version/s 6.0.1 [ 15522 ]
            wayne Wayne Siu made changes -
            Link This issue blocks MB-31456 [ MB-31456 ]
            wayne Wayne Siu made changes -
            Link This issue blocks MB-31466 [ MB-31466 ]
            Sitaram.Vemulapalli Sitaram Vemulapalli made changes -
            Assignee Keshav Murthy [ keshav ] Mihir Kamdar [ mihir.kamdar ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            Sitaram.Vemulapalli Sitaram.Vemulapalli made changes -
            Actual End 2018-11-26 17:04 (issue has been resolved)
            mihir.kamdar Mihir Kamdar (Inactive) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              mihir.kamdar Mihir Kamdar (Inactive)
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty