<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:38:40 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-56214] mongod built from branch master on ARM64 throws &quot;Illegal instruction&quot;</title>
                <link>https://jira.mongodb.org/browse/SERVER-56214</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I built mongod from the latest master branch off of the git repo on ARM64. Ubuntu 20.04&#160;&lt;/p&gt;

&lt;p&gt;$ uname -a &lt;br/&gt;
Linux arminst8x-01 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:42:16 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ git clone &lt;a href=&quot;https://github.com/mongodb/mongo.git&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ buildscripts/scons.py CCFLAGS=&quot;-march=armv8.1-a&quot; DESTDIR=/home/ubuntu/bin/mongo --disable-warnings-as-errors install-mongod&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ ./mongod --help&lt;br/&gt;
Illegal instruction&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ lldb ./mongod&lt;br/&gt;
(lldb) target create &quot;./mongod&quot;&lt;br/&gt;
Current executable set to &apos;/home/ubuntu/bin/mongo/bin/mongod&apos; (aarch64).&lt;br/&gt;
(lldb) run&lt;br/&gt;
Process 90916 launched: &apos;/home/ubuntu/bin/mongo/bin/mongod&apos; (aarch64)&lt;br/&gt;
Process 90916 stopped&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;thread #1, name = &apos;mongod&apos;, stop reason = signal SIGILL: illegal instruction&lt;br/&gt;
 frame #0: 0x0000aaaaae759260 mongod`tcmalloc::ThreadCache::InitModule() &lt;span class=&quot;error&quot;&gt;&amp;#91;inlined&amp;#93;&lt;/span&gt; SpinLockHolder::SpinLockHolder(l=&amp;lt;unavailable&amp;gt;, this=&amp;lt;unavailable&amp;gt;) at atomicops-internals-gcc.h:84:30&lt;br/&gt;
 81 Atomic32 old_value,&lt;br/&gt;
 82 Atomic32 new_value) 
{
 83 Atomic32 prev_value = old_value;
-&amp;gt; 84 __atomic_compare_exchange_n(ptr, &amp;amp;prev_value, new_value, 
 85 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
 86 return prev_value;
 87 }
&lt;p&gt;(lldb)&#160;c&lt;br/&gt;
Process 90916 resuming&lt;br/&gt;
Process 90916 exited with status = 4 (0x00000004) &lt;br/&gt;
(lldb)&#160;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Please let me know if you need me to attach any logs and where to find them on the build tree.&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1684438">SERVER-56214</key>
            <summary>mongod built from branch master on ARM64 throws &quot;Illegal instruction&quot;</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="13202">Works as Designed</resolution>
                                        <assignee username="andrew.morrow@mongodb.com">Andrew Morrow</assignee>
                                    <reporter username="onlinemails@manjo.net">Manoj Iyer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Apr 2021 20:31:24 +0000</created>
                <updated>Fri, 27 Oct 2023 13:52:25 +0000</updated>
                            <resolved>Thu, 22 Apr 2021 15:22:24 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="3731975" author="JIRAUSER1259560" created="Thu, 22 Apr 2021 03:32:26 +0000"  >&lt;p&gt;I built mongod with gcc g++ 10.3 with the default flags you mentioned and I was able to get it to work on an ARM64 system.&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ ./mongod --version&lt;br/&gt;
db version v5.0.0-alpha-240-ge9279fb&lt;br/&gt;
Build Info: {&lt;br/&gt;
 &quot;version&quot;: &quot;5.0.0-alpha-240-ge9279fb&quot;,&lt;br/&gt;
 &quot;gitVersion&quot;: &quot;e9279fb3d14f203842c8dc1e348c73cdc7eb10c5&quot;,&lt;br/&gt;
 &quot;openSSLVersion&quot;: &quot;OpenSSL 1.1.1f 31 Mar 2020&quot;,&lt;br/&gt;
 &quot;modules&quot;: [],&lt;br/&gt;
 &quot;allocator&quot;: &quot;tcmalloc&quot;,&lt;br/&gt;
 &quot;environment&quot;: &lt;/p&gt;
{
 &quot;distarch&quot;: &quot;aarch64&quot;,
 &quot;target_arch&quot;: &quot;aarch64&quot;
 }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks for your help I think we can close this bug.&#160;&lt;/p&gt;</comment>
                            <comment id="3731113" author="acm" created="Wed, 21 Apr 2021 18:09:32 +0000"  >&lt;p&gt;Finally, please note that it is important that you pass the &lt;tt&gt;&amp;#45;march&lt;/tt&gt; flag via &lt;tt&gt;CCFLAGS&lt;/tt&gt; and not &lt;tt&gt;CFLAGS&lt;/tt&gt; - they do different things.&lt;/p&gt;</comment>
                            <comment id="3731109" author="acm" created="Wed, 21 Apr 2021 18:08:34 +0000"  >&lt;p&gt;Sorry, you are right, I meant &lt;tt&gt;CCFLAGS=&quot;&amp;#45;march=armv8-a&quot;&lt;/tt&gt; (I forgot the &lt;tt&gt;&amp;#45;&lt;/tt&gt; character in there previously). Still , I really suggest you try that. These errors suggest that your local hardware is not of a sufficiently new processor revision to actually execute &lt;tt&gt;armv8.1-a&lt;/tt&gt; or &lt;tt&gt;armv8.2-a&lt;/tt&gt; instructions. Dropping down to targeting &lt;tt&gt;armv8-a&lt;/tt&gt; will almost certainly get you a working build. Note that on master we build with &lt;tt&gt;&amp;#45;moutline-atomics&lt;/tt&gt; by default if the compiler supports it (I think this is what you are referring to about GCC 10). So by building with &lt;tt&gt;CCFLAGS=&quot;&amp;#45;march=armv8-a&lt;/tt&gt; you will get a build that can run on either an &lt;tt&gt;armv8-a&lt;/tt&gt; or an &lt;tt&gt;armv8.1-a&lt;/tt&gt; system and will select the LSE intrinsics if available on the local hardware. Note that you may need to also build with &lt;tt&gt;--use-hardware-crc32=off&lt;/tt&gt; if your local hardware doesn&apos;t offer the CRC instructions. For &lt;tt&gt;armv8.1-a&lt;/tt&gt; systems they are I believe mandatory, but they may or may not exist on &lt;tt&gt;armv8-a&lt;/tt&gt; processors.&lt;/p&gt;</comment>
                            <comment id="3730982" author="JIRAUSER1259560" created="Wed, 21 Apr 2021 17:26:37 +0000"  >&lt;p&gt;Andrew,&lt;/p&gt;

&lt;p&gt;I rebuilt mongod with the default (armv8.2-a) with the 10.3 compiler since the gcc-10 supposedly has a few improvements over atomics. Also&#160;CFLAGS=&quot;-march=armv8a&quot; is not a valid option.&lt;/p&gt;

&lt;p&gt;$ gcc --version&lt;br/&gt;
 gcc (Ubuntu 10.3.0-1ubuntu1~20.04~2) 10.3.0&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ buildscripts/scons.py DESTDIR=/home/ubuntu/bin/mongo --disable-warnings-as-errors install-mongod&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ ./mongod --help&lt;br/&gt;
 Illegal instruction&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;$ lldb ./mongod&lt;br/&gt;
 (lldb) target create &quot;./mongod&quot;&lt;br/&gt;
 Current executable set to &apos;/home/ubuntu/bin/mongo/bin/mongod&apos; (aarch64).&lt;br/&gt;
 (lldb) run&lt;br/&gt;
 Process 108543 launched: &apos;/home/ubuntu/bin/mongo/bin/mongod&apos; (aarch64)&lt;br/&gt;
 Process 108543 stopped&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;thread #1, name = &apos;mongod&apos;, stop reason = signal SIGILL: illegal instruction&lt;br/&gt;
 frame #0: 0x0000aaaaae735090 mongod`tcmalloc::ThreadCache::InitModule() &lt;span class=&quot;error&quot;&gt;&amp;#91;inlined&amp;#93;&lt;/span&gt; SpinLockHolder::SpinLockHolder(l=&amp;lt;unavailable&amp;gt;, this=0x7f7f7f7f7f7f7f7f) at atomicops-internals-gcc.h:84:30&lt;br/&gt;
 81 Atomic32 old_value,&lt;br/&gt;
 82 Atomic32 new_value)&lt;br/&gt;
Unknown macro: { 83 Atomic32 prev_value = old_value; -&amp;gt; 84 __atomic_compare_exchange_n(ptr, &amp;amp;prev_value, new_value, 85 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED); 86 return prev_value; 87 }(lldb) &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/310899/310899_mongod-lldb-gcc10.3.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="3730357" author="acm" created="Wed, 21 Apr 2021 14:35:41 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=onlinemails%40manjo.net&quot; class=&quot;user-hover&quot; rel=&quot;onlinemails@manjo.net&quot;&gt;onlinemails@manjo.net&lt;/a&gt; - I note that you have elected to target &lt;tt&gt;armv8.1-a&lt;/tt&gt; here, presumably to step down from targeting of &lt;tt&gt;armv8.2-a&lt;/tt&gt; which is the current default on master. However, are you sure that your local hardware is actually &lt;tt&gt;armv8.1-a&lt;/tt&gt; based? The illegal instruction failure mode suggests that it may not be. If you step down further to target just &lt;tt&gt;armv8a&lt;/tt&gt; with &lt;tt&gt;CCFLAGS=&quot;-march=armv8a&quot;&lt;/tt&gt; do things start working again?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="310728" name="mongo-debug.png" size="76083" author="onlinemails@manjo.net" created="Tue, 20 Apr 2021 20:33:47 +0000"/>
                            <attachment id="310899" name="mongod-lldb-gcc10.3.png" size="67137" author="onlinemails@manjo.net" created="Wed, 21 Apr 2021 17:26:33 +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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 21 Apr 2021 14:32:52 +0000</customfieldvalue>

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

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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr3tif:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4836">Dev Platform 2021-05-03</customfieldvalue>

                        </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|hz5447:</customfieldvalue>

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