<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20:20 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-4234] Build failure on Mac OS X 10.6 due to use of arc4random_buf</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4234</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;I can&apos;t build libbson from mongo-c-driver 1.20.0 on Mac OS X 10.6.8 with Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn) from Xcode 3.2.6. The error is:&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;src/libbson/src/bson/bson-context.c:234:4: warning: implicit declaration of function &apos;arc4random_buf&apos; is invalid in C99 [-Wimplicit-function-declaration]&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;   arc4random_buf (&amp;amp;result, sizeof (result));&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;   ^&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;1 warning generated.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&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;Undefined symbols for architecture i386:&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;  &quot;_arc4random_buf&quot;, referenced from:&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;      __bson_context_init_random in bson-context.c.o&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;ld: symbol(s) not found for architecture i386&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This problem was introduced in &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/723&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/723&lt;/a&gt;&#160;by unconditionally using &lt;tt&gt;arc4random_buf&lt;/tt&gt;&#160;on macOS.&#160;&lt;tt&gt;arc4random_buf&lt;/tt&gt; was introduced in Mac OS X 10.7.&lt;/p&gt;

&lt;p&gt;This made me look at the code in &lt;tt&gt;_get_rand&lt;/tt&gt;&#160;which raised a few questions:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Why is a potentially inaccurate list of &lt;tt&gt;arc4random_buf&lt;/tt&gt;-supporting systems being maintained in this file? Wouldn&apos;t it be simpler and better to detect the availability of &lt;tt&gt;arc4random_buf&lt;/tt&gt; at configure time?&lt;/li&gt;
	&lt;li&gt;If &lt;tt&gt;rand_r&lt;/tt&gt; is not defined but &lt;tt&gt;arc4random_buf&lt;/tt&gt; is, why does it use &lt;tt&gt;rand&lt;/tt&gt; instead of &lt;tt&gt;arc4random_buf&lt;/tt&gt;? Shouldn&apos;t &lt;tt&gt;arc4random_buf&lt;/tt&gt; be the first choice if it is available?&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Assuming the answer to both questions is that there is no good reason, I propose the following modification to address these issues:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/macports/macports-ports/blob/36d680300e67a74055138a067e4174c88ed96793/devel/mongo-c-driver/files/arc4random_buf.patch&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/macports/macports-ports/blob/36d680300e67a74055138a067e4174c88ed96793/devel/mongo-c-driver/files/arc4random_buf.patch&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1933780">CDRIVER-4234</key>
            <summary>Build failure on Mac OS X 10.6 due to use of arc4random_buf</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="13201">Fixed</resolution>
                                        <assignee username="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="ryandesign">Ryan Schmidt</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Nov 2021 19:07:35 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:15 +0000</updated>
                            <resolved>Mon, 13 Dec 2021 21:25:57 +0000</resolved>
                                    <version>1.20.0</version>
                                    <fixVersion>1.20.1</fixVersion>
                                    <component>libbson</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4245318" author="xgen-internal-githook" created="Mon, 13 Dec 2021 21:25:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Ryan Schmidt&apos;, &apos;email&apos;: &apos;ryandesign@macports.org&apos;, &apos;username&apos;: &apos;ryandesign&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4234&quot; title=&quot;Build failure on Mac OS X 10.6 due to use of arc4random_buf&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4234&quot;&gt;&lt;del&gt;CDRIVER-4234&lt;/del&gt;&lt;/a&gt; Detect arc4random_buf using cmake (#911)&lt;br/&gt;
Branch: r1.20&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/0a5b7bc19356c731a1766017d3aba5b2d1f19509&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/0a5b7bc19356c731a1766017d3aba5b2d1f19509&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4245315" author="xgen-internal-githook" created="Mon, 13 Dec 2021 21:25:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Ryan Schmidt&apos;, &apos;email&apos;: &apos;ryandesign@macports.org&apos;, &apos;username&apos;: &apos;ryandesign&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4234&quot; title=&quot;Build failure on Mac OS X 10.6 due to use of arc4random_buf&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4234&quot;&gt;&lt;del&gt;CDRIVER-4234&lt;/del&gt;&lt;/a&gt; Detect arc4random_buf using cmake (#911)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/54e5ecb561e09441f6695ca6c0b202aae7b98cd2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/54e5ecb561e09441f6695ca6c0b202aae7b98cd2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4242564" author="ryandesign" created="Sun, 12 Dec 2021 14:40:17 +0000"  >&lt;p&gt;Ok they&apos;re separated now.&lt;/p&gt;</comment>
                            <comment id="4242562" author="ryandesign" created="Sun, 12 Dec 2021 14:32:55 +0000"  >&lt;p&gt;I should probably separate the second commit into two...&lt;/p&gt;</comment>
                            <comment id="4242561" author="ryandesign" created="Sun, 12 Dec 2021 14:30:19 +0000"  >&lt;p&gt;Sure, is this ok?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/911&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/911&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4242542" author="kevin.albertson" created="Sun, 12 Dec 2021 13:43:18 +0000"  >&lt;p&gt;&#160;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;arc4random_buf was introduced in Mac OS X 10.7.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I do not have a Mac OS X 10.6 handy to test building. But comparing Libc versions in &lt;a href=&quot;https://opensource.apple.com/releases/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://opensource.apple.com/releases/&lt;/a&gt; shows &lt;tt&gt;arc4random_buf&lt;/tt&gt; introduced in stdlib.h in OS X 10.7:&lt;br/&gt;
 &lt;a href=&quot;https://github.com/apple-oss-distributions/Libc/blob/Libc-763.11/include/stdlib.h#L331-L335&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/apple-oss-distributions/Libc/blob/Libc-763.11/include/stdlib.h#L331-L335&lt;/a&gt;&lt;br/&gt;
 (comparing with 10.6.8 &lt;a href=&quot;https://github.com/apple-oss-distributions/Libc/blob/Libc-594.9.5/include/stdlib.h#L331-L334&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/apple-oss-distributions/Libc/blob/Libc-594.9.5/include/stdlib.h#L331-L334&lt;/a&gt;))&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;1. Why is a potentially inaccurate list of arc4random_buf-supporting systems being maintained in this file? Wouldn&apos;t it be simpler and better to detect the availability of arc4random_buf at configure time?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I do not see a clear reason. I agree it is preferable to check for arc4random_buf at configure time.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;2. If rand_r is not defined but arc4random_buf is, why does it use rand instead of arc4random_buf? Shouldn&apos;t arc4random_buf be the first choice if it is available?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I do not see a clear reason. &lt;tt&gt;arc4random_buf&lt;/tt&gt; seems preferable to &lt;tt&gt;rand_r&lt;/tt&gt;.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Assuming the answer to both questions is that there is no good reason, I propose the following modification to address these issues:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/macports/macports-ports/blob/36d680300e67a74055138a067e4174c88ed96793/devel/mongo-c-driver/files/arc4random_buf.patch&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/macports/macports-ports/blob/36d680300e67a74055138a067e4174c88ed96793/devel/mongo-c-driver/files/arc4random_buf.patch&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Thank you for including the patch! The patch LGTM and it applies cleanly on the latest commit (0756cbb4470a797be7d70841a7c922643dd30d55). Would you like to submit a pull-request? If not, I am happy to put it up for review.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1933738">CDRIVER-4233</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|hzv2a7:</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>