[CDRIVER-1160] configure flag for MONGOC_NO_AUTOMATIC_GLOBALS Created: 15/Mar/16  Updated: 27/May/16  Resolved: 21/Mar/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.4.0
Fix Version/s: 1.3.5

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-657 Support MONGOC_NO_AUTOMATIC GLOBALS c... Closed
Related
related to CDRIVER-1165 _mongoc_init_dtor() should restore it... Closed
is related to CDRIVER-592 Deprecate mongoc_init_ctor/dtor Closed
is related to CDRIVER-1233 Crash after Kerberos plugin cleanup r... Closed
is related to PHPC-632 FPM segfaults during shutdown Closed

 Description   

mongoc uses nondeterministic constructors and destructors to automatically init and cleanup mongoc.

This is contrast to our documented requirement of needing explicit mongoc_init () and mongoc_cleanup ().
It is also compiler specific, along with being platforms specific.
It also creates absurd situations when the memory allocator is overloaded.

A flag was added for this, which defaults to false – but we have no way of configuring this behavior to turn it off, other then explicit via cflags.

We should add --enable-automatic-globals=[default yes]. Or maybe even default to false since this has been undocumented behavior all along?



 Comments   
Comment by Githook User [ 21/Mar/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1160: configure flag for MONGOC_NO_AUTOMATIC_GLOBALS
Branch: r1.3
https://github.com/mongodb/mongo-c-driver/commit/3c2a0efa57cc3f06715a5f26883f2154ce2612c2

Comment by Githook User [ 21/Mar/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1160: configure flag for MONGOC_NO_AUTOMATIC_GLOBALS
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/4c7633683b95c212637bb32d431becc358bcf036

Comment by A. Jesse Jiryu Davis [ 17/Mar/16 ]

Let's update the Debian package to compile the driver with auto-initialization turned off.

Generated at Wed Feb 07 21:11:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.