<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:42:15 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-57586] Enforce termination on all allocation failure paths</title>
                <link>https://jira.mongodb.org/browse/SERVER-57586</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We currently implement wrappers around &lt;tt&gt;malloc&lt;/tt&gt; and &lt;tt&gt;realloc&lt;/tt&gt; (called &lt;tt&gt;mongoMalloc&lt;/tt&gt; and &lt;tt&gt;mongoRealloc&lt;/tt&gt;, respectively), which terminate the process on allocation failure. Similarly, we set a &lt;tt&gt;new_handler&lt;/tt&gt; to accomplish the same tasks for the C++ memory interface.&lt;/p&gt;

&lt;p&gt;Unfortunately, we don&apos;t currently have something in place to make allocation failure in generic third_party code hard fail on allocation failure. If, say, s2 made a call to &lt;tt&gt;malloc&lt;/tt&gt; and failed to properly handle the &lt;tt&gt;NULL&lt;/tt&gt; return case, we are likely to see a crash at best or tricky memory corruption at worst.&lt;/p&gt;

&lt;p&gt;Our vendored &lt;tt&gt;tcmalloc&lt;/tt&gt; offers a facility called &lt;tt&gt;tc_new_mode&lt;/tt&gt;, which changes the semantics of the C allocation routines so that they call &lt;tt&gt;new_handler&lt;/tt&gt; instead of returning &lt;tt&gt;NULL&lt;/tt&gt;. For a case like ours where &lt;tt&gt;new_handler&lt;/tt&gt; is known to terminate, this would work well.&lt;/p&gt;

&lt;p&gt;But this isn&apos;t a perfect solution: on some platforms we build with &lt;tt&gt;&amp;#45;&amp;#45;allocator=system&lt;/tt&gt;. For those platforms, we can&apos;t rely on &lt;tt&gt;tc_new_mode&lt;/tt&gt;. For windows, we could investigate using the windows analogue of &lt;tt&gt;tc_new_mode&lt;/tt&gt;, which is called &lt;tt&gt;_set_new_mode&lt;/tt&gt;. For the cases where Windows directly calls into tcmalloc, we could continue to use &lt;tt&gt;tc_set_new_mode&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;That still leaves macOS (where we build with &lt;tt&gt;&amp;#45;&amp;#45;allocator=system&lt;/tt&gt;, and the issue still exists for anyone doing community builds with &lt;tt&gt;&amp;#45;&amp;#45;allocator=system&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;The best choice is probably for us to stop relying on tcmalloc&apos;s C and C++ allocation interface interceptors, and to write our own. We would inject them using the same techniques that tcmalloc itself uses (linker magic, etc.). Then we would backstop them with either plan calls to the basic C library routines, or we would call into the appropriate &lt;tt&gt;tc_&lt;/tt&gt; routines if we were using tcmalloc.&lt;/p&gt;

&lt;p&gt;We could then remove the definitions of &lt;tt&gt;mongoMalloc&lt;/tt&gt; and &lt;tt&gt;mongoRealloc&lt;/tt&gt;, since we would obtain equivalent behavior via our injected implementations.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1774643">SERVER-57586</key>
            <summary>Enforce termination on all allocation failure paths</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="backlog-server-devplatform">[DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP)</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2021 18:10:05 +0000</created>
                <updated>Fri, 27 Oct 2023 17:21:14 +0000</updated>
                            <resolved>Fri, 27 Oct 2023 17:21:14 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1754675">SERVER-57166</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1754675">SERVER-57166</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25130"><![CDATA[Server Development Platform]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 22 Jun 2021 18:42:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 35 weeks 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>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>iryna.zhuravlova@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 35 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-devplatform</customfieldvalue>
            <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzkqfz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu9xen:</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_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|hzkcp3:</customfieldvalue>

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