<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:46 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-2608] libbson and mongoc tests crash in libbson code when using --no-fork</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2608</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&apos;m porting mongoc/libbson on AIX (v6.1). First port.&lt;/p&gt;

&lt;p&gt;I&apos;ve started with version 1.9.3. I&apos;ve just moved to version 1.9.4 .&lt;/p&gt;

&lt;p&gt;The &quot;make check&quot; generates crashes (core) for libbson and mongoc, both with -O2 and -g, both in 32bit and 64bit (however, crashes are different).&lt;/p&gt;

&lt;p&gt;&quot;make check&quot; makes use of the &quot;--no-fork&quot; option. When not using this option, mongoc shows only 6 FAILures, no crash/core, and libbson is OK.&lt;/p&gt;

&lt;p&gt;I&apos;ve tried with libbson bundled or not inside mongoc: nearly the same crashes.&lt;/p&gt;

&lt;p&gt;libbson/mongoc are compiled with GCC, v6.3 at first, now v7.1 .&lt;/p&gt;

&lt;p&gt;Since MongoDB does not run on AIX, I&apos;m using a remote mongodb server on a Linux/x86_64 machine (4.13.11-100.fc25.x86_64).&lt;br/&gt;
MongoDB version : mongodb-server-3.2.12-1.fc25.x86_64&lt;/p&gt;

&lt;p&gt;It seems to me that the crashes deal with how libbson manages memory:&lt;br/&gt;
 bson_mem_restore_vtable&lt;br/&gt;
 bson_malloc0&lt;br/&gt;
 _bson_iter_next_internal&lt;br/&gt;
 bson_string_new&lt;/p&gt;

&lt;p&gt;I know nearly nothing about mongoc. I need help for figuring out how to debug/fix this issue.&lt;/p&gt;

&lt;p&gt;About &lt;b&gt;mongoc&lt;/b&gt;, I have:&lt;br/&gt;
{{libmongoc 1.9.4 was configured with the following options:&lt;/p&gt;

&lt;p&gt;Build configuration:&lt;br/&gt;
  Enable debugging (slow)                          : yes&lt;br/&gt;
  Compile with debug symbols (slow)                : full&lt;br/&gt;
  Enable GCC build optimization                    : no&lt;br/&gt;
  Enable automatic init and cleanup                : no&lt;br/&gt;
  Enable mongodb+srv URIs                          : auto&lt;br/&gt;
  Enable maintainer flags                          : no&lt;br/&gt;
  Code coverage support                            : no&lt;br/&gt;
  Cross Compiling                                  : no&lt;br/&gt;
  Fast counters                                    : no&lt;br/&gt;
  Shared memory performance counters               : yes&lt;br/&gt;
  SASL                                             : no&lt;br/&gt;
  SSL                                              : openssl&lt;br/&gt;
  Snappy Compression                               : system&lt;br/&gt;
  Zlib Compression                                 : system&lt;br/&gt;
  Libbson                                          : system&lt;/p&gt;

&lt;p&gt;Documentation:&lt;br/&gt;
  man                                              : no&lt;br/&gt;
  HTML                                             : no}}&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;gdb ./test-libmongoc&lt;br/&gt;
(gdb) run   (no  --no-fork  option !)&lt;br/&gt;
    
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/BulkOperation/upsert_unordered_oversized&quot;, &quot;seed&quot;: &quot;10627911&quot;, &quot;start&quot;: 10987519.621764589, &quot;end&quot;: 10987521.316436900, &quot;elapsed&quot;: 1.694672311  }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/BulkOperation/upsert_huge&quot;, &quot;seed&quot;: &quot;3030471911&quot;, &quot;start&quot;: 10987522.620592515, &quot;end&quot;: 10987523.967977921, &quot;elapsed&quot;: 1.347385406  }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/BulkOperation/large_inserts_ordered&quot;, &quot;seed&quot;: &quot;3138342737&quot;, &quot;start&quot;: 10987531.721175652, &quot;end&quot;: 10987533.140875839, &quot;elapsed&quot;: 1.419700187  }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/BulkOperation/large_inserts_unordered&quot;, &quot;seed&quot;: &quot;3327859616&quot;, &quot;start&quot;: 10987533.141157775, &quot;end&quot;: 10987534.537897308, &quot;elapsed&quot;: 1.396739533  }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/Collection/update/oversize&quot;, &quot;seed&quot;: &quot;3143947750&quot;, &quot;start&quot;: 10987579.365100689, &quot;end&quot;: 10987581.035526324, &quot;elapsed&quot;: 1.670425635  }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/TOPOLOGY/scanner_connection_error&quot;, &quot;seed&quot;: &quot;1693182082&quot;, &quot;start&quot;: 10987742.630362888, &quot;end&quot;: 10987742.752703433, &quot;elapsed&quot;: 0.122340545  }
&lt;p&gt;,&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;(gdb) run --no-fork&lt;br/&gt;
...&lt;br/&gt;
    &lt;/p&gt;
{ &quot;status&quot;: &quot;PASS&quot;, &quot;test_file&quot;: &quot;/BulkOperation/upsert_ordered&quot;, &quot;seed&quot;: &quot;2340171206&quot;, &quot;start&quot;: 10987861.810715472, &quot;end&quot;: 10987861.863608857, &quot;elapsed&quot;: 0.052893385  }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;PASS&quot;, &quot;test_file&quot;: &quot;/BulkOperation/upsert_unordered&quot;, &quot;seed&quot;: &quot;4266335484&quot;, &quot;start&quot;: 10987861.863814916, &quot;end&quot;: 10987861.915511878, &quot;elapsed&quot;: 0.051696962  }
&lt;p&gt;,&lt;/p&gt;

&lt;p&gt;0x09000000004dce94 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5_64.o)&lt;br/&gt;
(gdb) where&lt;br/&gt;
#0  0x09000000004dce94 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5_64.o)&lt;br/&gt;
#1  0x09000000004dc6cc in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5_64.o)&lt;br/&gt;
#2  0x090000000002c550 in raise () from /usr/lib/libc.a(shr_64.o)&lt;br/&gt;
#3  0x0900000000082fe8 in abort () from /usr/lib/libc.a(shr_64.o)&lt;br/&gt;
#4  0x0900000001ab18d4 in bson_mem_restore_vtable () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#5  0x0900000001ab1944 in memset () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#6  0x0900000001aa7424 in _bson_data () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#7  0x0900000001aa74f4 in _bson_encode_length () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#8  0x0900000001aa772c in _bson_append () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#9  0x0900000001aa79d4 in _bson_append_bson_begin () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#10 0x0900000001aaad04 in bson_append_timestamp () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#11 0x0900000001ac6148 in jsonsl_enable_all_callbacks () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#12 0x0900000001aca8c8 in _bson_json_read_append_dbpointer () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#13 0x0900000001acd59c in bson_json_reader_new_from_fd () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#14 0x0900000001acadb0 in _bad_extended_json () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#15 0x0900000001acb580 in _bson_json_read_end_map () from /opt/freeware/lib/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#16 0x0000000100080f64 in tmp_bson (json=0xffffffffffff080 &quot;&quot;) at tests/test-conveniences.c:94&lt;br/&gt;
#17 0x00000001000bae70 in test_upsert_unordered_oversized (ctx=0x8) at tests/test-mongoc-bulk.c:585&lt;br/&gt;
#18 0x00000001000855a0 in TestSuite_RunTest (suite=&amp;lt;incomplete type&amp;gt;, test=0x11007ed10, count=0xffffffffffff54c) at tests/TestSuite.c:686&lt;br/&gt;
#19 0x0000000100085f1c in TestSuite_RunSerial (suite=&amp;lt;incomplete type&amp;gt;) at tests/TestSuite.c:951&lt;br/&gt;
#20 0x0000000100086420 in TestSuite_Run (suite=&amp;lt;incomplete type&amp;gt;) at tests/TestSuite.c:1046&lt;br/&gt;
#21 0x000000010000562c in main (argc=2, argv=0xffffffffffff740) at tests/test-libmongoc.c:2179&lt;/p&gt;


