<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:50 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>[SERVER-1372] NULL check for auto_ptr&lt;DBClientConnection&gt; is missing</title>
                <link>https://jira.mongodb.org/browse/SERVER-1372</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When I&apos;m testing ReplicaPair for automatic failover, my C++ client program got SEGV. &lt;/p&gt;

&lt;p&gt;I setup two mongodb instances, and killed + restarted two servers randomly.&lt;/p&gt;

&lt;p&gt;I used PairedDbConnection, and call GridFS::removeFIle().&lt;/p&gt;

&lt;p&gt;By the stacktrace, found that client.query() returns null auto_ptr if server is dead. But GridFS code doesn&apos;t check this situation.&lt;/p&gt;

&lt;p&gt;  void GridFS::removeFile( const string&amp;amp; fileName ){&lt;br/&gt;
    auto_ptr&amp;lt;DBClientCursor&amp;gt; files = _client.query( _filesNS , BSON( &quot;filename&quot; &amp;lt;&amp;lt; fileName ) );&lt;br/&gt;
    while (files-&amp;gt;more())&lt;/p&gt;
{
      ...
    }
&lt;p&gt;  }&lt;/p&gt;

&lt;p&gt;I changed the code as follows, and confirmed that the problem was fixed.&lt;/p&gt;

&lt;p&gt;    while (files.get() &amp;amp;&amp;amp; files-&amp;gt;more()) &lt;/p&gt;
{
      ....
    }

&lt;p&gt;The attached patch added the null check for DBClientCursor in the client code. There are some places which have the same problem.&lt;/p&gt;

&lt;p&gt;The server program has the same problem in many places, but this patch is only for the client.&lt;/p&gt;

&lt;p&gt;Could you commit this patch, and please fix the server-side also? I&apos;m really happy if this problem is backported to the stable version.&lt;/p&gt;

&lt;p&gt;Thanks in advance&lt;br/&gt;
Kazuki&lt;/p&gt;</description>
                <environment>Linux</environment>
        <key id="12370">SERVER-1372</key>
            <summary>NULL check for auto_ptr&lt;DBClientConnection&gt; is missing</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="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="kzk_mover">Kazuki Ohta</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Jul 2010 06:24:32 +0000</created>
                <updated>Tue, 12 Jul 2016 00:28:23 +0000</updated>
                            <resolved>Thu, 15 Jul 2010 14:19:15 +0000</resolved>
                                                    <fixVersion>1.5.5</fixVersion>
                                    <component>Internal Client</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="15838" author="redbeard0531" created="Thu, 15 Jul 2010 14:19:15 +0000"  >&lt;p&gt;conn-&amp;gt;more() will now assert if conn is NULL. Same for conn-&amp;gt;hasResultFlag()&lt;/p&gt;</comment>
                            <comment id="15837" author="auto" created="Thu, 15 Jul 2010 14:17:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;RedBeard0531&apos;, &apos;name&apos;: &apos;Mathias Stearn&apos;, &apos;email&apos;: &apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: Assert if DBClientCursor is NULL &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1372&quot; title=&quot;NULL check for auto_ptr&amp;lt;DBClientConnection&amp;gt; is missing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1372&quot;&gt;&lt;del&gt;SERVER-1372&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/c5d33d557eeec1f9b1c48564e2a455cb7b227358&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/c5d33d557eeec1f9b1c48564e2a455cb7b227358&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15516" author="kzk_mover" created="Wed, 7 Jul 2010 12:17:10 +0000"  >&lt;p&gt;previous patch wrongly includes the server-side codes.&lt;/p&gt;</comment>
                            <comment id="15504" author="kzk_mover" created="Wed, 7 Jul 2010 11:22:09 +0000"  >&lt;p&gt;Or returning empty DBClientCursor will be an another good solution. This doesn&apos;t need any modification outside DBClientCursor.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10282" name="mongodb-client-dbclientcursor-null-check-2.patch" size="2904" author="kzk_mover" created="Wed, 7 Jul 2010 12:17:10 +0000"/>
                            <attachment id="10279" name="mongodb-client-dbclientcursor-null-check.patch" size="4352" author="kzk_mover" created="Wed, 7 Jul 2010 06:24:53 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 15 Jul 2010 14:17:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 31 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 31 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>kzk_mover</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpk1r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hril1b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22060</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht0bjj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>