<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:55:56 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-1056] utf8 error causes Segmentation fault while deleting a Map/Reduce temporary collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-1056</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Replica-pair setup: production-shard1-002 and production-shard1-002.silentale.net&lt;br/&gt;
Before the first segmentation fault, shard1-002 is the master.&lt;/p&gt;

&lt;p&gt;I launch a Map/Reduce command with the Ruby driver. The command fails, I receive this exception: #&amp;lt;Mongo::OperationFailure: map-reduce failed: assertion: invalid utf8&amp;gt;.&lt;br/&gt;
Then I launch collection.count, I get a proper result.&lt;br/&gt;
And finally, I launch the same Map/Reduce command, but with less data (thanks to a query), and mongod crashes. I know that this last Map/Reduce command behaves correctly when launched on a freshly started server.&lt;/p&gt;

&lt;p&gt;Tue Apr 27 14:05:25 CMD: drop random_db_name.tmp.mr.mapreduce_1272377125_2&lt;br/&gt;
Tue Apr 27 14:05:25 CMD: drop random_db_name.tmp.mr.mapreduce_1272377125_2_inc&lt;br/&gt;
Tue Apr 27 14:05:25  Got signal: 11 (Segmentation fault).&lt;br/&gt;
Tue Apr 27 14:05:25  Backtrace:&lt;br/&gt;
0x6a8309 0x33042322a0 0x7400f9 0x7a02c3 0x79dbbb 0x71388b 0x713b5a 0x714c4f 0x714bdc 0x714ac5 0x54d691 0x54f433 0x649bdc 0x67e441 0x67f347 0x55662f 0x55a6cc 0x5f310a 0x5f8137 0x6a9894 &lt;/p&gt;

&lt;p&gt;The sad part is that I did not notice that the master crashed (auto-reconnect), and I crashed the second pair right after &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.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;

&lt;p&gt;I attached the logs of the two servers, and the Map/Reduce code in a Ruby file.&lt;/p&gt;

&lt;p&gt;I can reproduce the problem on my laptop (MongoDB 1.4.1 64bits OSX) with the same collection, and a single mongod instance. But it does not raise a segmentation fault, mongod just gently kills itself.&lt;/p&gt;

&lt;p&gt;Tue Apr 27 18:19:09 connection accepted from 127.0.0.1:60353 #1&lt;br/&gt;
Tue Apr 27 18:19:09 connection accepted from 127.0.0.1:60354 #2&lt;br/&gt;
Tue Apr 27 18:19:09 CMD: drop random_db_name.tmp.mr.mapreduce_1272385149_1&lt;br/&gt;
Tue Apr 27 18:19:09 CMD: drop random_db_name.tmp.mr.mapreduce_1272385149_1_inc&lt;br/&gt;
decode failed. probably invalid utf-8 string &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;c?cilegigi63&amp;quot;@orange.fr&amp;#93;&lt;/span&gt;&lt;br/&gt;
	 why: TypeError: malformed UTF-8 character sequence at offset 2&lt;br/&gt;
Tue Apr 27 18:19:10 mr failed, removing collection&lt;br/&gt;
Tue Apr 27 18:19:10 CMD: drop random_db_name.tmp.mr.mapreduce_1272385149_1&lt;br/&gt;
Tue Apr 27 18:19:10 CMD: drop random_db_name.tmp.mr.mapreduce_1272385149_1_inc&lt;br/&gt;
Tue Apr 27 18:19:10 query random_db_name.$cmd ntoreturn:1 command  reslen:89 641ms&lt;br/&gt;
Tue Apr 27 18:19:15 CMD: drop random_db_name.tmp.mr.mapreduce_1272385155_2&lt;br/&gt;
Tue Apr 27 18:19:15 CMD: drop random_db_name.tmp.mr.mapreduce_1272385155_2_inc&lt;br/&gt;
Assertion failure: !oldfp-&amp;gt;dormantNext, at jsinterp.c:1620&lt;br/&gt;
Tue Apr 27 18:19:15  Got signal: 6 (Abort trap).&lt;br/&gt;
Tue Apr 27 18:19:15  Backtrace:&lt;br/&gt;
0x10021983c 0x7fff800693fa 0x1f6 0x10021a1b5 0x10021f21d 0x10021f56d 0x10022066f 0x100000b74 &lt;br/&gt;
 0   mongod                              0x000000000021983c _ZN5mongo10abruptQuitEi + 332&lt;br/&gt;
 1   libSystem.B.dylib                   0x00000000800693fa _sigtramp + 26&lt;br/&gt;
 2   ???                                 0x00000000000001f6 0x0 + 502&lt;br/&gt;
 3   mongod                              0x000000000021a1b5 _ZN5mongo6listenEi + 597&lt;br/&gt;
 4   mongod                              0x000000000021f21d _ZN5mongo14_initAndListenEiPKc + 1693&lt;br/&gt;
 5   mongod                              0x000000000021f56d _ZN5mongo13initAndListenEiPKc + 29&lt;br/&gt;
 6   mongod                              0x000000000022066f main + 3583&lt;br/&gt;
 7   mongod                              0x0000000000000b74 start + 52&lt;br/&gt;
Tue Apr 27 18:19:15  dbexit: &lt;br/&gt;
Tue Apr 27 18:19:15 	 shutdown: going to close listening sockets...&lt;br/&gt;
Tue Apr 27 18:19:15 	 going to close listening socket: 7&lt;br/&gt;
Tue Apr 27 18:19:15 Listener on port 28017 aborted.&lt;br/&gt;
Tue Apr 27 18:19:15 	 going to close listening socket: 8&lt;br/&gt;
Tue Apr 27 18:19:15 	 shutdown: going to flush oplog...&lt;br/&gt;
Tue Apr 27 18:19:15 	 shutdown: going to close sockets...&lt;br/&gt;
Tue Apr 27 18:19:15 	 shutdown: waiting for fs preallocator...&lt;br/&gt;
Tue Apr 27 18:19:15 MessagingPort recv() errno:9 Bad file descriptor 127.0.0.1:60353&lt;br/&gt;
Tue Apr 27 18:19:15 	 shutdown: closing all files...&lt;br/&gt;
Tue Apr 27 18:19:15 end connection 127.0.0.1:60353&lt;br/&gt;
Tue Apr 27 18:19:15      closeAllFiles() finished&lt;br/&gt;
Tue Apr 27 18:19:15 	 shutdown: removing fs lock...&lt;br/&gt;
Tue Apr 27 18:19:15  dbexit: really exiting now&lt;/p&gt;

&lt;p&gt;So I suppose that this problems appears as soon as a previous map/reduce command fails.&lt;/p&gt;</description>
                <environment>fedora 9 x86_64</environment>
        <key id="11848">SERVER-1056</key>
            <summary>utf8 error causes Segmentation fault while deleting a Map/Reduce temporary collection</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="nicolas_">Nicolas Fouch&#233;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Apr 2010 13:00:53 +0000</created>
                <updated>Tue, 12 Jul 2016 00:28:02 +0000</updated>
                            <resolved>Wed, 28 Apr 2010 15:06:09 +0000</resolved>
                                    <version>1.4.1</version>
                                    <fixVersion>1.5.1</fixVersion>
                                    <component>Stability</component>
                                        <votes>3</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="13934" author="nicolas_" created="Thu, 29 Apr 2010 04:31:07 +0000"  >&lt;p&gt;Thanks, with the nightly build, I can rescue the errors in Javascript, and ignore them until I fix the documents in our database. Here are the logs I get:&lt;/p&gt;

&lt;p&gt;Thu Apr 29 10:26:14 connection accepted from 127.0.0.1:62770 #9&lt;br/&gt;
Thu Apr 29 10:26:14 connection accepted from 127.0.0.1:62771 #10&lt;br/&gt;
Thu Apr 29 10:26:14 CMD: drop veronica_production.tmp.mr.mapreduce_1272529574_8&lt;br/&gt;
Thu Apr 29 10:26:14 CMD: drop veronica_production.tmp.mr.mapreduce_1272529574_8_inc&lt;br/&gt;
decode failed. probably invalid utf-8 string &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;c?cilegigi63&amp;quot;@orange.fr&amp;#93;&lt;/span&gt;&lt;br/&gt;
	 why: TypeError: malformed UTF-8 character sequence at offset 2&lt;br/&gt;
=== Error catched by the JS map function: Error, for document: 4ad044b00f8bc5399300002c ===&lt;br/&gt;
decode failed. probably invalid utf-8 string &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;c?cilegigi&amp;quot;@orange.fr&amp;#93;&lt;/span&gt;&lt;br/&gt;
	 why: TypeError: malformed UTF-8 character sequence at offset 2&lt;br/&gt;
=== Error catched by the JS map function: Error, for document: 4ad044b00f8bc5399300002c ===&lt;br/&gt;
Thu Apr 29 10:26:16 building new index on &lt;/p&gt;
{ 0: 1 }
&lt;p&gt; for veronica_production.tmp.mr.mapreduce_1272529574_8_inc&lt;br/&gt;
Thu Apr 29 10:26:16 Buildindex veronica_production.tmp.mr.mapreduce_1272529574_8_inc idxNo:0 { ns: &quot;veronica_production.tmp.mr.mapreduce_1272529574_8_inc&quot;, key: &lt;/p&gt;
{ 0: 1 }
&lt;p&gt;, name: &quot;0_1&quot; }&lt;br/&gt;
Thu Apr 29 10:26:17 done for 7010 records 0.045secs&lt;/p&gt;

&lt;p&gt;I still have a question: what about the segmentation fault problem ? Now that we can rescue this particular utf-8 problem in Javascript, what about other problems that could occur ? Would mongod still crash ?&lt;/p&gt;</comment>
                            <comment id="13924" author="auto" created="Wed, 28 Apr 2010 15:06:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;erh&apos;, &apos;name&apos;: &apos;Eliot Horowitz&apos;, &apos;email&apos;: &apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: handle utf8 errors better in js, try to convert to js error &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1063&quot; title=&quot;Try to make UTF8 errors js exceptions rather than c++&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1063&quot;&gt;&lt;del&gt;SERVER-1063&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1056&quot; title=&quot;utf8 error causes Segmentation fault while deleting a Map/Reduce temporary collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1056&quot;&gt;&lt;del&gt;SERVER-1056&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/071f4015b4902bf17c0be268e38c0a26d4a3d29a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/071f4015b4902bf17c0be268e38c0a26d4a3d29a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="13912" author="nicolas_" created="Wed, 28 Apr 2010 06:19:27 +0000"  >&lt;p&gt;If a throw a Javascript exception in my map method, logs show:&lt;/p&gt;

&lt;p&gt;Wed Apr 28 12:15:22 JS Error: uncaught exception: blah&lt;/p&gt;

&lt;p&gt;And I can launch any M/R I want after that. So the problem seems to occur only when a exception is launched in the C code. In this case, it&apos;s in engine_spidermonkey.cpp, and I cannot catch it in Javascript (with a try/catch block).&lt;/p&gt;

&lt;p&gt;throw UserException( 9006 , &quot;invalid utf8&quot; ); &lt;/p&gt;</comment>
                            <comment id="13902" author="nicolas_" created="Tue, 27 Apr 2010 13:06:47 +0000"  >&lt;p&gt;By the way, if you know a solution to the first Map/Reduce fail, &quot;invalid utf-8 string&quot;, I take it &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; Because I&apos;m stuck until I can make this M/R command pass.&lt;/p&gt;</comment>
                            <comment id="13901" author="nicolas_" created="Tue, 27 Apr 2010 13:02:49 +0000"  >&lt;p&gt;Forgot to update the subject of the ticket, it&apos;s not quite exact. I let you change it to something like: &quot;Segmentation fault if a former Map/Reduce query fails&quot;.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10206" name="mr_function.rb" size="851" author="nicolas_" created="Tue, 27 Apr 2010 13:00:53 +0000"/>
                            <attachment id="10207" name="shard1-001.txt" size="29173" author="nicolas_" created="Tue, 27 Apr 2010 13:00:53 +0000"/>
                            <attachment id="10208" name="shard1-002.txt" size="4723" author="nicolas_" created="Tue, 27 Apr 2010 13:00:53 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 28 Apr 2010 15:06:14 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 42 weeks, 6 days 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>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>nicolas_</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpn47:</customfieldvalue>

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

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

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