&lt;p&gt;&lt;b&gt;libbson bundled within mongoc :&lt;/b&gt;&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;gmake check ----&amp;gt;&amp;gt;   ./test-libbson --threads --no-fork&lt;br/&gt;
...&lt;br/&gt;
   
{ &quot;status&quot;: &quot;PASS&quot;, &quot;test_file&quot;: &quot;/version&quot;, &quot;seed&quot;: &quot;254312888&quot;, &quot;start&quot;: 10984479.058313609, &quot;end&quot;: 10984479.058315300, &quot;elapsed&quot;: 0.000001691 }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;PASS&quot;, &quot;test_file&quot;: &quot;/bson/writer/custom_realloc&quot;, &quot;seed&quot;: &quot;2005447092&quot;, &quot;start&quot;: 10984479.058322513, &quot;end&quot;: 10984479.058329431, &quot;elapsed&quot;: 0.000006918 }
&lt;p&gt;,&lt;br/&gt;
/bin/sh&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;: 24248364 Memory fault(coredump)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;cd ./src/libbson&lt;/li&gt;
	&lt;li&gt;gdb ./.libs/lt-test-libbson core&lt;br/&gt;
Core was generated by `lt-test-libbson&apos;.&lt;br/&gt;
Program terminated with signal SIGSEGV, Segmentation fault.&lt;br/&gt;
#0  0x090000000001057c in calloc_common () from /usr/lib/libc.a(shr_64.o)&lt;br/&gt;
(gdb) where&lt;br/&gt;
#0  0x090000000001057c in calloc_common () from /usr/lib/libc.a(shr_64.o)&lt;br/&gt;
#1  0x09000000019a5bac in bson_string_new () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#2  0x09000000019a7958 in bson_utf8_escape_for_json () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#3  0x090000000199cc4c in _bson_as_json_visit_before () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#4  0x09000000019a3f4c in bson_iter_visit_all () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#5  0x090000000199d290 in _bson_as_json_visit_document () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
...&lt;br/&gt;
#404 0x09000000019a4220 in bson_iter_visit_all () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#405 0x090000000199d680 in _bson_as_json_visit_all () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#406 0x090000000199d818 in bson_as_json () from /opt/freeware/src/packages/BUILD/mongo-c-driver-1.9.4/64bit/src/libbson/.libs/libbson-1.0.a(libbson-1.0.so.0)&lt;br/&gt;
#407 0x000000010002dfa8 in test_bson_as_json_stack_overflow () at tests/test-json.c:671&lt;br/&gt;
#408 0x00000001000010cc in TestSuite_AddHelper (cb_=0x110001f20 &amp;lt;&lt;em&gt;ccl3836H.rw&lt;/em&gt;+4528&amp;gt;) at tests/TestSuite.c:304&lt;br/&gt;
#409 0x00000001000017d0 in TestSuite_RunTest (suite=0xfffffffffffeeb8, test=0x110038770, mutex=0xfffffffffffed38, count=0xfffffffffffed78) at tests/TestSuite.c:481&lt;br/&gt;
#410 0x0000000100001df4 in TestSuite_ParallelWorker (data=0x110057d10) at tests/TestSuite.c:675&lt;br/&gt;
#411 0x09000000004c4d34 in _pthread_body () from /usr/lib/libpthread.a(shr_xpg5_64.o)&lt;br/&gt;
#412 0x0000000000000000 in ?? ()&lt;br/&gt;
(gdb) &lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment>AIX - GCC v6 and v7</environment>
        <key id="526006">CDRIVER-2608</key>
            <summary>libbson and mongoc tests crash in libbson code when using --no-fork</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="13201">Fixed</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="trex58">Tony Reix</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Apr 2018 14:49:39 +0000</created>
                <updated>Sat, 28 Oct 2023 11:29:56 +0000</updated>
                            <resolved>Mon, 30 Apr 2018 23:02:50 +0000</resolved>
                                    <version>1.9.3</version>
                    <version>1.9.4</version>
                                    <fixVersion>1.10.0</fixVersion>
                                    <component>libbson</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1879912" author="xgen-internal-githook" created="Wed, 2 May 2018 02:33:07 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2608&quot; title=&quot;libbson and mongoc tests crash in libbson code when using --no-fork&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2608&quot;&gt;&lt;del&gt;CDRIVER-2608&lt;/del&gt;&lt;/a&gt; proper int64_t format in cursor test&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/12f957adcdb40ef6ff0460307a174ab94ee80143&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/12f957adcdb40ef6ff0460307a174ab94ee80143&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1879911" author="xgen-internal-githook" created="Wed, 2 May 2018 02:33:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2608&quot; title=&quot;libbson and mongoc tests crash in libbson code when using --no-fork&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2608&quot;&gt;&lt;del&gt;CDRIVER-2608&lt;/del&gt;&lt;/a&gt; get CPU count on AIX&lt;/p&gt;

&lt;p&gt;Patch by Tony Reix.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/d52b3d380c31dcea195665af2d59a45a6281ccba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/d52b3d380c31dcea195665af2d59a45a6281ccba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1879910" author="xgen-internal-githook" created="Wed, 2 May 2018 02:33:04 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2608&quot; title=&quot;libbson and mongoc tests crash in libbson code when using --no-fork&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2608&quot;&gt;&lt;del&gt;CDRIVER-2608&lt;/del&gt;&lt;/a&gt; print errno if malloc fails&lt;/p&gt;

&lt;p&gt;Patch by Tony Reix.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e1dd64038c886028a0aa0abea6f2e908f2c74c9d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e1dd64038c886028a0aa0abea6f2e908f2c74c9d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1872514" author="trex58" created="Tue, 24 Apr 2018 13:57:44 +0000"  >&lt;p&gt;I have understood the failures/cores in libbson tests on AIX.&lt;/p&gt;

&lt;p&gt;libbson tests are launched as:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;$BUILD/libbson-1.9.4/64bit/.libs/lt-test-libbson --threads --no-fork&lt;br/&gt;
which implies the use of threads.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;When running all tests, there is a deep recursivity within the 3 routines:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;_bson_iter_validate_document()&lt;/li&gt;
	&lt;li&gt;unnamed block in bson_iter_visit_all()&lt;/li&gt;
	&lt;li&gt;bson_iter_visit_all()&lt;br/&gt;
which is greater than 39 times and which consumes the stack of threads and generates a weird and random core on AIX.&lt;br/&gt;
This is due to the fact that thread stack on AIX is smaller than on Linux.&lt;br/&gt;
This can be fixed by using:&lt;br/&gt;
     export AIXTHREAD_STK=500000&lt;br/&gt;
before &quot;make check&quot;.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="1869835" author="trex58" created="Fri, 20 Apr 2018 10:06:03 +0000"  >&lt;p&gt;Hi Jesse,&lt;/p&gt;

&lt;p&gt;Thanks. I&apos;ll see how to submit the patch as a GitHub pull request.&lt;/p&gt;

&lt;p&gt;About the SKIP tests, there is code inside mongoc that SKIPs tests when in 32-bit:&lt;br/&gt;
tests/TestSuite.c :&lt;br/&gt;
+322  TestSuite_CheckMockServerAllowed (void)&lt;br/&gt;
 +323  {&lt;br/&gt;
 +324     if (test_framework_getenv_bool (&quot;MONGOC_TEST_SKIP_MOCK&quot;)) &lt;/p&gt;
{
 +325        return 0;
 +326     }
&lt;p&gt; +327&lt;br/&gt;
 +328     /* &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2115&quot; title=&quot;Rare mock server test failures on 32-bit&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2115&quot;&gt;&lt;del&gt;CDRIVER-2115&lt;/del&gt;&lt;/a&gt;: don&apos;t run mock server tests on 32-bit */&lt;br/&gt;
 +329     if (sizeof (void *) * 8 &amp;gt;= 64) &lt;/p&gt;
{
 +330        return 1;
 +331     }
&lt;p&gt; else &lt;/p&gt;
{
 +332        return 0;
 +333     }
&lt;p&gt; +334  }&lt;br/&gt;
So, that&apos;s clear.&lt;/p&gt;

&lt;p&gt;Now, I&apos;m studying crashes/failure in libbson tests:&lt;br/&gt;
   .libs/lt-test-libbson --threads&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/bson/build_child_deep&quot;, &quot;seed&quot;: &quot;3410243516&quot;, &quot;start&quot;: 341376.489854771, &quot;end&quot;: 341376.665947314, &quot;elapsed&quot;: 0.176092543 }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/bson/build_child_deep_no_begin_end&quot;, &quot;seed&quot;: &quot;826262263&quot;, &quot;start&quot;: 341376.780130335, &quot;end&quot;: 341376.830185728, &quot;elapsed&quot;: 0.050055393 }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/bson/as_json/stack_overflow&quot;, &quot;seed&quot;: &quot;3556647355&quot;, &quot;start&quot;: 341380.684710419, &quot;end&quot;: 341380.851321964, &quot;elapsed&quot;: 0.166611545 }
&lt;p&gt;,&lt;br/&gt;
   &lt;/p&gt;
{ &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/bson/validate&quot;, &quot;seed&quot;: &quot;2735287847&quot;, &quot;start&quot;: 341384.921330023, &quot;end&quot;: 341384.958589664, &quot;elapsed&quot;: 0.037259641 }
&lt;p&gt;,&lt;/p&gt;

&lt;p&gt;They do not appear on Linux/PPC64LE nor Linux/x86_64. Only on AIX. Investigating.&lt;/p&gt;
</comment>
                            <comment id="1866742" author="jesse" created="Tue, 17 Apr 2018 18:41:19 +0000"  >&lt;p&gt;I think your patch looks good to me, thanks. Would you mind submitting it as a GitHub pull request?&lt;/p&gt;

&lt;p&gt;Regarding all the skipped tests, you can search for those test names and see the skip criteria for each. For example, /Topology/compatible_null_error_pointer is skipped if the environment variable MONGOC_TEST_SKIP_SLOW is set to &quot;on&quot;. &lt;/p&gt;</comment>
                            <comment id="1866449" author="trex58" created="Tue, 17 Apr 2018 15:38:35 +0000"  >&lt;p&gt;OK. The FAILure &quot; test_topology_scanner_connection_error()&quot; is due to AIX generating a different error message. Fixed. Now, it passes.&lt;/p&gt;

&lt;p&gt;So, results on AIX are:&lt;br/&gt;
PASS : 575&lt;br/&gt;
SKIP : 343     Why so many ?!!&lt;br/&gt;
FAIL :   0&lt;/p&gt;

&lt;p&gt;On Linux/PPC64LE with mongoc/libbson 1.9.4, I have:&lt;br/&gt;
 PASS : 820&lt;br/&gt;
 SKIP : 101&lt;br/&gt;
 FAIL :   0&lt;/p&gt;

&lt;p&gt;So, there are 242 more SKIPped tests on AIX compared to Linux/Power. Why so many ?&lt;/p&gt;

&lt;p&gt;Examples of tests skipped on AIX and not on Linux/PPC64LE :&lt;br/&gt;
/Async/ismaster&lt;br/&gt;
/Async/ismaster_ssl&lt;br/&gt;
/change_stream/pipeline&lt;br/&gt;
/change_stream/resumable_error&lt;br/&gt;
/change_stream/nonresumable_error&lt;br/&gt;
/change_stream/options&lt;br/&gt;
/Client/command_w_server_id&lt;br/&gt;
/Client/command_w_server_id/sharded&lt;br/&gt;
/Client/unavailable_seeds&lt;br/&gt;
/Client/rs_seeds_no_connect/single&lt;br/&gt;
/Client/rs_seeds_no_connect/pooled&lt;br/&gt;
/Client/mongos_seeds_no_connect/single&lt;br/&gt;
/Client/database_names&lt;br/&gt;
/Client/mismatched_me&lt;br/&gt;
/Client/handshake/pool&lt;br/&gt;
/Client/appname_single_uri&lt;br/&gt;
/Client/wire_version&lt;br/&gt;
/Client/ssl_opts/copies_single&lt;br/&gt;
/Client/select_server/retry/succeed&lt;br/&gt;
/Client/fetch_stream/retry/succeed&lt;br/&gt;
/Client/max_staleness/mongos&lt;br/&gt;
/BulkOperation/error&lt;br/&gt;
/BulkOperation/error/unordered&lt;br/&gt;
/BulkOperation/write_concern/write_command/ordered&lt;br/&gt;
/BulkOperation/wtimeout_duplicate_key/write_commands&lt;br/&gt;
/BulkOperation/hint/single/command/secondary&lt;br/&gt;
/BulkOperation/opts/collation/w0/wire5&lt;br/&gt;
/Cluster/cluster_time/query/&lt;br/&gt;
/Cluster/cluster_time/dollar_query/from_user&lt;br/&gt;
/Cluster/command/timeout/single&lt;br/&gt;
/Cluster/cluster_time/comparison/single&lt;br/&gt;
/Cluster/not_master/single/op_query&lt;br/&gt;
/Cluster/ismaster_fails&lt;br/&gt;
/Collection/insert/keys&lt;br/&gt;
/Collection/index/collation/wire4&lt;br/&gt;
/Collection/count_with_opts&lt;br/&gt;
/Collection/aggregate/inherit/collection&lt;br/&gt;
/Collection/stats/read_pref&lt;br/&gt;
/Collection/find_read_concern&lt;br/&gt;
/Collection/limit&lt;br/&gt;
/Collection/batch_size&lt;br/&gt;
/Collection/find_indexes/error&lt;br/&gt;
/Collection/getmore/batch_size&lt;br/&gt;
/Collection/find_with_opts/dollar_or&lt;br/&gt;
/command_monitoring/get_error&lt;br/&gt;
/Cursor/kill/single&lt;br/&gt;
/Cursor/client_kill_cursor/with_primary&lt;br/&gt;
/Cursor/new_tailable_await&lt;br/&gt;
/Cursor/new_ignores_fields&lt;br/&gt;
/Cursor/hint/single/secondary&lt;br/&gt;
/Cursor/n_return/find_cmd&lt;br/&gt;
/Database/command/read_prefs/simple/single&lt;br/&gt;
/Database/get_collection/getmore_cmd&lt;br/&gt;
/Error/command/default&lt;br/&gt;
/Error/command/v1&lt;br/&gt;
/Error/command/v2&lt;br/&gt;
/Client/exhaust_cursor/err/network/1st_batch/single&lt;br/&gt;
/find_and_modify/find_and_modify/bypass/true&lt;br/&gt;
/find_and_modify/opts&lt;br/&gt;
/find_and_modify/collation/ok&lt;br/&gt;
/GridFS/find_one_with_opts/limit&lt;br/&gt;
/MongoDB/handshake/success&lt;br/&gt;
/ReadPrefs/standalone/null&lt;br/&gt;
/ReadPrefs/rsprimary/primary&lt;br/&gt;
/ReadPrefs/rssecondary/secondary&lt;br/&gt;
/ReadPrefs/mongos/null&lt;br/&gt;
/ReadPrefs/OP_MSG/secondary&lt;br/&gt;
/retryable_writes/failover&lt;br/&gt;
/TOPOLOGY/scanner&lt;br/&gt;
/TOPOLOGY/blocking_initiator&lt;br/&gt;
/server_discovery_and_monitoring/monitoring/heartbeat/single/succeeded&lt;br/&gt;
/Session/end/mock/single&lt;br/&gt;
/Topology/connect_timeout/succeed&lt;br/&gt;
/Topology/try_once/succeed&lt;br/&gt;
/Topology/server_removed/single&lt;br/&gt;
/Topology/add_and_scan_failure&lt;br/&gt;
/Topology/ismaster_retry/single/hangup&lt;br/&gt;
/Topology/incompatible_error&lt;br/&gt;
/Topology/compatible_null_error_pointer&lt;/p&gt;
</comment>
                            <comment id="1866292" author="trex58" created="Tue, 17 Apr 2018 14:02:27 +0000"  >&lt;p&gt;Now, I have the following tests which fails:&lt;br/&gt;
    ./test-libmongoc --no-fork -d -t -f -l /TOPOLOGY/scanner_connection_error&lt;br/&gt;
generating :&lt;/p&gt;

&lt;p&gt;2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: ENTRY: mongoc_topology_description_init():75&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc:  EXIT: mongoc_topology_description_init():94&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: ENTRY: mongoc_server_description_init():104&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc:  EXIT: mongoc_server_description_init():123&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:      cluster: ENTRY: mongoc_cluster_init():1871&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:      cluster:  EXIT: mongoc_cluster_init():1898&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       client: ENTRY: mongoc_client_command_simple():1634&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:      cluster: ENTRY: _mongoc_cluster_stream_for_optype():1963&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: ENTRY: mongoc_topology_description_select():798&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: TRACE: mongoc_topology_description_select():807 Topology type single, &lt;span class=&quot;error&quot;&gt;&amp;#91;localhost:9876&amp;#93;&lt;/span&gt; is down&lt;br/&gt;
2018/04/17 15:49:37.0139: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc:  EXIT: mongoc_topology_description_select():808&lt;br/&gt;
2018/04/17 15:49:37.0140: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE: topology_scanner: ENTRY: mongoc_topology_scanner_node_connect_tcp():468&lt;br/&gt;
2018/04/17 15:49:37.0140: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: mongoc_socket_new():977&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: _mongoc_socket_setnodelay():556&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: _mongoc_socket_setnodelay():568&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: _mongoc_socket_setkeepalive():521&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_setkeepalive():525 Setting SO_KEEPALIVE&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_set_sockopt_if_less():468 &apos;TCP_KEEPIDLE&apos; is 7200, target value is 300&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_set_sockopt_if_less():479 &apos;TCP_KEEPIDLE&apos; value changed to 300&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_set_sockopt_if_less():468 &apos;TCP_KEEPINTVL&apos; is 75, target value is 10&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_set_sockopt_if_less():479 &apos;TCP_KEEPINTVL&apos; value changed to 10&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_set_sockopt_if_less():468 &apos;TCP_KEEPCNT&apos; is 8, target value is 9&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: _mongoc_socket_setkeepalive():537&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: mongoc_socket_new():1009&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: mongoc_socket_connect():840&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_capture_errno():68 setting errno: 79 Connection refused&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_errno_is_again():617 errno is: 79&lt;br/&gt;
2018/04/17 15:49:37.0141: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: mongoc_socket_connect():872&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: ENTRY: _mongoc_stream_socket_poll():223&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: mongoc_socket_poll():283&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream:  EXIT: _mongoc_stream_socket_poll():249&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: ENTRY: mongoc_stream_writev():150&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: TRACE: mongoc_stream_writev():162 writev = 200a58c8 &lt;span class=&quot;error&quot;&gt;&amp;#91;9&amp;#93;&lt;/span&gt;&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00000:  bb 01 00 00 01 00 00 00  00 00 00 00 d4 07 00 00  . . . . . . . .  . . . . . . . .&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00010:  04 00 00 00 61 64 6d 69  6e 2e 24 63 6d 64 00 00  . . . . a d m i  n . $ c m d . .&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00020:  00 00 00 ff ff ff ff 94  01 00 00 10 69 73 4d 61  . . . . . . . .  . . . . i s M a&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00030:  73 74 65 72 00 01 00 00  00 03 63 6c 69 65 6e 74  s t e r . . . .  . . c l i e n t&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00040:  00 67 01 00 00 03 64 72  69 76 65 72 00 29 00 00  . g . . . . d r  i v e r . ) . .&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00050:  00 02 6e 61 6d 65 00 07  00 00 00 6d 6f 6e 67 6f  . . n a m e . .  . . . m o n g o&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00060:  63 00 02 76 65 72 73 69  6f 6e 00 06 00 00 00 31  c . . v e r s i  o n . . . . . 1&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00070:  2e 39 2e 34 00 00 03 6f  73 00 50 00 00 00 02 74  . 9 . 4 . . . o  s . P . . . . t&lt;br/&gt;
2018/04/17 15:49:37.0142: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00080:  79 70 65 00 05 00 00 00  55 6e 69 78 00 02 6e 61  y p e . . . . .  U n i x . . n a&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00090:  6d 65 00 04 00 00 00 41  49 58 00 02 76 65 72 73  m e . . . . . A  I X . . v e r s&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 000a0:  69 6f 6e 00 02 00 00 00  31 00 02 61 72 63 68 69  i o n . . . . .  1 . . a r c h i&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 000b0:  74 65 63 74 75 72 65 00  0d 00 00 00 30 30 46 39  t e c t u r e .  . . . . 0 0 F 9&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 000c0:  46 44 34 42 34 43 30 30  00 00 02 70 6c 61 74 66  F D 4 B 4 C 0 0  . . . p l a t f&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 000d0:  6f 72 6d 00 cf 00 00 00  63 66 67 3d 30 78 31 65  o r m . . . . .  c f g = 0 x 1 e&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 000e0:  33 30 64 39 20 70 6f 73  69 78 3d 32 30 30 31 31  3 0 d 9   p o s  i x = 2 0 0 1 1&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 000f0:  32 20 73 74 64 63 3d 32  30 31 31 31 32 20 43 43  2   s t d c = 2  0 1 1 1 2   C C&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00100:  3d 47 43 43 20 37 2e 31  2e 30 20 43 46 4c 41 47  = G C C   7 . 1  . 0   C F L A G&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00110:  53 3d 22 2d 49 2f 75 73  72 2f 69 6e 63 6c 75 64  S = &quot; - I / u s  r / i n c l u d&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00120:  65 20 2d 49 2f 6f 70 74  2f 66 72 65 65 77 61 72  e   - I / o p t  / f r e e w a r&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00130:  65 2f 69 6e 63 6c 75 64  65 22 20 4c 44 46 4c 41  e / i n c l u d  e &quot;   L D F L A&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00140:  47 53 3d 22 2d 4c 2f 6f  70 74 2f 66 72 65 65 77  G S = &quot; - L / o  p t / f r e e w&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00150:  61 72 65 2f 6c 69 62 20  2d 57 6c 2c 2d 62 6c 69  a r e / l i b    - W l , - b l i&lt;br/&gt;
2018/04/17 15:49:37.0143: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00160:  62 70 61 74 68 3a 2f 6f  70 74 2f 66 72 65 65 77  b p a t h : / o  p t / f r e e w&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00170:  61 72 65 2f 6c 69 62 3a  2f 75 73 72 2f 6c 69 62  a r e / l i b :  / u s r / l i b&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00180:  3a 2f 6c 69 62 20 20 20  20 20 20 20 20 20 20 20  : / l i b                       &lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 00190:  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2d                                 -&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 001a0:  6c 69 6e 74 6c 22 00 00  04 63 6f 6d 70 72 65 73  l i n t l &quot; . .  . c o m p r e s&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: 001b0:  73 69 6f 6e 00 05 00 00  00 00 00                 s i o n . . . .  . . .&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: ENTRY: _mongoc_stream_socket_writev():199&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: mongoc_socket_sendv():1351&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: _mongoc_socket_try_sendv():1256&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_try_sendv():1262 sendbuf = 200a51c8 &lt;span class=&quot;error&quot;&gt;&amp;#91;9&amp;#93;&lt;/span&gt;&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00000:  bb 01 00 00 01 00 00 00  00 00 00 00 d4 07 00 00  . . . . . . . .  . . . . . . . .&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00010:  04 00 00 00 61 64 6d 69  6e 2e 24 63 6d 64 00 00  . . . . a d m i  n . $ c m d . .&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00020:  00 00 00 ff ff ff ff 94  01 00 00 10 69 73 4d 61  . . . . . . . .  . . . . i s M a&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00030:  73 74 65 72 00 01 00 00  00 03 63 6c 69 65 6e 74  s t e r . . . .  . . c l i e n t&lt;br/&gt;
2018/04/17 15:49:37.0144: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00040:  00 67 01 00 00 03 64 72  69 76 65 72 00 29 00 00  . g . . . . d r  i v e r . ) . .&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00050:  00 02 6e 61 6d 65 00 07  00 00 00 6d 6f 6e 67 6f  . . n a m e . .  . . . m o n g o&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00060:  63 00 02 76 65 72 73 69  6f 6e 00 06 00 00 00 31  c . . v e r s i  o n . . . . . 1&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00070:  2e 39 2e 34 00 00 03 6f  73 00 50 00 00 00 02 74  . 9 . 4 . . . o  s . P . . . . t&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00080:  79 70 65 00 05 00 00 00  55 6e 69 78 00 02 6e 61  y p e . . . . .  U n i x . . n a&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00090:  6d 65 00 04 00 00 00 41  49 58 00 02 76 65 72 73  m e . . . . . A  I X . . v e r s&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 000a0:  69 6f 6e 00 02 00 00 00  31 00 02 61 72 63 68 69  i o n . . . . .  1 . . a r c h i&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 000b0:  74 65 63 74 75 72 65 00  0d 00 00 00 30 30 46 39  t e c t u r e .  . . . . 0 0 F 9&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 000c0:  46 44 34 42 34 43 30 30  00 00 02 70 6c 61 74 66  F D 4 B 4 C 0 0  . . . p l a t f&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 000d0:  6f 72 6d 00 cf 00 00 00  63 66 67 3d 30 78 31 65  o r m . . . . .  c f g = 0 x 1 e&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 000e0:  33 30 64 39 20 70 6f 73  69 78 3d 32 30 30 31 31  3 0 d 9   p o s  i x = 2 0 0 1 1&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 000f0:  32 20 73 74 64 63 3d 32  30 31 31 31 32 20 43 43  2   s t d c = 2  0 1 1 1 2   C C&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00100:  3d 47 43 43 20 37 2e 31  2e 30 20 43 46 4c 41 47  = G C C   7 . 1  . 0   C F L A G&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00110:  53 3d 22 2d 49 2f 75 73  72 2f 69 6e 63 6c 75 64  S = &quot; - I / u s  r / i n c l u d&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00120:  65 20 2d 49 2f 6f 70 74  2f 66 72 65 65 77 61 72  e   - I / o p t  / f r e e w a r&lt;br/&gt;
2018/04/17 15:49:37.0145: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00130:  65 2f 69 6e 63 6c 75 64  65 22 20 4c 44 46 4c 41  e / i n c l u d  e &quot;   L D F L A&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00140:  47 53 3d 22 2d 4c 2f 6f  70 74 2f 66 72 65 65 77  G S = &quot; - L / o  p t / f r e e w&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00150:  61 72 65 2f 6c 69 62 20  2d 57 6c 2c 2d 62 6c 69  a r e / l i b    - W l , - b l i&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00160:  62 70 61 74 68 3a 2f 6f  70 74 2f 66 72 65 65 77  b p a t h : / o  p t / f r e e w&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00170:  61 72 65 2f 6c 69 62 3a  2f 75 73 72 2f 6c 69 62  a r e / l i b :  / u s r / l i b&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00180:  3a 2f 6c 69 62 20 20 20  20 20 20 20 20 20 20 20  : / l i b                       &lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 00190:  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2d                                 -&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 001a0:  6c 69 6e 74 6c 22 00 00  04 63 6f 6d 70 72 65 73  l i n t l &quot; . .  . c o m p r e s&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: 001b0:  73 69 6f 6e 00 05 00 00  00 00 00                 s i o n . . . .  . . .&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_try_sendv():1282 Send -1 out of 4 bytes&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_capture_errno():68 setting errno: 32 Broken pipe&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: mongoc_socket_errno():592 Current errno: 32&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: _mongoc_socket_try_sendv():1306&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: mongoc_socket_sendv():1363 Sent -1 (of 4) out of iovcnt=9&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: _mongoc_socket_errno_is_again():617 errno is: 32&lt;br/&gt;
2018/04/17 15:49:37.0146: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  GOTO: mongoc_socket_sendv():1373 CLEANUP&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: mongoc_socket_sendv():1431&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: TRACE: mongoc_socket_errno():592 Current errno: 32&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream:  EXIT: _mongoc_stream_socket_writev():205&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream:  EXIT: mongoc_stream_writev():165&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: ENTRY: mongoc_stream_failed():80&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: ENTRY: _mongoc_stream_socket_failed():89&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream: ENTRY: _mongoc_stream_socket_destroy():71&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket: ENTRY: mongoc_socket_close():770&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       socket:  EXIT: mongoc_socket_close():805&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream:  EXIT: _mongoc_stream_socket_destroy():82&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream:  EXIT: _mongoc_stream_socket_failed():93&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       stream:  EXIT: mongoc_stream_failed():90&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: ENTRY: mongoc_server_description_handle_ismaster():493&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc:  EXIT: mongoc_server_description_handle_ismaster():500&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: TRACE: mongoc_topology_description_handle_ismaster():1955 No transition entry to Single for Unknown&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: ENTRY: mongoc_topology_description_select():798&lt;br/&gt;
2018/04/17 15:49:37.0147: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc: TRACE: mongoc_topology_description_select():807 Topology type single, &lt;span class=&quot;error&quot;&gt;&amp;#91;localhost:9876&amp;#93;&lt;/span&gt; is down&lt;br/&gt;
2018/04/17 15:49:37.0148: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       mongoc:  EXIT: mongoc_topology_description_select():808&lt;br/&gt;
2018/04/17 15:49:37.0148: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:      cluster:  EXIT: _mongoc_cluster_stream_for_optype():1971&lt;br/&gt;
2018/04/17 15:49:37.0148: &lt;span class=&quot;error&quot;&gt;&amp;#91;7733382&amp;#93;&lt;/span&gt;:    TRACE:       client:  EXIT: mongoc_client_command_simple():1670&lt;br/&gt;
tests/test-mongoc-topology-scanner.c:304 test_topology_scanner_connection_error(): [No suitable servers found (`serverSelectionTryOnce` set): &lt;span class=&quot;error&quot;&gt;&amp;#91;Failed to write rpc bytes. calling ismaster on &amp;#39;localhost:9876&amp;#39;&amp;#93;&lt;/span&gt;] does not contain &lt;span class=&quot;error&quot;&gt;&amp;#91;connection refused calling ismaster on &amp;#39;localhost:9876&amp;#39;&amp;#93;&lt;/span&gt;&lt;br/&gt;
IOT/Abort trap (core dumped)&lt;/p&gt;

&lt;p&gt;(gdb) where&lt;br/&gt;
#0  0xd051ceb4 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)&lt;br/&gt;
#1  0xd051c2ec in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5.o)&lt;br/&gt;
#2  0xd011f904 in raise () from /usr/lib/libc.a(shr.o)&lt;br/&gt;
#3  0xd01aeee8 in abort () from /usr/lib/libc.a(shr.o)&lt;br/&gt;
#4  0x10131d04 in test_topology_scanner_connection_error ()&lt;br/&gt;
#5  0x10088a54 in TestSuite_AddHelper ()&lt;br/&gt;
#6  0x10089590 in TestSuite_RunTest ()&lt;br/&gt;
#7  0x1008a264 in TestSuite_RunNamed ()&lt;br/&gt;
#8  0x1008a3dc in TestSuite_Run ()&lt;br/&gt;
#9  0x100058f4 in main (argc=268435940, argv=0x0) at /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/7.1.0/include-fixed/math.h:603&lt;/p&gt;</comment>
                            <comment id="1866283" author="trex58" created="Tue, 17 Apr 2018 13:57:11 +0000"  >&lt;p&gt;Hummm I think that it is also an issue in the bson/bson-memory.c code since the &quot;errno&quot; value should be printed with a switch() based on the possible values in order to help the work of people trying to understand what is happening.&lt;br/&gt;
Here is a candidate patch.&lt;/p&gt;</comment>
                            <comment id="1863501" author="jesse" created="Fri, 13 Apr 2018 13:39:09 +0000"  >&lt;p&gt;Thanks for investigating! Looks like some of those tests that allocate huge strings run out of memory, or at least can&apos;t allocate a 16MB contiguous block. That&apos;s not anything the driver can or should do something about, it&apos;s a problem with the tests.&lt;/p&gt;</comment>
                            <comment id="1863363" author="trex58" created="Fri, 13 Apr 2018 09:32:37 +0000"  >&lt;p&gt;Jump to the end in order to read the solution.&lt;/p&gt;

&lt;p&gt;IFF the gdb debugger I&apos;m using now works fine, there are no allocation greater than 1 million.&lt;br/&gt;
I&apos;ve used:   break 66 if ret-&amp;gt;len &amp;gt; 1000000  and it never stopped.&lt;br/&gt;
I&apos;ve looked to the value of ret-&amp;gt;len from the beg, and the biggest I&apos;ve seen is: 31. However gdb crashed before the end of the test...&lt;br/&gt;
A printf() added to bson_string_new() confirms: only several 1 value and one 32 value for ret-&amp;gt;alloc .&lt;/p&gt;

&lt;p&gt;I have now line numbers for libbson too:&lt;br/&gt;
#4  0x10006a6c in bson_realloc (mem=0x0, num_bytes=16777216) at src/bson/bson-memory.c:153&lt;br/&gt;
#5  0x10006adc in bson_realloc_ctx (mem=0x200a7548, num_bytes=16777216, ctx=0x0) at src/bson/bson-memory.c:189&lt;br/&gt;
#6  0x10023144 in _bson_impl_alloc_grow (impl=0x10023204 &amp;lt;_bson_grow+80&amp;gt;, size=4034316480) at src/bson/bson.c:187&lt;br/&gt;
#7  0x10023204 in _bson_grow (bson=0x250ae868, size=16777188) at src/bson/bson.c:221&lt;br/&gt;
#8  0x10023418 in _bson_append_va (bson=0x10023698 &amp;lt;_bson_append+340&amp;gt;, n_bytes=804395264, n_pairs=638291088, first_len=16837856, first_data=0x250ae868 &quot;&quot;, &lt;br/&gt;
    args=0xffffe4 &amp;lt;error: Cannot access memory at address 0xffffe4&amp;gt;) at src/bson/bson.c:325&lt;br/&gt;
#9  0x10023698 in _bson_append (bson=0x100267c0 &amp;lt;bson_append_utf8+436&amp;gt;, n_pairs=16, n_bytes=4034768808, first_len=3490783808, first_data=0x250ae868 &quot;&quot;) at src/bson/bson.c:404&lt;br/&gt;
#10 0x100267c0 in bson_append_utf8 (bson=0x100abd88 &amp;lt;_bson_json_read_string+376&amp;gt;, key=0x0, key_length=638291096, value=0x0, length=621471848) at src/bson/bson.c:1619&lt;br/&gt;
#11 0x100abd88 in _bson_json_read_string (reader=0x100b04b8 &amp;lt;_pop_callback+380&amp;gt;, val=0x2ff21a40 &quot;/\362\032\240\336\255\276\357%\n\345\350&amp;amp;\v\214\230&quot;, vlen=804395680)&lt;br/&gt;
    at src/bson/bson-json.c:893&lt;br/&gt;
#12 0x100b04b8 in &lt;em&gt;pop_callback (json=0x100b3194 &amp;lt;jsonsl_feed+4592&amp;gt;, action=4034803896, state=0xdeadbeef, buf=0x20008ebc &amp;lt;&lt;/em&gt;_dbargs+24144&amp;gt; &quot;&quot;) at src/bson/bson-json.c:1915&lt;br/&gt;
#13 0x100b3194 in jsonsl_feed (jsn=0x5, bytes=0x2ff228dc &quot;/\362)\260/\362)\301/\362)\313/\362)\316/\362)\321&quot;, nbytes=804399348) at src/jsonsl/jsonsl.c:539&lt;br/&gt;
#14 0x100b098c in bson_json_reader_read (reader=0x100b115c &amp;lt;bson_new_from_json+200&amp;gt;, bson=0x0, error=0x0) at src/bson/bson-json.c:2053&lt;br/&gt;
#15 0x100b115c in bson_new_from_json (data=0x100a67d8 &amp;lt;tmp_bson+132&amp;gt; &quot;`&quot;, len=537074992, error=0x2ff21ec0) at src/bson/bson-json.c:2229&lt;br/&gt;
#16 0x100a67d8 in tmp_bson (json=0x100eeb58 &amp;lt;test_upsert_unordered_oversized+236&amp;gt; &quot;`&quot;) at tests/test-conveniences.c:94&lt;br/&gt;
#17 0x100eeb58 in test_upsert_unordered_oversized (ctx=0x100b8900 &amp;lt;TestSuite_RunTest+584&amp;gt;) at tests/test-mongoc-bulk.c:585&lt;br/&gt;
#18 0x100b8900 in TestSuite_RunTest (suite=0x100b95d4 &amp;lt;TestSuite_RunNamed+316&amp;gt;, test=0x2ff22784, count=0x2ff22780) at tests/TestSuite.c:686&lt;br/&gt;
#19 0x100b95d4 in TestSuite_RunNamed (suite=0x100b974c &amp;lt;TestSuite_Run+188&amp;gt;, testname=0x200039dc &amp;lt;__dbargs+2416&amp;gt; &quot;\020\v|\274 &quot;) at tests/TestSuite.c:1007&lt;br/&gt;
#20 0x100b974c in TestSuite_Run (suite=0x100058f4 &amp;lt;main+1112&amp;gt;) at tests/TestSuite.c:1044&lt;br/&gt;
#21 0x100058f4 in main (argc=268435940, argv=0x0) at tests/test-libmongoc.c:2179&lt;/p&gt;

