<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:01:27 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-2883] gcc reports &quot;array subscript is above array bounds&quot; in stringToOid</title>
                <link>https://jira.mongodb.org/browse/SERVER-2883</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I get the following errors building from 1.8.1-rc0 or trunk:&lt;/p&gt;

&lt;p&gt;g++ -o db/json.o -c -Wnon-virtual-dtor -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -fno-builtin-memcmp -O3 -D_SCONS -DMONGO_EXPOSE_MACROS -DXULRUNNER -DOLDJS -DXP_UNIX -I/usr/include/nspr -I/usr/include/xulrunner-2.0/stable -I/usr/include/xulrunner-2.0/unstable -I/usr/include/xulrunner-2.0 -I. -I/usr/local/home/trobinson/dev/v8/include db/json.cpp&lt;br/&gt;
cc1plus: warnings being treated as errors&lt;br/&gt;
db/json.cpp: In function &apos;mongo::OID mongo::stringToOid(const char*)&apos;:&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
db/json.cpp:331:49: error: array subscript is above array bounds&lt;br/&gt;
scons: *** &lt;span class=&quot;error&quot;&gt;&amp;#91;db/json.o&amp;#93;&lt;/span&gt; Error 1&lt;br/&gt;
scons: building terminated because of errors.&lt;/p&gt;

&lt;p&gt;This may be due to GCC bug 47418: &lt;a href=&quot;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47418&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47418&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The error can be fixed by editing bson/oid.h and moving unsigned char data&lt;span class=&quot;error&quot;&gt;&amp;#91;12&amp;#93;&lt;/span&gt;; to the top of the anonymous union in class OID.&lt;/p&gt;

&lt;p&gt;$ gcc -v&lt;br/&gt;
Using built-in specs.&lt;br/&gt;
COLLECT_GCC=gcc&lt;br/&gt;
COLLECT_LTO_WRAPPER=/usr/lib/arm-linux-gnueabi/gcc/arm-linux-gnueabi/4.5.2/lto-wrapper&lt;br/&gt;
Target: arm-linux-gnueabi&lt;br/&gt;
Configured with: ../src/configure -v --with-pkgversion=&apos;Ubuntu/Linaro 4.5.2-6ubuntu5&apos; --with-bugurl=&lt;a href=&quot;file:///usr/share/doc/gcc-4.5/README.Bugs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;file:///usr/share/doc/gcc-4.5/README.Bugs&lt;/a&gt; --enable-languages=c,c+&lt;ins&gt;,fortran,objc,obj-c&lt;/ins&gt;+ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=arm-linux-gnueabi --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/arm-linux-gnueabi --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/arm-linux-gnueabi --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-float=softfp --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi&lt;br/&gt;
Thread model: posix&lt;br/&gt;
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-6ubuntu5)&lt;/p&gt;

&lt;p&gt;Also occurs with gcc 4.4.5:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;gcc -v&lt;br/&gt;
Using built-in specs.&lt;br/&gt;
Target: arm-linux-gnueabi&lt;br/&gt;
Configured with: ../src/configure -v --with-pkgversion=&apos;Ubuntu/Linaro 4.4.4-14ubuntu5&apos; --with-bugurl=&lt;a href=&quot;file:///usr/share/doc/gcc-4.4/README.Bugs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;file:///usr/share/doc/gcc-4.4/README.Bugs&lt;/a&gt; --enable-languages=c,c+&lt;ins&gt;,fortran,objc,obj-c&lt;/ins&gt;+ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-float=softfp --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi&lt;br/&gt;
Thread model: posix&lt;br/&gt;
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment>gcc 4.5.2 on ubuntu natty armel, gcc 4.4.5 on ubuntu maverick armel</environment>
        <key id="15419">SERVER-2883</key>
            <summary>gcc reports &quot;array subscript is above array bounds&quot; in stringToOid</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="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="scurrilous">Trevor Robinson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Apr 2011 01:12:00 +0000</created>
                <updated>Thu, 5 Apr 2012 22:20:17 +0000</updated>
                            <resolved>Fri, 27 Jan 2012 16:10:23 +0000</resolved>
                                                                    <component>Build</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="107170" author="redbeard0531" created="Thu, 5 Apr 2012 22:20:17 +0000"  >&lt;p&gt;What does gcc -v say? Note that arm isn&apos;t fully supported so you may run into further issues even if you get this resolved.&lt;/p&gt;</comment>
                            <comment id="107127" author="hutchman" created="Thu, 5 Apr 2012 20:04:43 +0000"  >&lt;p&gt;I can confirm that it happens still on Ubuntu 11.04 ARM running on BeagleBoard native building 2.0.4.&lt;/p&gt;

