Details
-
Improvement
-
Resolution: Unresolved
-
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.