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

Pointer being freed not allocated in mongoc_cursor_destroy

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.17.3
    • Component/s: libmongoc
    • None
    • Environment:
      Tried on MacOs Catalina.

      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?

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

              Created:
              Updated:
              Resolved: