<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:55:21 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-850] $where clause can crash server</title>
                <link>https://jira.mongodb.org/browse/SERVER-850</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Run a $where clause and attempt to dereference a null value. The server will fail with &quot;TypeError: this.x has no properties nofile_a:0&quot; and assert. The server will no longer respond to queries:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.foo.save(&lt;/p&gt;
{a:1}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.foo.find({$where:&quot;this.x.x&quot;})    &lt;br/&gt;
error: {&lt;br/&gt;
	&quot;$err&quot; : &quot;error on invocation of $where function:&lt;br/&gt;
JS Error: TypeError: this.x has no properties nofile_a:0&quot;&lt;/p&gt;

&lt;p&gt;From the server:&lt;/p&gt;

&lt;p&gt;Tue Mar 30 10:16:52 JS Error: TypeError: this.x has no properties nofile_a:0&lt;br/&gt;
Tue Mar 30 10:16:52 User Exception 10071:error on invocation of $where function:&lt;br/&gt;
JS Error: TypeError: this.x has no properties nofile_a:0&lt;br/&gt;
Tue Mar 30 10:16:52 Assertion: 10362:error on invocation of $where function:&lt;br/&gt;
JS Error: TypeError: this.x has no properties nofile_a:0&lt;br/&gt;
0x100067c57 0x1000c74de 0x100162c84 0x100165a4d 0x10022330b 0x10022c6f4 0x7fff8346a8b6 0x7fff8346a769 &lt;br/&gt;
 0   mongod                              0x0000000100067c57 _ZN5mongo11msgassertedEiPKc + 487&lt;br/&gt;
 1   mongod                              0x00000001000c74de _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpE + 7534&lt;br/&gt;
 2   mongod                              0x0000000100162c84 _ZN5mongo13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 644&lt;br/&gt;
 3   mongod                              0x0000000100165a4d _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERK11sockaddr_in + 3629&lt;br/&gt;
 4   mongod                              0x000000010022330b _ZN5mongo10connThreadEv + 619&lt;br/&gt;
 5   mongod                              0x000000010022c6f4 thread_proxy + 132&lt;br/&gt;
 6   libSystem.B.dylib                   0x00007fff8346a8b6 _pthread_start + 331&lt;br/&gt;
 7   libSystem.B.dylib                   0x00007fff8346a769 thread_start + 13&lt;br/&gt;
Tue Mar 30 10:16:52    Caught Assertion in runQuery ns:dotspots.foo massert:error on invocation of $where function:&lt;br/&gt;
JS Error: TypeError: this.x has no properties nofile_a:0&lt;br/&gt;
Tue Mar 30 10:16:52   ntoskip:0 ntoreturn:0&lt;br/&gt;
Tue Mar 30 10:16:52   query:&lt;/p&gt;
{ $where: &quot;this.x.x&quot; }</description>
                <environment>OSX: 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386&lt;br/&gt;
mongodb-osx-x86_64-1.4.0 &lt;br/&gt;
</environment>
        <key id="11647">SERVER-850</key>
            <summary>$where clause can crash server</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="eliot">Eliot Horowitz</assignee>
                                    <reporter username="mmastrac">Matt Mastracci</reporter>
                        <labels>
                    </labels>
                <created>Tue, 30 Mar 2010 12:19:12 +0000</created>
                <updated>Mon, 26 Apr 2010 13:52:06 +0000</updated>
                            <resolved>Tue, 30 Mar 2010 13:15:32 +0000</resolved>
                                    <version>1.4.0</version>
                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="13284" author="eliot" created="Tue, 30 Mar 2010 13:30:24 +0000"  >&lt;p&gt;i see.&lt;br/&gt;
yes - can you open a separate issue for that&lt;/p&gt;</comment>
                            <comment id="13283" author="mmastrac" created="Tue, 30 Mar 2010 13:28:41 +0000"  >&lt;p&gt;The issue seems to be that the client will re-print the previous server error on a client JS error.  It&apos;s not a mongod error, but rather a dbshell issue.&lt;/p&gt;

&lt;p&gt;Should I open up another issue for that?&lt;/p&gt;</comment>
                            <comment id="13280" author="eliot" created="Tue, 30 Mar 2010 13:15:32 +0000"  >&lt;p&gt;If i&apos;m reading your comment correctly, then all the mongo code is fine.&lt;br/&gt;
If I read it wrong - please add a new comment.&lt;/p&gt;</comment>
                            <comment id="13274" author="mmastrac" created="Tue, 30 Mar 2010 12:25:43 +0000"  >&lt;p&gt;I&apos;m trying it again now and it&apos;s not always fatal to the server. I did manage to get the server into a spot where it wouldn&apos;t respond to queries at all (and I couldn&apos;t reconnect).&lt;/p&gt;

&lt;p&gt;I&apos;ve tried this over and over and it&apos;s not getting into the wedged state that it did for me the first couple of times.  &lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;update&amp;#93;&lt;/span&gt; I&apos;ve retraced my steps and tried this over and over and can&apos;t reproduce it at all.  When I look through the logs, I think that it was a different bug causing the confusion:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;First, a $where that fails on the server:&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&amp;gt; db.dot.find({$where:&quot;this.contents.body.segments.length &amp;gt; 10&quot;})              &lt;br/&gt;
error: {&lt;br/&gt;
	&quot;$err&quot; : &quot;error on invocation of $where function:&lt;br/&gt;
JS Error: TypeError: this.contents.body.segments has no properties nofile_a:0&quot;&lt;br/&gt;
}&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;Next, a client JS error. Note that it repeats the last server error back at me. I think this is where the confusion came from:&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&amp;gt; db.dot.find({&quot;rebuild_dot&quot;:{&quot;version&quot;}})                       &lt;br/&gt;
Tue Mar 30 10:14:19 JS Error: SyntaxError: missing : after property id (shell):0&lt;br/&gt;
error on invocation of $where function:&lt;br/&gt;
JS Error: TypeError: this.contents.body.segments has no properties nofile_a:0&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>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 30 Mar 2010 13:15:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 47 weeks, 1 day 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 47 weeks, 1 day 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>mmastrac</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrppo7:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22615</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|ht0jk7:</customfieldvalue>

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