<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:03:54 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>[CXX-1780] program crashes on cursor.begin()</title>
                <link>https://jira.mongodb.org/browse/CXX-1780</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;My program is trying to fetch records from manual_buckets collection. It crashes at the following point...&lt;/p&gt;

&lt;p&gt;(gdb) bt&lt;br/&gt;
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51&lt;br/&gt;
#1 0x00007f267af40801 in __GI_abort () at abort.c:79&lt;br/&gt;
#2 0x00007f2677fd9332 in mongoc_socket_errno (sock=&amp;lt;optimized out&amp;gt;)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-socket.c:594&lt;br/&gt;
#3 0x00007f2677fdc6ec in _mongoc_stream_socket_readv (stream=0x5605fc50b790, iov=0x7f266b7b4d10, iovcnt=1, min_bytes=351, timeout_msec=&amp;lt;optimized out&amp;gt;)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-stream-socket.c:164&lt;br/&gt;
#4 0x00007f2677fdaea3 in mongoc_stream_read (stream=stream@entry=0x5605fc50b790, buf=&amp;lt;optimized out&amp;gt;, count=count@entry=351, min_bytes=min_bytes@entry=351, &lt;br/&gt;
 timeout_msec=&amp;lt;optimized out&amp;gt;) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-stream.c:281&lt;br/&gt;
#5 0x00007f2677fa6371 in _mongoc_buffer_append_from_stream (buffer=buffer@entry=0x7f266b7b4df0, stream=0x5605fc50b790, size=351, &lt;br/&gt;
 timeout_msec=&amp;lt;optimized out&amp;gt;, error=error@entry=0x7f266b7b5580)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-buffer.c:212&lt;br/&gt;
#6 0x00007f2677fae7b6 in mongoc_cluster_run_opmsg (cluster=cluster@entry=0x5605fc96a028, cmd=cmd@entry=0x7f266b7b5780, reply=reply@entry=0x7f266b7b5080, &lt;br/&gt;
 error=error@entry=0x7f266b7b5580) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cluster.c:2861&lt;br/&gt;
#7 0x00007f2677faf5fe in mongoc_cluster_run_command_private (cluster=cluster@entry=0x5605fc96a028, cmd=cmd@entry=0x7f266b7b5780, reply=0x7f266b7b5080, &lt;br/&gt;
 reply@entry=0x0, error=error@entry=0x7f266b7b5580) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cluster.c:649&lt;br/&gt;
#8 0x00007f2677faf6c4 in mongoc_cluster_run_command_parts (cluster=0x5605fc96a028, server_stream=&amp;lt;optimized out&amp;gt;, parts=0x7f266b7b5780, reply=0x0, &lt;br/&gt;
 error=0x7f266b7b5580) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cluster.c:700&lt;br/&gt;
#9 0x00007f2677fb1ae8 in mongoc_cluster_check_interval (cluster=cluster@entry=0x5605fc96a028, server_id=server_id@entry=1)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cluster.c:2455&lt;br/&gt;
#10 0x00007f2677fb1c2a in _mongoc_cluster_stream_for_optype (cluster=0x5605fc96a028, optype=optype@entry=MONGOC_SS_READ, read_prefs=0x7f2630003720, cs=0x0, &lt;br/&gt;
 reply=reply@entry=0x7f266b7b5c80, error=0x7f26300033d0) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cluster.c:2169&lt;br/&gt;
#11 0x00007f2677fb1cd5 in mongoc_cluster_stream_for_reads (cluster=&amp;lt;optimized out&amp;gt;, read_prefs=&amp;lt;optimized out&amp;gt;, cs=&amp;lt;optimized out&amp;gt;, &lt;br/&gt;
 reply=reply@entry=0x7f266b7b5c80, error=&amp;lt;optimized out&amp;gt;) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cluster.c:2219&lt;br/&gt;
#12 0x00007f2677fba6ff in _mongoc_cursor_fetch_stream (cursor=cursor@entry=0x7f2630003210)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cursor.c:658&lt;br/&gt;
#13 0x00007f2677fbd533 in _prime (cursor=0x7f2630003210) at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cursor-find.c:40&lt;br/&gt;
#14 0x00007f2677fbb3d1 in _call_transition (cursor=0x7f2630003210)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cursor.c:1150&lt;br/&gt;
#15 mongoc_cursor_next (cursor=0x7f2630003210, bson=0x7f266b7b5e60)&lt;br/&gt;
 at /root/mongo-c-driver/mongo-c-driver-1.14.0/src/libmongoc/src/mongoc/mongoc-cursor.c:1226&lt;br/&gt;
#16 0x00007f267baee7d2 in mongocxx::v_noabi::cursor::iterator::operator++() () from /usr/local/lib/libmongocxx.so._noabi&lt;br/&gt;
#17 0x00007f267baee9e3 in mongocxx::v_noabi::cursor::begin() () from /usr/local/lib/libmongocxx.so._noabi&lt;br/&gt;
#18 0x00005605fa5258ba in MongoDB::loadCollection (this=0x5605fc218be8, loader=..., bucket=&quot;buk&quot;)&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;((gdb) frame 18&lt;/p&gt;

&lt;p&gt;#18 0x00005605fa5258ba in MongoDB::loadCollection (this=0x5605fc218be8, loader=..., bucket=&quot;buk&quot;)&#160; &#160; at&#160; /src/db/mongodbsrc.cpp:252&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#FF0000&quot;&gt;252 &#160; &#160; &#160; &#160; &#160; &#160; for (auto&amp;amp;&amp;amp; doc: cursor)&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;It&apos;s a multithreaded environment with different thread pulling records from different collections.&lt;/p&gt;

&lt;p&gt;When I ran the piece of code for pulling the records from manual_buckets, it just runs fine.&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Also I am getting following erros sometimes...&lt;/p&gt;


&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;2019-05-30 11:32:16,357&amp;#93;&lt;/span&gt; &lt;font color=&quot;#FF0000&quot;&gt;FATAL Error: Failed to send &quot;find&quot; command with database &quot;db&quot;: Malformed message from server: generic server error&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Please help me.&lt;/p&gt;</description>
                <environment>mongodb version: 3.6&lt;br/&gt;
mongo-c-driver version: 3.14</environment>
        <key id="782079">CXX-1780</key>
            <summary>program crashes on cursor.begin()</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="13203">Gone away</resolution>
                                        <assignee username="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="mkansari">Mohammed Khalid Ansari</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 May 2019 06:08:59 +0000</created>
                <updated>Fri, 27 Oct 2023 19:48:16 +0000</updated>
                            <resolved>Mon, 21 Oct 2019 14:48:41 +0000</resolved>
                                    <version>3.4.0</version>
                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2413226" author="rathi.gnanasekaran" created="Mon, 9 Sep 2019 17:57:03 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mkansari&quot; class=&quot;user-hover&quot; rel=&quot;mkansari&quot;&gt;mkansari&lt;/a&gt; have you tried running the application under valgrind as per our previous request. &lt;/p&gt;</comment>
                            <comment id="2322457" author="mkansari" created="Fri, 12 Jul 2019 09:08:49 +0000"  >&lt;p&gt;It&apos;s multithreaded env but the collection is running in sigle thread.&#160;&lt;/p&gt;</comment>
                            <comment id="2268576" author="acm" created="Mon, 3 Jun 2019 14:46:26 +0000"  >&lt;p&gt;Usually, these sorts of random crashes misbehaviors in multithreaded code using the C++ driver indicates either that you are failing to obey some of the lifetime rules, or are allowing concurrent access to objects that should only be used by one thread at a time. My first recommendation would be to run your application under valgrind and see what it says.&lt;/p&gt;</comment>
                            <comment id="2264851" author="mkansari" created="Thu, 30 May 2019 09:41:58 +0000"  >&lt;p&gt;Just to add to it, the for loop is just after the find..&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;auto cursor = collection.find(builder.view());&lt;br/&gt;
 for (auto&amp;amp;&amp;amp; doc: cursor)&lt;/p&gt;</comment>
                    </comments>
                    <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|hur4vb:</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>