<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:04:03 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>[SERVER-3786] Segfault on unloading libmongoclient.so (built as a shared lib) in a thread other than the main thread</title>
                <link>https://jira.mongodb.org/browse/SERVER-3786</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Segfault when a thread other than the main thread of execution de-initializes tls (tsd). mongoclient.so should be dlopen-ed in that thread beforehand. Steps to reproduce:&lt;/p&gt;

&lt;p&gt;create thread&lt;br/&gt;
  dlopen(&apos;libmongoclient.so&apos;)&lt;br/&gt;
  dlclose(&apos;libmongoclient.so&apos;)&lt;br/&gt;
join thread&lt;br/&gt;
observe segfault&lt;/p&gt;

&lt;p&gt;Reproduce using the attached file:&lt;br/&gt;
$ g++ -o test test.cpp -lpthread -ldl&lt;br/&gt;
$ ./test &lt;br/&gt;
Loading library...&lt;br/&gt;
Closing library...&lt;br/&gt;
Segmentation fault&lt;/p&gt;

&lt;p&gt;GDB output:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Thread debugging using libthread_db enabled&amp;#93;&lt;/span&gt;&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;New Thread 0x7ffff6eb0700 (LWP 15768)&amp;#93;&lt;/span&gt;&lt;br/&gt;
Loading library...&lt;br/&gt;
Closing library...&lt;/p&gt;

&lt;p&gt;Program received signal SIGSEGV, Segmentation fault.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;Switching to Thread 0x7ffff6eb0700 (LWP 15768)&amp;#93;&lt;/span&gt;&lt;br/&gt;
0x00007ffff5f2e840 in ?? ()&lt;br/&gt;
(gdb) bt&lt;br/&gt;
#0  0x00007ffff5f2e840 in ?? ()&lt;br/&gt;
#1  0x00007ffff7bc9211 in __nptl_deallocate_tsd () from /lib64/libpthread.so.0&lt;br/&gt;
#2  0x00007ffff7bc9be8 in start_thread () from /lib64/libpthread.so.0&lt;br/&gt;
#3  0x00007ffff6f8076d in clone () from /lib64/libc.so.6&lt;br/&gt;
(gdb)&lt;/p&gt;


&lt;p&gt;Try to change &apos;libmongoclient.so&apos; to any other .so (e.g. libneon.so), and the problem is gone.&lt;/p&gt;

&lt;p&gt;The original source of the bug discovery was: Lua in a thread + LuaMongo driver.&lt;br/&gt;
 1. a Lua environment is started in a separate thread&lt;br/&gt;
 2. require &apos;mongo&apos;&lt;br/&gt;
 3. mongo.so loads libmongoclient.so through the call to dlopen()&lt;br/&gt;
 4. crash when the thread terminates&lt;/p&gt;</description>
                <environment>Gentoo Linux x64 (mongoclient is built as a shared lib on Gentoo). No such issue on Arch where it&amp;#39;s built as a static lib.</environment>
        <key id="22019">SERVER-3786</key>
            <summary>Segfault on unloading libmongoclient.so (built as a shared lib) in a thread other than the main thread</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="5">Cannot Reproduce</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="seny">Arseny Vakhrushev</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Sep 2011 20:51:26 +0000</created>
                <updated>Wed, 29 Feb 2012 03:53:38 +0000</updated>
                            <resolved>Sat, 21 Jan 2012 00:37:39 +0000</resolved>
                                                                    <component>Internal Client</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="60943" author="redbeard0531" created="Mon, 17 Oct 2011 20:22:14 +0000"  >&lt;p&gt;Due to some build issues I was previously unable to build the shared client. As of a fix I just pushed to master I am now able to build. &lt;/p&gt;

&lt;p&gt;I am not able to reproduce this using the latest code. Could you try a fresh checkout and see if it has been fixed for you as well? If not, please include some more info on your environment such as kernel, g++ and glibc versions.&lt;/p&gt;


&lt;p&gt;$ ./a.out &amp;amp;&amp;amp; echo it worked&lt;br/&gt;
Loading library...&lt;br/&gt;
Closing library...&lt;br/&gt;
it worked&lt;/p&gt;</comment>
                            <comment id="58567" author="seny" created="Wed, 5 Oct 2011 08:10:42 +0000"  >&lt;p&gt;No progress on this issue?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="13002" name="test.cpp" size="440" author="seny" created="Thu, 8 Sep 2011 20:51:26 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 17 Oct 2011 20:22:14 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 18 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 18 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>seny</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrorh3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hriqbb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22916</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht0d13:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>