&lt;p&gt;bson_realloc (mem=0x0 ..)  !!!&lt;br/&gt;
bson_realloc_ctx(... ctx=0x0)    @ctx: Ignored&lt;/p&gt;

&lt;p&gt;src/bson/bson-memory.c&lt;/p&gt;

&lt;p&gt;The issue appears to be in the call to gMemVtable.realloc() from bson_realloc()&lt;/p&gt;

&lt;p&gt;void *&lt;br/&gt;
bson_realloc (void &lt;b&gt;mem,        /&lt;/b&gt; IN */&lt;br/&gt;
              size_t num_bytes) /* IN */&lt;br/&gt;
{&lt;br/&gt;
printf(&quot;bson_realloc: mem: %p - num_bytes: %d\n&quot;, mem, num_bytes);&lt;br/&gt;
   /*&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Not all platforms are guaranteed to free() the memory if a call to&lt;/li&gt;
	&lt;li&gt;realloc() with a size of zero occurs. Windows, Linux, and FreeBSD do,&lt;/li&gt;
	&lt;li&gt;however, OS X does not.&lt;br/&gt;
    */&lt;br/&gt;
   if (BSON_UNLIKELY (num_bytes == 0)) 
{
      gMemVtable.free (mem);
      return NULL;
   }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;   mem = gMemVtable.realloc (mem, num_bytes);&lt;br/&gt;
printf(&quot;bson_realloc: after gMemVtable.realloc: mem: %p - num_bytes: %d\n&quot;, mem, num_bytes);&lt;/p&gt;


&lt;p&gt;Here are the traces:&lt;/p&gt;

&lt;p&gt;bson_string_new: ret-&amp;gt;alloc: 1&lt;br/&gt;
Begin /BulkOperation/upsert_unordered_oversized, seed 809807955&lt;br/&gt;
bson_string_new: ret-&amp;gt;alloc: 30&lt;br/&gt;
bson_string_new: power of two: ret-&amp;gt;alloc: 32&lt;br/&gt;
bson_realloc: mem: 200a6d48 - num_bytes: 64&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 200a6d48 - num_bytes: 64&lt;br/&gt;
bson_string_new: ret-&amp;gt;alloc: 1&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 2&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 2&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 4&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 4&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 8&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 8&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 16&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 200a7428 - num_bytes: 16&lt;br/&gt;
bson_string_new: ret-&amp;gt;alloc: 1&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 2&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 2&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 4&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 4&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 8&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 8&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 16&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 200a7428 - num_bytes: 16&lt;br/&gt;
bson_string_new: ret-&amp;gt;alloc: 1&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 2&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 2&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 4&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 4&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 8&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 20026fe8 - num_bytes: 8&lt;br/&gt;
bson_realloc: mem: 20026fe8 - num_bytes: 16&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 200a6d78 - num_bytes: 16&lt;br/&gt;
bson_string_new: ret-&amp;gt;alloc: 1&lt;br/&gt;
bson_string_new: ret-&amp;gt;alloc: 1&lt;br/&gt;
bson_realloc: mem: 2002ac98 - num_bytes: 2&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 2002ac98 - num_bytes: 2&lt;br/&gt;
bson_realloc: mem: 2002ac98 - num_bytes: 4&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 2002ac98 - num_bytes: 4&lt;br/&gt;
bson_realloc: mem: 2002ac98 - num_bytes: 8&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 2002ac98 - num_bytes: 8&lt;br/&gt;
bson_realloc: mem: 200a6cf8 - num_bytes: 37&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 200a6cf8 - num_bytes: 37&lt;br/&gt;
bson_realloc: mem: 200a7618 - num_bytes: 33554389&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 210ae7a8 - num_bytes: 33554389&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 32768&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 32768&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 65536&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 65536&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 131072&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 131072&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 262144&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 262144&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 524288&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 524288&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 1048576&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 1048576&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 2097152&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 2097152&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 4194304&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 4194304&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 8388608&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 8388608&lt;br/&gt;
bson_realloc: mem: 250b8e08 - num_bytes: 16777216&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 250b8e08 - num_bytes: 16777216&lt;br/&gt;
bson_realloc_ctx: mem: 200a76c8 - num_bytes: 16777216&lt;br/&gt;
bson_realloc: mem: 200a76c8 - num_bytes: 16777216&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 0 - num_bytes: 16777216&lt;/p&gt;

&lt;p&gt;Under gdb, 0x200a76c8 is a valid address.&lt;br/&gt;
And &quot;man realloc&quot; says:&lt;br/&gt;
    The Pointer must point to an address returned by a malloc subsystem allocation routine, and must not have been previously deallocated. Undefined results occur if Pointer does not meet these criteria.&lt;/p&gt;

&lt;p&gt;I&apos;ve added traces for all alloc, alloc0, realloc, free routines of libbson, and I get for the new address 200a7748 that now makes gMemVtable.realloc() return:  mem: 0:&lt;/p&gt;

&lt;p&gt;bson_malloc: mem: 200a7748 - num_bytes: 128&lt;br/&gt;
bson_realloc_ctx: mem: 200a7748 - num_bytes: 16777216&lt;br/&gt;
bson_realloc: mem: 200a7748 - num_bytes: 16777216&lt;/p&gt;

&lt;p&gt;&lt;b&gt;OK. I&apos;ve understood.&lt;/b&gt;&lt;br/&gt;
By default on AIX, the available memory is small. Like:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;ulimit -a&lt;br/&gt;
core file size          (blocks, -c) 1048575&lt;br/&gt;
data seg size           (kbytes, -d) 131072           &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;br/&gt;
file size               (blocks, -f) 1048575&lt;br/&gt;
max memory size         (kbytes, -m) 32768&lt;br/&gt;
open files                      (-n) 2000&lt;br/&gt;
pipe size            (512 bytes, -p) 64&lt;br/&gt;
stack size              (kbytes, -s) 32768&lt;br/&gt;
cpu time               (seconds, -t) unlimited&lt;br/&gt;
max user processes              (-u) unlimited&lt;br/&gt;
virtual memory          (kbytes, -v) unlimited&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;About the allocation, the data segment (ulimit -d) is too small. So realloc() returns 0  AND it sets errno to 12 !&lt;/p&gt;

&lt;p&gt;By adding some lines of code in bson-memory.c :&lt;br/&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br/&gt;
printf(&quot;bson_realloc: after gMemVtable.realloc: mem: %p - num_bytes: %d - errno: %d\n&quot;, mem, num_bytes, errno);&lt;br/&gt;
 I can see:&lt;br/&gt;
bson_realloc: after gMemVtable.realloc: mem: 0 - num_bytes: 16777216 - &lt;b&gt;errno: 12&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;/usr/include/errno.h:#define    ENOMEM  12      /* Not enough space                     */&lt;/p&gt;

&lt;p&gt;OK. that seems clear.&lt;/p&gt;

&lt;p&gt;With ulimit -d unlimited, that works much better.&lt;/p&gt;

&lt;p&gt;OK. I would suggest to add the print of the &quot;errno&quot; variable in addition, in order to speed up understanding what the issue is.&lt;br/&gt;
I&apos;ll test the other failures asap. However, we have a general electricity shutdown early this afternoon. So I&apos;ll probably continue this next Monday.&lt;/p&gt;</comment>
                            <comment id="1862962" author="jesse" created="Thu, 12 Apr 2018 20:25:56 +0000"  >&lt;p&gt;Thanks, don&apos;t know what&apos;s going wrong with the &quot;npages&quot; diagnostic output on AIX but that&apos;s not related to the test failures you see. We don&apos;t actually use npages for any driver logic, we just output that value during tests. (Don&apos;t know why, it was implemented by my predecessor.)&lt;/p&gt;

&lt;p&gt;I think the crucial question is the one I wrote above, whether bson_string_new calls malloc with the correct argument or a wrong one.&lt;/p&gt;

&lt;p&gt;I&apos;m curious &lt;b&gt;why&lt;/b&gt; &quot;/TOPOLOGY/scanner_connection_error&quot; fails, so if you run it and as I suggested you should see an error. If it&apos;s a timing error then it&apos;s perhaps &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2567&quot; title=&quot;Cluster time failure on /Topology/invalid_cluster_node&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2567&quot;&gt;&lt;del&gt;CDRIVER-2567&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Regarding long-term support for AIX: we don&apos;t plan to support AIX officially.&lt;/p&gt;</comment>
                            <comment id="1862617" author="trex58" created="Thu, 12 Apr 2018 16:09:43 +0000"  >&lt;p&gt;tests/TestSuite.c :&lt;/p&gt;

&lt;p&gt;   uint64_t npages = 0;&lt;br/&gt;
...&lt;br/&gt;
#if defined(_SC_PHYS_PAGES)&lt;br/&gt;
   npages = sysconf (_SC_PHYS_PAGES);&lt;br/&gt;
#endif&lt;br/&gt;
   fprintf (stream,&lt;br/&gt;
            &quot;  \&quot;host\&quot;: {\n&quot;&lt;br/&gt;
            &quot;    \&quot;sysname\&quot;: \&quot;%s\&quot;,\n&quot;&lt;br/&gt;
            &quot;    \&quot;release\&quot;: \&quot;%s\&quot;,\n&quot;&lt;br/&gt;
            &quot;    \&quot;machine\&quot;: \&quot;%s\&quot;,\n&quot;&lt;br/&gt;
            &quot;    \&quot;memory\&quot;: &lt;/p&gt;
{\n&quot;
            &quot;      \&quot;pagesize\&quot;: %&quot; PRIu64 &quot;,\n&quot;
            &quot;      \&quot;npages\&quot;: %&quot; PRIu64 &quot;\n&quot;
            &quot;    }
&lt;p&gt;\n&quot;&lt;br/&gt;
            &quot;  },\n&quot;,&lt;br/&gt;
            u.sysname,&lt;br/&gt;
            u.release,&lt;br/&gt;
            u.machine,&lt;br/&gt;
            pagesize,&lt;br/&gt;
            npages);&lt;br/&gt;
#endif&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;man sysconf on Linux:&lt;br/&gt;
       These values also exist, but may not be standard.&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;_SC_PHYS_PAGES&lt;br/&gt;
              The number of pages of physical memory.  Note that it is possible for the product of this value and the value of _SC_PAGESIZE to overflow.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;However, that should be 0.&lt;/p&gt;

&lt;p&gt;Unless the   %&quot; PRIu64 &quot;  makes it wrong ?&lt;/p&gt;

&lt;p&gt;Hummmm That reminds me another issue with PRIu64 for GCC Go:&lt;br/&gt;
     &quot;The GCC &quot;system.h&quot; header must be included earlier for PRIx64 and PRIu64 to be defined correctly.&quot;&lt;/p&gt;</comment>
                            <comment id="1862594" author="trex58" created="Thu, 12 Apr 2018 15:49:40 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;--no-fork: OK. I should have understood this before.&lt;/p&gt;

&lt;p&gt;With some trace, in both 32bit and 64bit, I see :&lt;br/&gt;
    &quot;npages&quot;: 18446744073709551615       !!!!!!!!!   2^64-1 !!&lt;br/&gt;
It is only : 129912 on a Linux/PPC64LE VM for the same test.&lt;br/&gt;
And I see that on AIX: ./test-libmongoc -d -l &quot;/TOPOLOGY/scanner_connection_error&quot;  generates also 129912 .&lt;br/&gt;
That may explain the issue !&lt;br/&gt;
However, there are PASSing tests that generate the same huge value for npages.&lt;br/&gt;
Any idea what is this &quot;npages&quot; value and where it is computed ?&lt;/p&gt;

&lt;p&gt;Meanwhile, I&apos;ll follow your suggestions for debugging.&lt;/p&gt;

&lt;p&gt;About  &quot;scanner_connection_error&quot; test in error, I have no idea why it failed since it passes now even if mongod is down.&lt;/p&gt;

&lt;p&gt;About the support of AIX by mongoc, I would be happy, once all bugs are fixed, to see AIX being supported by mongoc.&lt;br/&gt;
I&apos;ve seen that there is a buildfarm. Maybe we may add a machine if the framework is not too complex.&lt;/p&gt;

&lt;p&gt;Thanks !&lt;/p&gt;


&lt;ol&gt;
	&lt;li&gt;./test-libmongoc -l /BulkOperation/upsert_unordered_oversized 2&amp;gt;&amp;amp;1 | tee /tmp/P&lt;br/&gt;
{&lt;br/&gt;
  &quot;host&quot;: {&lt;br/&gt;
    &quot;sysname&quot;: &quot;AIX&quot;,&lt;br/&gt;
    &quot;release&quot;: &quot;1&quot;,&lt;br/&gt;
    &quot;machine&quot;: &quot;00F9FD4B4C00&quot;,&lt;br/&gt;
    &quot;memory&quot;: &lt;br/&gt;
      &quot;pagesize&quot;: 4096,&lt;br/&gt;
     &lt;font color=&quot;red&quot;&gt;* &quot;npages&quot;: 18446744073709551615*&lt;/font&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;  },&lt;br/&gt;
  &quot;auth&quot;: &lt;/p&gt;
{ &quot;user&quot;: &quot;&quot;, &quot;pass&quot;: &quot;&quot; }
&lt;p&gt;, &lt;br/&gt;
  &quot;addr&quot;: &lt;/p&gt;
{ &quot;host&quot;: &quot;10.197.64.27&quot;, &quot;port&quot;: 27017, &quot;uri&quot;: &quot;mongodb://10.197.64.27:27017/&quot; }
&lt;p&gt;,&lt;br/&gt;
  &quot;gssapi&quot;: &lt;/p&gt;
{ &quot;host&quot;: &quot;&quot;, &quot;user&quot;: &quot;&quot; }
&lt;p&gt;, &lt;br/&gt;
  &quot;uds&quot;: &quot;%2Ftmp%2Fmongodb-27017.sock&quot;, &lt;br/&gt;
  &quot;compressors&quot;: &quot;&quot;, &lt;br/&gt;
  &quot;SSL&quot;: &lt;/p&gt;
{
    &quot;enabled&quot;: false,
    &quot;weak_cert_validation&quot;: false,
    &quot;pem_file&quot;: &quot;&quot;,
    &quot;pem_pwd&quot;: &quot;&quot;,
    &quot;ca_file&quot;: &quot;&quot;,
    &quot;ca_dir&quot;: &quot;&quot;,
    &quot;crl_file&quot;: &quot;&quot;
  }
&lt;p&gt;,&lt;br/&gt;
  &quot;framework&quot;: &lt;/p&gt;
{
    &quot;monitoringVerbose&quot;: false,
    &quot;mockServerLog&quot;: &quot;&quot;,
    &quot;futureTimeoutMS&quot;: 10000,
    &quot;majorityReadConcern&quot;: false,
    &quot;skipLiveTests&quot;: false,
    &quot;IPv6&quot;: false
  }
&lt;p&gt;,&lt;br/&gt;
  &quot;options&quot;: &lt;/p&gt;
{
    &quot;fork&quot;: true,
    &quot;tracing&quot;: false
  }
&lt;p&gt;,&lt;br/&gt;
  &quot;results&quot;: [&lt;/p&gt;
    { &quot;status&quot;: &quot;FAIL&quot;, &quot;test_file&quot;: &quot;/BulkOperation/upsert_unordered_oversized&quot;, &quot;seed&quot;: &quot;2786200190&quot;, &quot;start&quot;: 10992917.294652226, &quot;end&quot;: 10992918.951419945, &quot;elapsed&quot;: 1.656767719  }
&lt;p&gt;  ]&lt;/p&gt;


&lt;p&gt;Though, from a Linux/PPC64LE machine, I see:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;./test-libmongoc -d -f -l /BulkOperation/upsert_unordered_oversized&lt;br/&gt;
{&lt;br/&gt;
  &quot;host&quot;: &lt;br/&gt;
    &quot;sysname&quot;: &quot;Linux&quot;,&lt;br/&gt;
    &quot;release&quot;: &quot;4.15.8-300.fc27.ppc64le&quot;,&lt;br/&gt;
    &quot;machine&quot;: &quot;ppc64le&quot;,&lt;br/&gt;
    &quot;memory&quot;: &lt;br/&gt;
      &quot;pagesize&quot;: 65536,&lt;br/&gt;
     &lt;b&gt;&lt;font color=&quot;#14892c&quot;&gt; &quot;npages&quot;: 129912&lt;/font&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;

</comment>
                            <comment id="1862535" author="jesse" created="Thu, 12 Apr 2018 15:15:55 +0000"  >&lt;p&gt;The tests are crashing &lt;b&gt;without&lt;/b&gt; &quot;--no-fork&quot;, also, they&apos;re just not coredumping in the same way since the crash occurs in a child process.&lt;/p&gt;

&lt;p&gt;It looks like the tests that crash mostly involve allocations of over 16 MB while constructing oversized documents for the sake of testing them:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/0c91d3f67a7e30be2193cc77e84a131ed97bd601/tests/test-mongoc-bulk.c#L631&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/0c91d3f67a7e30be2193cc77e84a131ed97bd601/tests/test-mongoc-bulk.c#L631&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have a couple theories. One is that bson_string_new calls malloc with an incorrect size, perhaps there is some arithmetic leading to that call which is not implemented correctly for your architecture. The second theory is that the arithmetic is correct but the malloc simply fails to allocate such a large block. You can determine which by stepping through the test in a debugger, execute the test like:&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;   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; ./test-libmongoc --no-fork -d -l /BulkOperation/upsert_unordered_oversized&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;Set a breakpoint in bson_string_new, around this line:&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;   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;ret-&amp;gt;alloc = ret-&amp;gt;len + 1;&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;I&apos;d make a conditional breakpoint and only stop there if ret-&amp;gt;len is greater than a million.&lt;/p&gt;

&lt;p&gt;To set expectations correctly, I have to warn you we don&apos;t test on AIX, don&apos;t officially support it in the driver, and don&apos;t have access to an AIX machine at the moment. But if you determine the cause of the bug we&apos;re happy to review a pull request.&lt;/p&gt;

&lt;p&gt;The failure in &quot;/TOPOLOGY/scanner_connection_error&quot; I don&apos;t know about, but if you run just that test you should see some informative output:&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;   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;./test-libmongoc --no-fork -d -l &quot;/TOPOLOGY/scanner_connection_error&quot;&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>
                    </comments>
                    <attachments>
                            <attachment id="184277" name="libbson-1.9.4-memory.patch" size="1012" author="trex58" created="Tue, 17 Apr 2018 13:58:49 +0000"/>
                            <attachment id="185428" name="mongo-c-driver-1.9.4-topology-scanner-v2.patch" size="790" author="jesse@mongodb.com" created="Mon, 30 Apr 2018 13:48:27 +0000"/>
                            <attachment id="185429" name="mongo-c-driver-1.9.4._mongoc_get_cpu_count.patch" size="357" author="jesse@mongodb.com" created="Mon, 30 Apr 2018 13:48:27 +0000"/>
                            <attachment id="185427" name="mongo-c-driver-1.9.4.int64-lld-v2.patch" size="748" author="jesse@mongodb.com" created="Mon, 30 Apr 2018 13:48:27 +0000"/>
                    </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|htm8pr:</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>