<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:10:00 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>[CDRIVER-596] Figure out what to do about bson_t alignment restrictions</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-596</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;We set alignment attributes for bson_t&apos;s, but we set them at 128 byte alignment (theoretically to align them for cache lines on the stack).&lt;/p&gt;

&lt;p&gt;The problem is that we malloc and return them that way.  While malloc is guaranteed to return something as aligned as the most aligned scalar type, that isn&apos;t generally 128 byte alignment.&lt;/p&gt;

&lt;p&gt;That makes tools scream constantly about the misalignment.  It also shows up in cases where bson_malloc has been shimmed if the memory allocater doesn&apos;t go wide enough (specifically showing up in zend_emalloc, only 8 byte alignment), which causes memcpy to screw up (it looked at the types going in and generated aggressive code assuming it could use vectorized intrinsincs, when it could not)&lt;/p&gt;</description>
                <environment></environment>
        <key id="192556">CDRIVER-596</key>
            <summary>Figure out what to do about bson_t alignment restrictions</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="-1">Unassigned</assignee>
                                    <reporter username="mira.carey@mongodb.com">Mira Carey</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Mar 2015 19:03:28 +0000</created>
                <updated>Thu, 6 Sep 2018 18:37:45 +0000</updated>
                            <resolved>Fri, 24 Apr 2015 19:13:15 +0000</resolved>
                                                    <fixVersion>1.2-beta0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1209426" author="jesse" created="Mon, 21 Mar 2016 13:12:43 +0000"  >&lt;p&gt;It&apos;s an ABI break, so we&apos;re waiting for libbson and libmongoc 2.0, when semantic versioning allows backwards-incompatible changes.&lt;/p&gt;</comment>
                            <comment id="1209355" author="ppisar" created="Mon, 21 Mar 2016 11:58:58 +0000"  >&lt;p&gt;Default BSON_EXTRA_ALIGN is still 1. If this generates broken code,  isn&apos;t time to disable it by default?&lt;/p&gt;</comment>
                            <comment id="1054615" author="xgen-internal-githook" created="Wed, 7 Oct 2015 21:59:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;hanumantmk&apos;, u&apos;name&apos;: u&apos;Jason Carey (hanumantmk)&apos;, u&apos;email&apos;: u&apos;jcarey@argv.me&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-596&quot; title=&quot;Figure out what to do about bson_t alignment restrictions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-596&quot;&gt;&lt;del&gt;CDRIVER-596&lt;/del&gt;&lt;/a&gt; Offer a way to skip over aligned types&lt;/p&gt;

&lt;p&gt;Add BSON_EXTRA_ALIGN, which when set to 0, disables extra alignment of&lt;br/&gt;
types.  It takes all alignment specifiers and drops them to pointer&lt;br/&gt;
alignment.&lt;/p&gt;

&lt;p&gt;Using this flag will break ABI&lt;/p&gt;

&lt;p&gt;Added --enable-extra-align configure flag which controls this.  It&apos;s&lt;br/&gt;
enabled by default.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/libbson/commit/6e8eca8d044e73db0fd7b8a26824312e79cc3bf7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/libbson/commit/6e8eca8d044e73db0fd7b8a26824312e79cc3bf7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="897685" author="jesse" created="Fri, 24 Apr 2015 19:13:05 +0000"  >&lt;p&gt;Fixed on 1.2.0-dev branch:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/libbson/commit/6e8eca8d044e73db0fd7b8a26824312e79cc3bf7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/libbson/commit/6e8eca8d044e73db0fd7b8a26824312e79cc3bf7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="866658" author="jason.carey" created="Fri, 27 Mar 2015 20:24:10 +0000"  >&lt;p&gt;I think for now I&apos;m just going to ignore fixing the real problem and offer a patch workaround.&lt;/p&gt;

&lt;p&gt;It&apos;s definitely true that some compilers take advantage of the alignment specifier to generate different code for 8 byte versus 16 byte aligned types.   So we&apos;ll definitely break ABI if we get rid of the aligned requirements bson_t.&lt;/p&gt;

&lt;p&gt;For now that means making this an off by default configure switch and moving on with our lives.&lt;/p&gt;


</comment>
                            <comment id="866653" author="jason.carey" created="Fri, 27 Mar 2015 20:19:39 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/libbson/pull/121&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/libbson/pull/121&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="597886">CDRIVER-2810</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="239583">CDRIVER-997</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="242842">CDRIVER-1042</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="192574">PHPC-213</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="598755">CDRIVER-2813</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs7kd3:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>