<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:10:53 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>[CDRIVER-880] mongoc_collection_aggregate might return a destroyed cursor</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-880</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;&lt;tt&gt;mongoc_collection_aggregate&lt;/tt&gt; has a check for cursor validity, and if it fails, calls &lt;tt&gt;mongoc_cursor_destroy&lt;/tt&gt; (around line 300 in &lt;tt&gt;mongoc-collection.c&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;This code can be reached in situations when the mongodb server misbehaves, returns an invalid cursor, has a memory issue, or just crashes.&lt;/p&gt;

&lt;p&gt;The destroyed cursor is then returned to the caller, which usually quickly identifies it is invalid, and calls &lt;tt&gt;mongoc_cursor_destroy&lt;/tt&gt;, which leads to a double-free crash.&lt;/p&gt;

&lt;p&gt;The example code given in &lt;a href=&quot;http://api.mongodb.org/c/current/aggregate.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/c/current/aggregate.html&lt;/a&gt; will crash if this occurs. &lt;/p&gt;

&lt;p&gt;It looks like this was working before by creating a dummy cursor, but this code was removed in commit 346349d8d1e721e782d (as part of &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-735&quot; title=&quot;Aggregations executed twice on MongoDB &amp;lt; 2.6&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-735&quot;&gt;&lt;del&gt;CDRIVER-735&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;</description>
                <environment></environment>
        <key id="231407">CDRIVER-880</key>
            <summary>mongoc_collection_aggregate might return a destroyed cursor</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="kyle.suarez@mongodb.com">Kyle Suarez</assignee>
                                    <reporter username="yhager">Yuval Hager</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Sep 2015 19:01:35 +0000</created>
                <updated>Wed, 19 Oct 2016 14:15:15 +0000</updated>
                            <resolved>Thu, 1 Oct 2015 16:29:40 +0000</resolved>
                                    <version>1.2-beta1</version>
                                    <fixVersion>1.2-rc0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="1050598" author="yhager" created="Sun, 4 Oct 2015 00:20:01 +0000"  >&lt;p&gt;Awesome! Thanks guys!&lt;/p&gt;</comment>
                            <comment id="1049287" author="kyle.suarez" created="Thu, 1 Oct 2015 22:10:12 +0000"  >&lt;p&gt;Thanks again &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=yhager&quot; class=&quot;user-hover&quot; rel=&quot;yhager&quot;&gt;yhager&lt;/a&gt; for catching this! The fix has been released in 1.2.0-rc0:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/releases/tag/1.2.0-rc0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/releases/tag/1.2.0-rc0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1048820" author="xgen-internal-githook" created="Thu, 1 Oct 2015 16:24:56 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;bjori&apos;, u&apos;name&apos;: u&apos;Hannes Magnusson&apos;, u&apos;email&apos;: u&apos;bjori@10gen.com&apos;}
&lt;p&gt;Message: Merge pull request #278 from ksuarz/&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt;: aggregation may return destroyed cursor&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/bef2b38ec5ea181b17b0f393b6e60e8138ad4e47&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/bef2b38ec5ea181b17b0f393b6e60e8138ad4e47&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1048819" author="xgen-internal-githook" created="Thu, 1 Oct 2015 16:24:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;bjori&apos;, u&apos;name&apos;: u&apos;Hannes Magnusson&apos;, u&apos;email&apos;: u&apos;bjori@10gen.com&apos;}
&lt;p&gt;Message: Merge pull request #278 from ksuarz/&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt;: aggregation may return destroyed cursor&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/bef2b38ec5ea181b17b0f393b6e60e8138ad4e47&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/bef2b38ec5ea181b17b0f393b6e60e8138ad4e47&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1048818" author="xgen-internal-githook" created="Thu, 1 Oct 2015 16:24:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ksuarz&apos;, u&apos;name&apos;: u&apos;Kyle Suarez&apos;, u&apos;email&apos;: u&apos;ksuarz@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt; must still call cursorid_prime()&lt;/p&gt;

&lt;p&gt;We require the side effects of the function but ignore its return value.&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e6349245282a78e3c2b0dbd15e14b15e033c691f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e6349245282a78e3c2b0dbd15e14b15e033c691f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1048817" author="xgen-internal-githook" created="Thu, 1 Oct 2015 16:24:53 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ksuarz&apos;, u&apos;name&apos;: u&apos;Kyle Suarez&apos;, u&apos;email&apos;: u&apos;ksuarz@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt; add test for failed agg pipeline&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/558906fb7e79a72b6662913814d715b2b865790c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/558906fb7e79a72b6662913814d715b2b865790c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1048816" author="xgen-internal-githook" created="Thu, 1 Oct 2015 16:24:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ksuarz&apos;, u&apos;name&apos;: u&apos;Kyle Suarez&apos;, u&apos;email&apos;: u&apos;ksuarz@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt; style fix&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/14c9bdf1b92807d121a1ba1d35c90a93492be0d8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/14c9bdf1b92807d121a1ba1d35c90a93492be0d8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1048815" author="xgen-internal-githook" created="Thu, 1 Oct 2015 16:24:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ksuarz&apos;, u&apos;name&apos;: u&apos;Kyle Suarez&apos;, u&apos;email&apos;: u&apos;ksuarz@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-880&quot; title=&quot;mongoc_collection_aggregate might return a destroyed cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-880&quot;&gt;&lt;del&gt;CDRIVER-880&lt;/del&gt;&lt;/a&gt; do not destroy cursor before failing&lt;br/&gt;
Branch: 1.2.0-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/93a9456586ba684bda58218439a8f2c56635b461&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/93a9456586ba684bda58218439a8f2c56635b461&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1042568" author="jesse" created="Thu, 24 Sep 2015 19:56:09 +0000"  >&lt;p&gt;Thanks for the report! Seems easy to reproduce given the mock_server_t I&apos;ve added to the test framework and your detailed explanation. We&apos;ll plan to fix this before the 1.2.0 release candidate next week.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="233812">CDRIVER-926</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|hsdbhr:</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>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="741">C Driver 2015Q2 sprint 8</customfieldvalue>

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