<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:22:25 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-30013] opCtx is a naked pointer, except where it&apos;s a std::unique_ptr&lt;&gt;.</title>
                <link>https://jira.mongodb.org/browse/SERVER-30013</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Throughout the server, OperationContexts are operated on via a naked pointer always named opCtx.  Often there is a stdx::unique_ptr&amp;lt;OperationContext&amp;gt; (typedef&apos;d &quot;UniqueOperationContext&quot;) also named opCtx.  There is no way to protect against a null opCtx, or any of myriad implicit, incorrect pointer operations.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;OperationContext should be renamed OperationContext::Impl.&lt;/li&gt;
	&lt;li&gt;OperationContext itself should be a struct wrapping a std::unique_ptr&amp;lt;OperationContext::Impl&amp;gt;.&lt;/li&gt;
	&lt;li&gt;Uses of OperationContext* in interfaces should be replaced with an OpCtxRef, wrapping a guaranteed non-null OperationContext::Impl*.&lt;/li&gt;
	&lt;li&gt;Member functions of the present OperationContext should be moved to OpCtxRef or to Impl, according to usage.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="401164">SERVER-30013</key>
            <summary>opCtx is a naked pointer, except where it&apos;s a std::unique_ptr&lt;&gt;.</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-platform">DO NOT USE - Backlog - Platform Team</assignee>
                                    <reporter username="nathan.myers">Nathan Myers</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Jul 2017 17:00:14 +0000</created>
                <updated>Tue, 23 Jul 2019 17:19:39 +0000</updated>
                            <resolved>Tue, 23 Jul 2019 17:19:39 +0000</resolved>
                                    <version>3.5.9</version>
                                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1628790" author="nathan.myers" created="Fri, 21 Jul 2017 16:50:45 +0000"  >&lt;p&gt;&amp;gt; ... a frequent source of programming errors?&lt;/p&gt;

&lt;p&gt;It&apos;s a legitimate question, but not the one I had chiefly in mind.  &lt;br/&gt;
A naked pointer is an expensive construct, cognitively, &lt;br/&gt;
because in general you don&apos;t know which of its properties are&lt;br/&gt;
salient to the immediate use.  Can it be null? Does arithmetic &lt;br/&gt;
on it mean anything? Can its referent expire?  Can/must I delete &lt;br/&gt;
it?  OpCtx is so deeply threaded through the system, we soon &lt;br/&gt;
pick up the answers by example, but a newcomer has many other &lt;br/&gt;
questions to worry about.  &lt;/p&gt;

&lt;p&gt;That said, how many use-after-free errors do we have with opCtx? &lt;br/&gt;
We have no way of knowing, but we know that it is a common &lt;br/&gt;
cause of intermittent failures in similar systems.&lt;/p&gt;

&lt;p&gt;The design load might be more important.  If it turned out to be&lt;br/&gt;
useful to carry state along with each instance, the idea probably &lt;br/&gt;
would not reach the conscious level because it is not practical to &lt;br/&gt;
do.  Given an opaque struct, it would be easy to add a member &lt;br/&gt;
alongside the pointer.&lt;/p&gt;</comment>
                            <comment id="1615537" author="schwerin" created="Thu, 6 Jul 2017 19:05:36 +0000"  >&lt;p&gt;While this complaint is valid, I&apos;m curious if it&apos;s a frequent source of programming errors?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 6 Jul 2017 19:05:36 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 29 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-platform</customfieldvalue>
            <customfieldvalue>nathan.myers</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htafbr:</customfieldvalue>

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

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