Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4452

Valgrind memory leak in bson_append_document

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.22.1
    • Component/s: BSON
    • None

      Summary

      When appending a bson document to a bsoncxx builder

      valgrind reports a memory leak.

      Environment

      driver version: latest monogc latest mongocxx.

      ubuntu 64 bit.

      valgrind output:

      ==2064== 12,288 bytes in 10 blocks are definitely lost in loss record 618 of 620
      ==2064==    at 0x4C2DB4F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==2064==    by 0x99536E: bson_malloc (bson-memory.c:66)
      ==2064==    by 0x985A98: _bson_impl_inline_grow (bson.c:128)
      ==2064==    by 0x985A98: _bson_grow (bson.c:219)
      ==2064==    by 0x986E03: _bson_append_va (bson.c:326)
      ==2064==    by 0x986E03: _bson_append (bson.c:412)
      ==2064==    by 0x9880F3: bson_append_document (bson.c:1147)
      ==2064==    by 0x977353: bsoncxx::v_noabi::builder::core::append(bsoncxx::v_noabi::types::b_document const&) 
      ==2064==    by 0x97A028: bsoncxx::v_noabi::builder::core::append(bsoncxx::v_noabi::document::view)

      How to Reproduce

      1. have a bsoncxx::document::value  with data
      2. append the document from step 1 to a builder

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            tzulea iulian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: