<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:59:36 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-570] Auth() function cause core dump in shared library - fcgi environment</title>
                <link>https://jira.mongodb.org/browse/CXX-570</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Here&apos;s my case:&lt;br/&gt;
I upgrade mongo server to 2.6 from 2.4, after that I upgrade user authorization data to 2.6 too.&lt;br/&gt;
Then I build c++ legacy-1.0.0 driver on my system which has 2 RHEL6 machine (a 2 nodes replicaset).&lt;br/&gt;
I write a c++ function to connect, authenticate, query again a collection.&lt;br/&gt;
The function works well when I run it as standalone c++ application. Then I build a shared library and call this function from fcgi application (using dlopen), my fcgi dump at driver&apos;s auth api.&lt;br/&gt;
I attach the function below.&lt;br/&gt;
I can&apos;t debug or explain that, just don&apos;t know how it happened, please help me.&lt;br/&gt;
Thank in advance!&lt;/p&gt;</description>
                <environment>RHEL6 x64</environment>
        <key id="192482">CXX-570</key>
            <summary>Auth() function cause core dump in shared library - fcgi environment</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="franky">Fanky</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Fri, 27 Mar 2015 15:52:19 +0000</created>
                <updated>Wed, 11 Sep 2019 19:05:06 +0000</updated>
                            <resolved>Tue, 31 Mar 2015 00:53:14 +0000</resolved>
                                    <version>legacy-1.0.0</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="867391" author="franky" created="Mon, 30 Mar 2015 11:57:23 +0000"  >&lt;p&gt;Hi Andrew,&lt;/p&gt;

&lt;p&gt;I&apos;ve moved the GlobalInstance to main() section and it is ok now.&lt;/p&gt;

&lt;p&gt;Thanks for your support!&lt;/p&gt;</comment>
                            <comment id="867146" author="acm" created="Sun, 29 Mar 2015 21:54:20 +0000"  >&lt;p&gt;Hi - &lt;/p&gt;

&lt;p&gt;Thank you for the bug report.&lt;/p&gt;

&lt;p&gt;The example you provided cannot be compiled as-is. If possible, could you provide a complete, compilable example program that demonstrates the crash?&lt;/p&gt;

&lt;p&gt;If that is not possible, then providing a stack trace would also be helpful. You should be able to obtain a stack trace from the corefile by loading your application and the corefile in GDB and invoking &apos;thread apply all bt&apos;.&lt;/p&gt;

&lt;p&gt;However, based on the code you provided, I have a few immediate observations:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;You are not checking that initialization succeeded. In particular, you are required to invoke one of the &apos;status&apos;, &apos;initialized&apos;, or &apos;assertInitialized&apos; methods on GlobalInstance after constructing one to ensure that the driver was correctly initialized.&lt;/li&gt;
	&lt;li&gt;There is a self contradiction in your code: The &apos;Insert&apos; function takes a BSONObj object by value. However, you are required to have initialized the driver before constructing an BSONObj objects. But then the &apos;Insert&apos; function appears to be trying to initialize the driver. So, at best, this subsequent attempt to initialize the driver is redundant, or, at worst, it indicates that initialization of the driver is being done too late.&lt;/li&gt;
	&lt;li&gt;Finally, note that your application will only ever support one call to &apos;Insert&apos;. Subsequent calls to &apos;Insert&apos; will not work correctly, because the driver will be destroyed when the GlobalInstance goes out of scope.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;My suggestion is that you try moving the GlobalInstance variable to some common startup section of your FastCGI program.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="68937" name="example" size="1135" author="franky" created="Fri, 27 Mar 2015 15:52:19 +0000"/>
                    </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|hs7juf:</customfieldvalue>

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