&lt;p&gt;root@localhost:/mnt/mongodb# scons all&lt;br/&gt;
scons: Reading SConscript files ...&lt;br/&gt;
scons version: 2.0.1&lt;br/&gt;
python version: 2 7 1 &apos;final&apos; 0&lt;br/&gt;
Checking whether the C++ compiler works(cached) yes&lt;br/&gt;
Checking for C library stdc++... (cached) yes&lt;br/&gt;
Checking for C++ header file execinfo.h... (cached) yes&lt;br/&gt;
Checking for C library pcap... (cached) yes&lt;br/&gt;
scons: done reading SConscript files.&lt;br/&gt;
scons: Building targets ...&lt;br/&gt;
generate_buildinfo(&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;build/buildinfo.cpp&amp;quot;&amp;#93;&lt;/span&gt;, [&apos;\n#include&lt;br/&gt;
&amp;lt;string&amp;gt;\n#include &amp;lt;boost/version.hpp&amp;gt;\n\n#include&lt;br/&gt;
&quot;mongo/util/version.h&quot;\n\nnamespace mongo {\n    const char *&lt;br/&gt;
gitVersion() &lt;/p&gt;
{ return &quot;%(git_version)s&quot;; }
&lt;p&gt;\n    std::str)&lt;br/&gt;
g++ -o build/linux2/normal/mongo/db/json.o -c -Wnon-virtual-dtor&lt;br/&gt;
-Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall&lt;br/&gt;
-Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe&lt;br/&gt;
-fno-builtin-memcmp -O3 -DBOp&lt;br/&gt;
cc1plus: warnings being treated as errors&lt;br/&gt;
src/mongo/db/json.cpp: In function &apos;mongo::OID mongo::stringToOid(const char*)&apos;:&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
src/mongo/db/json.cpp:365:49: error: array subscript is above array bounds&lt;br/&gt;
scons: *** &lt;span class=&quot;error&quot;&gt;&amp;#91;build/linux2/normal/mongo/db/json.o&amp;#93;&lt;/span&gt; Error 1&lt;br/&gt;
scons: building terminated because of errors.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Brian&lt;/p&gt;
</comment>
                            <comment id="82920" author="scurrilous" created="Fri, 27 Jan 2012 19:50:58 +0000"  >&lt;p&gt;Not anymore, since I&apos;ve upgraded to Ubuntu Oneiric, which uses GCC 4.6. It&apos;s probably still an issue in GCC 4.4 and 4.5, but no one should be using those on ARM, given all the ARM fixes going into 4.6+.&lt;/p&gt;</comment>
                            <comment id="81397" author="redbeard0531" created="Sat, 21 Jan 2012 00:22:45 +0000"  >&lt;p&gt;Are you still seeing this? It isn&apos;t showing up in any of our buildbots.&lt;/p&gt;</comment>
                            <comment id="39145" author="scurrilous" created="Fri, 24 Jun 2011 20:49:41 +0000"  >&lt;p&gt;Patch (against current trunk) to fix &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2883&quot; title=&quot;gcc reports &amp;quot;array subscript is above array bounds&amp;quot; in stringToOid&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2883&quot;&gt;&lt;del&gt;SERVER-2883&lt;/del&gt;&lt;/a&gt; by moving &apos;unsigned char data&lt;span class=&quot;error&quot;&gt;&amp;#91;12&amp;#93;&lt;/span&gt;;&apos; to the top of the anonymous union in class OID.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="12126" name="mongodb-bson-oid.patch" size="558" author="scurrilous" created="Fri, 24 Jun 2011 20:49:41 +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>Sat, 21 Jan 2012 00:22:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 45 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>false</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>
                            11 years, 45 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_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>hutchman</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>scurrilous</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp24f:</customfieldvalue>

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

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

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