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

Add checks for use without init or after cleanup

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None

    Description

      Calling mongoc_cleanup invalidates global state. We've had bug reports caused by applications calling mongoc_cleanup early (e.g. CDRIVER-3674).

      Though it may not be possible to reliably check if the global initialization state is valid, checks may still add safety. Namely, we can try to guard against:

      1. Calling libmongoc functions after mongoc_cleanup
      2. Calling libmongoc functions before mongoc_init

      In either of those cases, aborting seems safer than the current undefined behavior.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: