<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:58:52 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CXX-324] Static initialization of mongo::DBClientConnection</title>
                <link>https://jira.mongodb.org/browse/CXX-324</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Hello.&lt;br/&gt;
I&apos;m using static instance of a class like this one:&lt;br/&gt;
class Storage {&lt;br/&gt;
private:&lt;br/&gt;
     mongo::DBClientConnection _db;&lt;br/&gt;
};&lt;/p&gt;

&lt;p&gt;At the beginning of my program execution I got an Segmentation fault exception in std::string::assign,  raised from here:&lt;br/&gt;
        _writeConcern = WriteConcern::acknowledged;  (dbclient.cpp:1460).&lt;/p&gt;

&lt;p&gt;As the order of initialization of global and static variables are undefined I imply that static instance of &lt;br/&gt;
        static const WriteConcern acknowledged;&lt;br/&gt;
hadn&apos;t been initialized at this moment.&lt;br/&gt;
I&apos;ve changed this line to&lt;br/&gt;
       _writeConcern = WriteConcern();&lt;br/&gt;
and it solved the problem for me.&lt;/p&gt;

&lt;p&gt;Compiler: g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1, --c++11=on&lt;/p&gt;
</description>
                <environment></environment>
        <key id="155774">CXX-324</key>
            <summary>Static initialization of mongo::DBClientConnection</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="tyler@10gen.com">Tyler Brock</assignee>
                                    <reporter username="arwer">Artyom</reporter>
                        <labels>
                            <label>crash</label>
                            <label>driver</label>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Mon, 1 Sep 2014 13:30:20 +0000</created>
                <updated>Thu, 23 Oct 2014 18:31:24 +0000</updated>
                            <resolved>Tue, 9 Sep 2014 18:24:56 +0000</resolved>
                                    <version>legacy-1.0.0-rc0</version>
                                    <fixVersion>legacy-1.0.0-rc1</fixVersion>
                                    <component>Testing</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="714865" author="xgen-internal-githook" created="Tue, 9 Sep 2014 18:24:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;TylerBrock&apos;, u&apos;name&apos;: u&apos;Tyler Brock&apos;, u&apos;email&apos;: u&apos;tyler.brock@gmail.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/CXX-324&quot; title=&quot;Static initialization of mongo::DBClientConnection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-324&quot;&gt;&lt;del&gt;CXX-324&lt;/del&gt;&lt;/a&gt; do not depend on static init for WriteConcern&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit aadc8d081511d96e05cf8e819203d0593b276c4f.&lt;br/&gt;
Branch: legacy&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/e55e0f2a1e6ad30033e876a5f236be4697a64339&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/e55e0f2a1e6ad30033e876a5f236be4697a64339&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="714864" author="xgen-internal-githook" created="Tue, 9 Sep 2014 18:24:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;TylerBrock&apos;, u&apos;name&apos;: u&apos;Tyler Brock&apos;, u&apos;email&apos;: u&apos;tyler.brock@gmail.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/CXX-324&quot; title=&quot;Static initialization of mongo::DBClientConnection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-324&quot;&gt;&lt;del&gt;CXX-324&lt;/del&gt;&lt;/a&gt; fix additional tests&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 211b1f49f7ec9adaf1419d075b05d9d0404e12f0.&lt;br/&gt;
Branch: legacy&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/a2d18f25dbb2f0fbdd3e0e04cbca6da7a8696d7f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/a2d18f25dbb2f0fbdd3e0e04cbca6da7a8696d7f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="714862" author="tyler@10gen.com" created="Tue, 9 Sep 2014 18:22:24 +0000"  >&lt;p&gt;Hey Artyom, unfortunately we had to re-think this one and revert it. The C++ driver cannot be used before mongo::client::initialize() has been invoked so users of the driver cannot and should not have static objects that use the driver in any way before entering main (presumably where initialize is called).&lt;/p&gt;</comment>
                            <comment id="710843" author="xgen-internal-githook" created="Wed, 3 Sep 2014 18:23:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;TylerBrock&apos;, u&apos;name&apos;: u&apos;Tyler Brock&apos;, u&apos;email&apos;: u&apos;tyler.brock@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-324&quot; title=&quot;Static initialization of mongo::DBClientConnection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-324&quot;&gt;&lt;del&gt;CXX-324&lt;/del&gt;&lt;/a&gt; fix additional tests&lt;br/&gt;
Branch: legacy&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/211b1f49f7ec9adaf1419d075b05d9d0404e12f0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/211b1f49f7ec9adaf1419d075b05d9d0404e12f0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="710842" author="xgen-internal-githook" created="Wed, 3 Sep 2014 18:23:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;TylerBrock&apos;, u&apos;name&apos;: u&apos;Tyler Brock&apos;, u&apos;email&apos;: u&apos;tyler.brock@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-324&quot; title=&quot;Static initialization of mongo::DBClientConnection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-324&quot;&gt;&lt;del&gt;CXX-324&lt;/del&gt;&lt;/a&gt; do not depend on static init for WriteConcern&lt;br/&gt;
Branch: legacy&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/aadc8d081511d96e05cf8e819203d0593b276c4f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/aadc8d081511d96e05cf8e819203d0593b276c4f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="710598" author="tyler@10gen.com" created="Wed, 3 Sep 2014 15:48:53 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/pull/146&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/pull/146&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="708719" author="tyler@10gen.com" created="Mon, 1 Sep 2014 23:27:38 +0000"  >&lt;p&gt;Hey Artyom, thanks for filing the ticket. I am going to take a look tomorrow but it sounds like you are correct and that this should be fixed.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs1ugn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>135407</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>