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

Pointer being freed not allocated in mongoc_cursor_destroy

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 1.17.3
    • libmongoc
    • None
    • Tried on MacOs Catalina.

    Description

      I'm upgrading the Mongoc version used in the Mongo Rust driver: https://github.com/thijsc/mongo-rust-driver/pull/59.

      It seems something changed. When running the cleanup logic in the correct order, as enforced by Rusts ownership system there is now a double free:

       collection-4a23c99cd16c3bd9(28304,0x700001eb0000) malloc: *** error for object 0x7fc6ca40d3e0: pointer being freed was not allocated
      collection-4a23c99cd16c3bd9(28304,0x700001eb0000) malloc: *** set a breakpoint in malloc_error_break to debug
      

      This code worked correctly in earlier C driver versions. I don't see any notice about a change in the docs. Is this a bug?

      Attachments

        Activity

          People

            clyde.bazile@mongodb.com Clyde Bazile III (Inactive)
            thijs@appsignal.com Thijs Cadier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: