Add checks for use without init or after cleanup

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: