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
    • Resolution: Fixed
    • Major
    • None
    • 3.2.1
    • 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

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

          Activity

            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