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

[BP 58918 to 7.1.7] Panic (SEGV or array index out of bounds) under Order.afterItems or Order.processItem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.7
    • 7.1.4, 7.1.5
    • query
    • Untriaged
    • 0
    • Unknown

    Description

      The problem is the deferred releaseValues() call in RunOnce().  When runConsumer() returns the operator is available for reuse and the go-routine may be suspended before the rest (i.e. the deferred releaseValues() call) gets to run (function boundary).  This leads to cases where the next user of the operator has started using it when the first execution's deferred releaseValues() call gets to execute, corrupting the second legitimate execution.

      The problem has been lying in wait since 2015 and MB-15569's code. (Doesn't affect 7.6+ as much since Order changed to use the spillable container.)

      (The particular statement that revealed the problem did so because the subsequent executions were quick - the source for the sub-queries being just a document field so they're quickly in their sorting when the values are incorrectly released under them.)

      afterItems() is the correct place to - and indeed does - clean up values; the active execution "owns" the operator for the entirety of its duration.  But this is only for normal execution.  Error conditions (and serialised sending) need clean-up too.  Whilst just removing the redundant calls does address the problem for this case there should be the ability to specify specific clean-up to take place before "ownership" is relinquished.

      Attachments

        Issue Links

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

          Activity

            People

              Donald.haggart Donald Haggart
              Donald.haggart Donald Haggart
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty