Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-936

Segfault in lcbtrace_destroy when closing cluster using custom tracer

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.1
    • None
    • library
    • None
    • 1

    Description

      When supplying a custom tracer the lcbtrace destructor is not initialized here. This leads to an uninitialized read when lcbtrace_destroy is called on cluster close.

      const couchbase = require("../couchnode");
       
      class TestTracer {
        constructor() {
        }
       
        requestSpan(name, parent) {
          return new TestSpan();
        }
      }
       
      class TestSpan {
        constructor(name, parent) {
        }
       
        addTag(key, value) {
        }
       
        end() {
        }
      }
       
      async function main() {
        const cluster = await couchbase.connect("couchbase://localhost", {
          username: "Administrator",
          password: "password",
          tracer: new TestTracer(),
        });
        console.log("connected")
        await cluster.close()
      }
       
      main();
      
      

      node index.js
      connected
      zsh: segmentation fault node index.js

      Attachments

        Issue Links

          For Gerrit Dashboard: JSCBC-936
          # Subject Branch Project Status CR V

          Activity

            jake.rawsthorne#1 Jake Rawsthorne [X] (Inactive) created issue -
            brett19 Brett Lawson made changes -
            Field Original Value New Value
            Link This issue relates to CCBC-1479 [ CCBC-1479 ]
            brett19 Brett Lawson made changes -
            Status New [ 10003 ] Open [ 1 ]
            brett19 Brett Lawson made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]

            People

              brett19 Brett Lawson
              jake.rawsthorne#1 Jake Rawsthorne [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty