<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:08: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>[CDRIVER-148] Memory leak using write_concern</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-148</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;If you use the mongo_set_write_concern function it internally leaks the response bson of the mongo_check_last_error function. Attched there is some code that reproduces this and a valgrind trace with the leak.&lt;/p&gt;</description>
                <environment>fedora Linux 2.6.35.13-92.fc14.i686.PAE #1 SMP i686 i686 i386 GNU/Linux</environment>
        <key id="40729">CDRIVER-148</key>
            <summary>Memory leak using write_concern</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="gjmurakami">Gary Murakami</assignee>
                                    <reporter username="m4nti5">marcos grillo</reporter>
                        <labels>
                            <label>leak</label>
                            <label>writeconcern</label>
                    </labels>
                <created>Thu, 7 Jun 2012 23:22:14 +0000</created>
                <updated>Mon, 8 May 2017 17:19:22 +0000</updated>
                            <resolved>Fri, 29 Jun 2012 04:30:51 +0000</resolved>
                                    <version>0.6</version>
                                    <fixVersion>0.7</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="137954" author="m4nti5" created="Fri, 29 Jun 2012 15:02:18 +0000"  >&lt;p&gt;Thank you for the fix &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="137805" author="gjmurakami" created="Fri, 29 Jun 2012 04:29:21 +0000"  >&lt;p&gt;Marcos, many thanks for your input. I hope that you like the fixes.&lt;/p&gt;</comment>
                            <comment id="137801" author="auto" created="Fri, 29 Jun 2012 03:57:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-06-28T20:49:16-07:00&apos;, u&apos;email&apos;: u&apos;gary.murakami@10gen.com&apos;, u&apos;name&apos;: u&apos;Gary Murakami&apos;}
&lt;p&gt;Message:  &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-148&quot; title=&quot;Memory leak using write_concern&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-148&quot;&gt;&lt;del&gt;CDRIVER-148&lt;/del&gt;&lt;/a&gt; Memory leak using write_concern&lt;br/&gt;
 fix 3 driver leaks plus double free&lt;br/&gt;
 leaks in  mongo_check_last_error and mongo_run_command were serious&lt;br/&gt;
fix 29 leaks in tests&lt;br/&gt;
recommend documentation with highlighting and emphasis of memory management&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/41f00af411b9f6b77daed03f9a6f54bef751474e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/41f00af411b9f6b77daed03f9a6f54bef751474e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="137757" author="m4nti5" created="Thu, 28 Jun 2012 21:52:50 +0000"  >&lt;p&gt;I&apos;ve added a patch for this, please take a look at it&lt;/p&gt;</comment>
                            <comment id="137733" author="gjmurakami" created="Thu, 28 Jun 2012 20:33:30 +0000"  >&lt;p&gt;As you can guess, this is fairly serious as mongo_check_last_error is used frequently.&lt;/p&gt;</comment>
                            <comment id="137731" author="gjmurakami" created="Thu, 28 Jun 2012 20:31:23 +0000"  >&lt;p&gt;I also ran across this, thanks to valgrind - mongo_check_last_error calls mongo_find_one which allocates memory for the BSON &quot;response&quot;, and bson_destroy is not called on &quot;response&quot;, thus leaking memory.&lt;/p&gt;

&lt;p&gt;We should run valgrind on EVERYTHING!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="17093" name="mongo-leak.c" size="1106" author="m4nti5" created="Thu, 7 Jun 2012 23:22:14 +0000"/>
                            <attachment id="17094" name="mongo-valgrind.txt" size="1460" author="m4nti5" created="Thu, 7 Jun 2012 23:22:14 +0000"/>
                            <attachment id="17650" name="mongo.c.patch" size="526" author="m4nti5" created="Thu, 28 Jun 2012 21:52:27 +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|hrh6fz:</customfieldvalue>

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