<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:16 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-2453] Invalid bson returned in bulk operation reply in some cases</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2453</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;When an document inserted in a bulk operation is invalid bson and also contains a certain UTF-8 string the bulk operation reply contains incorrectly truncated UTF-8 data. It looks like it can truncate in the middle of a code point. The returned bson is invalid in that case.&lt;/p&gt;

&lt;p&gt;I have a bson file to reliably reproduce this. It contains some customer data so I don&apos;t want to post it publicly, but it is not sensitive data so I&apos;m happy to email it to you.&lt;/p&gt;</description>
                <environment>Seen on Ubuntu 14.04 64 bit and Mac OS Sierra.</environment>
        <key id="479155">CDRIVER-2453</key>
            <summary>Invalid bson returned in bulk operation reply in some cases</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="thijs">Thijs Cadier</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Jan 2018 13:07:58 +0000</created>
                <updated>Wed, 15 Dec 2021 03:16:21 +0000</updated>
                            <resolved>Fri, 5 Jan 2018 14:13:42 +0000</resolved>
                                    <version>1.8.0</version>
                    <version>1.9.0</version>
                                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1766027" author="thijs" created="Fri, 5 Jan 2018 14:20:37 +0000"  >&lt;p&gt;Looks like that&apos;s it indeed, thanks.&lt;/p&gt;</comment>
                            <comment id="1766016" author="jesse" created="Fri, 5 Jan 2018 14:13:28 +0000"  >&lt;p&gt;This is &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-24007&quot; title=&quot;Server can return invalid UTF8 for error messages due to truncation in the middle of a code point&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-24007&quot;&gt;SERVER-24007&lt;/a&gt;. The BSON file you shared with me appears to be &lt;b&gt;valid&lt;/b&gt;, to me. It includes a very long UTF-8 _id value. When I insert the BSON twice, the server returns an error message like:&lt;/p&gt;

&lt;p&gt;&amp;gt; dup key: &quot;first 100 characters of long _id...&quot;&lt;/p&gt;

&lt;p&gt;The point where the server trims the _id value in order to include it in the error message is the 128th byte (or something like that), but the server doesn&apos;t notice that it has trimmed the _id in the middle of a multibyte UTF-8 character.&lt;/p&gt;

&lt;p&gt;I&apos;m going to close this ticket as a duplicate, feel free to reopen if I&apos;ve made a mistake.&lt;/p&gt;</comment>
                            <comment id="1766009" author="jesse" created="Fri, 5 Jan 2018 13:53:52 +0000"  >&lt;p&gt;Received. (I thought I could share this attachment as a private attachment to the Jira ticket, but Jira doesn&apos;t have this feature so I deleted the attachment again.)&lt;/p&gt;</comment>
                            <comment id="1766004" author="thijs" created="Fri, 5 Jan 2018 13:48:45 +0000"  >&lt;p&gt;You have to insert it into the same collection twice by the way, the second time there will be a duplicate key error and this bug will trigger.&lt;/p&gt;</comment>
                            <comment id="1766002" author="thijs" created="Fri, 5 Jan 2018 13:44:46 +0000"  >&lt;p&gt;Done&lt;/p&gt;</comment>
                            <comment id="1766000" author="jesse" created="Fri, 5 Jan 2018 13:35:21 +0000"  >&lt;p&gt;Oh, interesting. Sure, email me the file.&lt;/p&gt;</comment>
                            <comment id="1765999" author="thijs" created="Fri, 5 Jan 2018 13:30:13 +0000"  >&lt;p&gt;This is example code using the Rust wrapper around libmongoc to trigger this bug:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let uri            = Uri::new(&quot;mongodb://localhost:27017/&quot;).unwrap();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let pool           = ClientPool::new(uri, None);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let client         = pool.pop();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let collection     = client.get_collection(&quot;rust_driver_test&quot;, &quot;bulk_operation_utf8_from_file&quot;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let bulk_operation = collection.create_bulk_operation(None);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let mut file = File::open(&quot;~/Desktop/malformed.bson&quot;).unwrap();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;let document = bson::decode_document(&amp;amp;mut file).unwrap();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;bulk_operation.insert(&amp;amp;document).unwrap();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;bulk_operation.execute().unwrap();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="1765998" author="thijs" created="Fri, 5 Jan 2018 13:28:36 +0000"  >&lt;p&gt;I double checked this and the situation is slightly different: The bson in the bulk operation is actually valid, but the reply returned is invalid bson anyway. Can I send the bson file that triggers this to you?&lt;/p&gt;</comment>
                            <comment id="1765984" author="thijs" created="Fri, 5 Jan 2018 13:18:14 +0000"  >&lt;p&gt;That&apos;s a good point, I actually don&apos;t know if it&apos;s a server or a driver bug. The driver or server correctly rejects the bson. The bug is that the driver then returns a reply that contains invalid bson. In my mind the reply document should always be valid bson. Whether the source of the invalid bson is the driver or the server I cannot tell.&lt;/p&gt;</comment>
                            <comment id="1765983" author="jesse" created="Fri, 5 Jan 2018 13:13:01 +0000"  >&lt;p&gt;Thanks. Do you think this is either expected behavior (inserting invalid BSON results in undefined behavior) or a server bug (it accepts invalid BSON and replies with invalid BSON) or a driver bug (we don&apos;t reject the invalid BSON)?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="283754">SERVER-24007</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1949626">DRIVERS-2008</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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|htexhj:</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>