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

Panic runtime error with correlated subquery (not consistent)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.0.2, 7.1.0
    • 7.0.2, 7.1.0
    • query
    • 7.0.2-6643
    • Untriaged
    • 1
    • Unknown

    Description

      the query might not repro for 100 runs, i need to do at least 1000.

      To repro

      • create default bucket
      • uncompress lines.json.gzand import into default bucket
      • create primary index: CREATE PRIMARY INDEX `#primary` ON `default`
      • run query in a loop: SELECT meta().id, (SELECT RAW SUM(VMs.memory) FROM d.VMs AS VMs)[0] AS total FROM default d order by total

      I could repro by running at least a 1000 times.

      for n in $(seq 1000); do /opt/couchbase/bin/cbq -u Administrator -p password -script "SELECT meta().id, (SELECT RAW SUM(VMs.memory) FROM d.VMs AS VMs)[0] AS total FROM default d order by total" > /dev/null; done 

      From query.log:

      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=panic: runtime error: invalid memory address or nil pointer dereference
      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=request text: <ud>SELECT meta().id, (SELECT RAW SUM(VMs.memory) FROM d.VMs AS VMs)[0] AS total FROM default d order by total;</ud>
      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=query context: <ud></ud>
      _time=2021-09-08T21:18:44.579+00:00 _level=SEVERE _msg=stack: goroutine 13151877 [running]:
      github.com/couchbase/query/execution.(*Context).Recover(0xc00080ca00, 0xc00080cc80)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:934 +0xbb
      panic(0x2226a40, 0x38f8800)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/execution.(*base).close(0xc00080cc80, 0xc00080ca00)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:273 +0x22a
      panic(0x2226a40, 0x38f8800)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/execution.(*base).notify(0xc00080cc80)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:988 +0x179
      panic(0x2226a40, 0x38f8800)
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2
      github.com/couchbase/query/value.(*annotatedValue).WriteJSON(0xc004213050, 0x27b2e80, 0xc00092ee70, 0x2513032, 0x4, 0x2513032, 0x4, 0xc003f52f00, 0xc0012ddaa8, 0x11aab2e)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/value/annotated.go:136 +0x2d
      github.com/couchbase/query/server/http.(*httpRequest).Result(0xc0009f0000, 0x2859020, 0xc004213050, 0xc0009f0000)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/server/http/service_response.go:264 +0x214
      github.com/couchbase/query/execution.result(0xc00080ca00, 0x2859020, 0xc004213050, 0xbebc4f607f54)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:556 +0x51
      github.com/couchbase/query/execution.(*Context).Result(...)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:560
      github.com/couchbase/query/execution.(*Stream).processItem(0xc000a44900, 0x2859020, 0xc004213050, 0xc00080ca00, 0xc0012ddc01)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/stream.go:70 +0x4a
      github.com/couchbase/query/execution.serializedSend(0xc00080cc80, 0x2836800, 0xc000a44900, 0x2859020, 0xc004213050, 0x1)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:936 +0x137
      github.com/couchbase/query/execution.(*base).sendItemOp(0xc00080cc80, 0x2836800, 0xc000a44900, 0x2859020, 0xc004213050, 0x1cb5b01)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/base.go:701 +0x67 

      See attached query.log

      Not clear if this is a regression.

      Attachments

        1. lines.json.gz
          452 kB
        2. query.log
          407 kB
        For Gerrit Dashboard: MB-48376
        # Subject Branch Project Status CR V

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            pierre.regazzoni Pierre Regazzoni
            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