<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:33 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-1266] libmongoclient should not link with xulrunner&apos;s libmozjs, causes subtle memory errors</title>
                <link>https://jira.mongodb.org/browse/SERVER-1266</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>
&lt;p&gt;An empty mainline, when linked with libmongoclient, then run under valgrind, reports a bad free at shutdown in __libc_freeres processing:&lt;/p&gt;


&lt;p&gt;mongo_libc_freeres$ cat ./main.cc &lt;br/&gt;
#include &amp;lt;cstdio&amp;gt;&lt;/p&gt;

&lt;p&gt;int main(int argc, char* argv[])&lt;br/&gt;
{&lt;br/&gt;
    std::printf(&quot;Hello, World\n&quot;);&lt;br/&gt;
    return 0;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ g++ -ggdb ./main.cc -L &lt;sub&gt;/mongo.temp.install/lib64 -Wl,-rpath,&lt;/sub&gt;/mongo.temp.install/lib64 -lmongoclient&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ ls -la ./a.out &lt;br/&gt;
-rwxrwxr-x 1 xxx xxx 12666 2010-06-21 12:08 ./a.out&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ ldd ./a.out &lt;br/&gt;
	linux-vdso.so.1 =&amp;gt;  (0x00007fffc50ce000)&lt;br/&gt;
	libmongoclient.so.9.9.9 =&amp;gt; ~/mongo.temp.install/lib64/libmongoclient.so.9.9.9 (0x00007f20cb1cb000)&lt;br/&gt;
	libstdc+&lt;ins&gt;.so.6 =&amp;gt; /usr/lib/libstdc&lt;/ins&gt;+.so.6 (0x00007f20cae97000)&lt;br/&gt;
	libm.so.6 =&amp;gt; /lib/libm.so.6 (0x00007f20cac13000)&lt;br/&gt;
	libgcc_s.so.1 =&amp;gt; /lib/libgcc_s.so.1 (0x00007f20ca9fc000)&lt;br/&gt;
	libc.so.6 =&amp;gt; /lib/libc.so.6 (0x00007f20ca67a000)&lt;br/&gt;
	libpthread.so.0 =&amp;gt; /lib/libpthread.so.0 (0x00007f20ca45c000)&lt;br/&gt;
	libboost_system.so.1.40.0 =&amp;gt; /usr/lib/libboost_system.so.1.40.0 (0x00007f20ca258000)&lt;br/&gt;
	libboost_thread.so.1.40.0 =&amp;gt; /usr/lib/libboost_thread.so.1.40.0 (0x00007f20ca042000)&lt;br/&gt;
	libboost_filesystem.so.1.40.0 =&amp;gt; /usr/lib/libboost_filesystem.so.1.40.0 (0x00007f20c9e2c000)&lt;br/&gt;
	libboost_program_options.so.1.40.0 =&amp;gt; /usr/lib/libboost_program_options.so.1.40.0 (0x00007f20c9bde000)&lt;br/&gt;
	libpcrecpp.so.0 =&amp;gt; /usr/lib/libpcrecpp.so.0 (0x00007f20c99d5000)&lt;br/&gt;
	libpcre.so.3 =&amp;gt; /lib/libpcre.so.3 (0x00007f20c97a6000)&lt;br/&gt;
	libmozjs.so =&amp;gt; /usr/lib64/xulrunner-1.9.2.3/libmozjs.so (0x00007f20c948d000)&lt;br/&gt;
	/lib64/ld-linux-x86-64.so.2 (0x00007f20cb6a3000)&lt;br/&gt;
	librt.so.1 =&amp;gt; /lib/librt.so.1 (0x00007f20c9284000)&lt;br/&gt;
	libplds4.so =&amp;gt; /usr/lib/libplds4.so (0x00007f20c9080000)&lt;br/&gt;
	libplc4.so =&amp;gt; /usr/lib/libplc4.so (0x00007f20c8e7a000)&lt;br/&gt;
	libnspr4.so =&amp;gt; /usr/lib/libnspr4.so (0x00007f20c8c3e000)&lt;br/&gt;
	libdl.so.2 =&amp;gt; /lib/libdl.so.2 (0x00007f20c8a3a000)&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ valgrind --track-origins=yes --read-var-info=yes --leak-check=full ./a.out&lt;br/&gt;
==29614== Memcheck, a memory error detector&lt;br/&gt;
==29614== Copyright (C) 2002-2010, and GNU GPL&apos;d, by Julian Seward et al.&lt;br/&gt;
==29614== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info&lt;br/&gt;
==29614== Command: ./a.out&lt;br/&gt;
==29614== &lt;br/&gt;
Hello, World&lt;br/&gt;
==29614== Invalid free() / delete / delete[]&lt;br/&gt;
==29614==    at 0x4C28D5E: free (vg_replace_malloc.c:381)&lt;br/&gt;
==29614==    by 0x5BE404A: free_mem (in /lib/libc-2.11.1.so)&lt;br/&gt;
==29614==    by 0x5BE3BE1: __libc_freeres (in /lib/libc-2.11.1.so)&lt;br/&gt;
==29614==    by 0x4A236AB: _vgnU_freeres (vg_preloaded.c:62)&lt;br/&gt;
==29614==    by 0x5AEC214: exit (exit.c:93)&lt;br/&gt;
==29614==    by 0x5AD1C53: (below main) (libc-start.c:258)&lt;br/&gt;
==29614==  Address 0x4043e88 is not stack&apos;d, malloc&apos;d or (recently) free&apos;d&lt;br/&gt;
==29614== &lt;br/&gt;
==29614== &lt;br/&gt;
==29614== HEAP SUMMARY:&lt;br/&gt;
==29614==     in use at exit: 10,512 bytes in 25 blocks&lt;br/&gt;
==29614==   total heap usage: 421 allocs, 397 frees, 40,988 bytes allocated&lt;br/&gt;
==29614== &lt;br/&gt;
==29614== LEAK SUMMARY:&lt;br/&gt;
==29614==    definitely lost: 0 bytes in 0 blocks&lt;br/&gt;
==29614==    indirectly lost: 0 bytes in 0 blocks&lt;br/&gt;
==29614==      possibly lost: 0 bytes in 0 blocks&lt;br/&gt;
==29614==    still reachable: 10,512 bytes in 25 blocks&lt;br/&gt;
==29614==         suppressed: 0 bytes in 0 blocks&lt;br/&gt;
==29614== Reachable blocks (those to which a pointer was found) are not shown.&lt;br/&gt;
==29614== To see them, rerun with: --leak-check=full --show-reachable=yes&lt;br/&gt;
==29614== &lt;br/&gt;
==29614== For counts of detected and suppressed errors, rerun with: -v&lt;br/&gt;
==29614== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)&lt;/p&gt;

&lt;p&gt;If we manually re-link libmongoclient.so without mozjs, the problem goes away (note lack of -lmozjs, and -L and -Wl,rpath arguments pointing to /usr/lib64/xulrunner-w.x.y.z:&lt;/p&gt;

&lt;p&gt;mongo$ g++ -o libmongoclient.so.9.9.9 -fPIC -pthread -rdynamic -Wl,-soname,libmongoclient.so.9.9.9 -shared pch.os buildinfo.os db/common.os db/jsobj.os db/json.os db/lasterror.os db/nonce.os db/queryutil.os shell/mongo.os util/background.os util/mmap.os util/ramstore.os util/sock.os util/util.os util/message.os util/assert_util.os util/httpclient.os util/md5main.os util/base64.os util/concurrency/vars.os util/concurrency/task.os util/debug_util.os util/concurrency/thread_pool.os util/password.os util/version.os util/histogram.os util/concurrency/spin_lock.os util/text.os util/md5.os client/connpool.os client/dbclient.os client/dbclientcursor.os client/model.os client/syncclusterconnection.os s/shardconnection.os util/mmap_posix.os util/processinfo_linux2.os client/clientOnly.os client/gridfs.os s/d_util.os -L/usr/lib64 -L/lib64 -lpthread -lstdc++ -lboost_system-mt -lboost_thread-mt -lboost_filesystem-mt -lboost_program_options-mt -lpcrecpp -lpcre&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ ldd ./a.out &lt;br/&gt;
	linux-vdso.so.1 =&amp;gt;  (0x00007fff3693c000)&lt;br/&gt;
	libmongoclient.so.9.9.9 =&amp;gt; ~/mongo.temp.install/lib64/libmongoclient.so.9.9.9 (0x00007f68fd175000)&lt;br/&gt;
	libstdc+&lt;ins&gt;.so.6 =&amp;gt; /usr/lib/libstdc&lt;/ins&gt;+.so.6 (0x00007f68fce41000)&lt;br/&gt;
	libm.so.6 =&amp;gt; /lib/libm.so.6 (0x00007f68fcbbd000)&lt;br/&gt;
	libgcc_s.so.1 =&amp;gt; /lib/libgcc_s.so.1 (0x00007f68fc9a6000)&lt;br/&gt;
	libc.so.6 =&amp;gt; /lib/libc.so.6 (0x00007f68fc624000)&lt;br/&gt;
	libpthread.so.0 =&amp;gt; /lib/libpthread.so.0 (0x00007f68fc406000)&lt;br/&gt;
	libboost_system.so.1.40.0 =&amp;gt; /usr/lib/libboost_system.so.1.40.0 (0x00007f68fc202000)&lt;br/&gt;
	libboost_thread.so.1.40.0 =&amp;gt; /usr/lib/libboost_thread.so.1.40.0 (0x00007f68fbfec000)&lt;br/&gt;
	libboost_filesystem.so.1.40.0 =&amp;gt; /usr/lib/libboost_filesystem.so.1.40.0 (0x00007f68fbdd6000)&lt;br/&gt;
	libboost_program_options.so.1.40.0 =&amp;gt; /usr/lib/libboost_program_options.so.1.40.0 (0x00007f68fbb88000)&lt;br/&gt;
	libpcrecpp.so.0 =&amp;gt; /usr/lib/libpcrecpp.so.0 (0x00007f68fb97f000)&lt;br/&gt;
	libpcre.so.3 =&amp;gt; /lib/libpcre.so.3 (0x00007f68fb750000)&lt;br/&gt;
	/lib64/ld-linux-x86-64.so.2 (0x00007f68fd64d000)&lt;br/&gt;
	librt.so.1 =&amp;gt; /lib/librt.so.1 (0x00007f68fb548000)&lt;/p&gt;

&lt;p&gt;(note that there is no link to libmozjs listed above)&lt;/p&gt;

&lt;p&gt;Re-running valgrind:&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ valgrind --track-origins=yes --read-var-info=yes --leak-check=full ./a.out&lt;br/&gt;
==29841== Memcheck, a memory error detector&lt;br/&gt;
==29841== Copyright (C) 2002-2010, and GNU GPL&apos;d, by Julian Seward et al.&lt;br/&gt;
==29841== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info&lt;br/&gt;
==29841== Command: ./a.out&lt;br/&gt;
==29841== &lt;br/&gt;
Hello, World&lt;br/&gt;
==29841== &lt;br/&gt;
==29841== HEAP SUMMARY:&lt;br/&gt;
==29841==     in use at exit: 10,512 bytes in 25 blocks&lt;br/&gt;
==29841==   total heap usage: 421 allocs, 396 frees, 40,988 bytes allocated&lt;br/&gt;
==29841== &lt;br/&gt;
==29841== LEAK SUMMARY:&lt;br/&gt;
==29841==    definitely lost: 0 bytes in 0 blocks&lt;br/&gt;
==29841==    indirectly lost: 0 bytes in 0 blocks&lt;br/&gt;
==29841==      possibly lost: 0 bytes in 0 blocks&lt;br/&gt;
==29841==    still reachable: 10,512 bytes in 25 blocks&lt;br/&gt;
==29841==         suppressed: 0 bytes in 0 blocks&lt;br/&gt;
==29841== Reachable blocks (those to which a pointer was found) are not shown.&lt;br/&gt;
==29841== To see them, rerun with: --leak-check=full --show-reachable=yes&lt;br/&gt;
==29841== &lt;br/&gt;
==29841== For counts of detected and suppressed errors, rerun with: -v&lt;br/&gt;
==29841== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)&lt;/p&gt;

&lt;p&gt;And our error goes away. Its pretty clear that libmongoclient doesn&apos;t actually depend on mozjs.so (since it linked), and forcing all clients that link against libmongoclient to pick up such a dependency seems to cause memory errors. It would be good if libmongoclient would drop this dependency.&lt;/p&gt;

&lt;p&gt;FWIW, libmongoclient links, on my system, the following libraries:&lt;/p&gt;

&lt;p&gt;-lpthread -lstdc++ -lboost_system-mt -lboost_thread-mt -lboost_filesystem-mt -lboost_program_options-mt -lpcrecpp -lpcre&lt;/p&gt;

&lt;p&gt;Many of these are not necessary:&lt;/p&gt;

&lt;p&gt;The explicit -lpthread is not needed since the g++ driver is being called with the -pthread option. Its better to let the compiler driver worry about where to put things like -lpthread and -lc on the link line.&lt;br/&gt;
The -lstdc++ is not necessary since that is included by default by the g++ driver when linking&lt;br/&gt;
The -lboost_program_options_mt library is not needed since the client library does not do any options parsing&lt;br/&gt;
The library does not appear to depend on -lpcrecpp -lpcre either.&lt;/p&gt;

&lt;p&gt;I verified that all of these can be removed by manually linking the library with -Wl,-zdefs added to the link line and removing each of the libraries, one by one. The final link line looked like:&lt;/p&gt;

&lt;p&gt;g++ -o libmongoclient.so.9.9.9 -fPIC -pthread -rdynamic -Wl,-zdefs -Wl,-soname,libmongoclient.so.9.9.9 -shared pch.os buildinfo.os db/common.os db/jsobj.os db/json.os db/lasterror.os db/nonce.os db/queryutil.os shell/mongo.os util/background.os util/mmap.os util/ramstore.os util/sock.os util/util.os util/message.os util/assert_util.os util/httpclient.os util/md5main.os util/base64.os util/concurrency/vars.os util/concurrency/task.os util/debug_util.os util/concurrency/thread_pool.os util/password.os util/version.os util/histogram.os util/concurrency/spin_lock.os util/text.os util/md5.os client/connpool.os client/dbclient.os client/dbclientcursor.os client/model.os client/syncclusterconnection.os s/shardconnection.os util/mmap_posix.os util/processinfo_linux2.os db/commands.os client/clientOnly.os client/gridfs.os s/d_util.os -L/usr/lib64 -L/lib64 -lboost_system-mt -lboost_thread-mt -lboost_filesystem-mt&lt;/p&gt;

&lt;p&gt;After this, my test mainline still runs cleanly, even with LD_BIND_NOW in the environment:&lt;/p&gt;

&lt;p&gt;mongo_libc_freeres$ LD_BIND_NOW=1 ./a.out &lt;br/&gt;
Hello, World&lt;/p&gt;

&lt;p&gt;And still shows no errors under valgrind.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04 x86_64</environment>
        <key id="12206">SERVER-1266</key>
            <summary>libmongoclient should not link with xulrunner&apos;s libmozjs, causes subtle memory errors</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="mike">Michael Dirolf</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 12:26:29 +0000</created>
                <updated>Tue, 12 Jul 2016 00:28:18 +0000</updated>
                            <resolved>Mon, 26 Jul 2010 15:09:37 +0000</resolved>
                                    <version>1.5.3</version>
                                    <fixVersion>1.5.7</fixVersion>
                                    <component>Internal Client</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="16210" author="acm" created="Tue, 27 Jul 2010 17:09:47 +0000"  >&lt;p&gt;Yep, working great now. Thanks!&lt;/p&gt;</comment>
                            <comment id="16204" author="mike" created="Tue, 27 Jul 2010 15:51:10 +0000"  >&lt;p&gt;there was a bug in the scons options handling where that invocation was not picking up the --full option. this should be fixed now, can you try again?&lt;/p&gt;

&lt;p&gt;thanks for the reports!&lt;/p&gt;</comment>
                            <comment id="16203" author="auto" created="Tue, 27 Jul 2010 15:50:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;mdirolf&apos;, &apos;name&apos;: &apos;Mike Dirolf&apos;, &apos;email&apos;: &apos;mike@10gen.com&apos;}
&lt;p&gt;Message: minor: use store_true for --sharedclient &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1266&quot; title=&quot;libmongoclient should not link with xulrunner&amp;#39;s libmozjs, causes subtle memory errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1266&quot;&gt;&lt;del&gt;SERVER-1266&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/eeb86f5ab90e9f8ae3e85b6ab7cf7b715bead021&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/eeb86f5ab90e9f8ae3e85b6ab7cf7b715bead021&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="16180" author="acm" created="Mon, 26 Jul 2010 22:03:39 +0000"  >&lt;p&gt;OK, I just tried:&lt;/p&gt;

&lt;p&gt;$ scons -c . ; scons -j 8 --prefix /home/acm/tmp/mongo-tmp-install --sharedclient --full install&lt;/p&gt;

&lt;p&gt;It does build libmongoclient.so in my current source dir, but neither it nor the headers make it to the prefix directory:&lt;/p&gt;

&lt;p&gt;$ cd /home/acm/tmp/mongo-tmp-install/&lt;br/&gt;
$ find . -type f&lt;br/&gt;
./bin/mongo&lt;br/&gt;
./bin/mongofiles&lt;br/&gt;
./bin/mongorestore&lt;br/&gt;
./bin/mongoimport&lt;br/&gt;
./bin/mongod&lt;br/&gt;
./bin/mongoexport&lt;br/&gt;
./bin/mongodump&lt;br/&gt;
./bin/mongos&lt;br/&gt;
./bin/mongosniff&lt;br/&gt;
./bin/mongostat&lt;/p&gt;

&lt;p&gt;Can I send you some build log or are there SCons flags that would get debugging output that would be useful to you?&lt;/p&gt;

&lt;p&gt;I&apos;m currently building from:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/mongodb/mongo/commit/127558c1c47f8df7fddd6a7408036eccdd3bf9ad&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/127558c1c47f8df7fddd6a7408036eccdd3bf9ad&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks. (And sorry for all the noise on this)&lt;/p&gt;</comment>
                            <comment id="16178" author="mike" created="Mon, 26 Jul 2010 21:45:00 +0000"  >&lt;p&gt;You should still be able to build w/o building the separate client directory first (although that should work too).&lt;/p&gt;

&lt;p&gt;There was an issue with --full that I just fixed, so can you try again? Should be something like:&lt;/p&gt;

&lt;p&gt;scons --prefix whatever --sharedclient --full install&lt;/p&gt;</comment>
                            <comment id="16177" author="acm" created="Mon, 26 Jul 2010 21:39:08 +0000"  >
&lt;p&gt;RE: --as-needed: awesome. Thanks.&lt;/p&gt;

&lt;p&gt;RE building and packaging: I understand that its hard to get the build system working for everyone. But I&apos;m confused about what I&apos;m supposed to do to get a build that includes both libmongoclient.so and the BSON headers from the current git tree.&lt;/p&gt;

&lt;p&gt;Do I need to do a two stage build, where I first build something with &apos;--prefix mongo-cxx-driver&apos;, and then build the driver from the resulting mongo-cxx-driver directory? Or should I still be able to build libmongoclient.so and the BSON headers directly from the tree?&lt;/p&gt;

&lt;p&gt;Because I&apos;ve tried all sorts of variations of &lt;/p&gt;

&lt;p&gt;scons --prefix &amp;lt;something&amp;gt; --sharedclient --full &amp;lt;install|mongoclient&amp;gt;&lt;/p&gt;

&lt;p&gt;and in no case do I get both a shared libmongoclient.so and the client headers copied to the prefix directory, despite being built in the source tree.&lt;/p&gt;</comment>
                            <comment id="16175" author="auto" created="Mon, 26 Jul 2010 21:18:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;erh&apos;, &apos;name&apos;: &apos;Eliot Horowitz&apos;, &apos;email&apos;: &apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1266&quot; title=&quot;libmongoclient should not link with xulrunner&amp;#39;s libmozjs, causes subtle memory errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1266&quot;&gt;&lt;del&gt;SERVER-1266&lt;/del&gt;&lt;/a&gt; -Wl,as-needed flag for shared library&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/a85b659bb6cc722a407e0fea6c39d2a523382a78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/a85b659bb6cc722a407e0fea6c39d2a523382a78&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="16174" author="eliot" created="Mon, 26 Jul 2010 21:17:42 +0000"  >&lt;p&gt;The problem comes down to supporting a build system for an infinite number of use cases.&lt;br/&gt;
The client has more places it needs to work - so splitting it out makes it easier for people.&lt;/p&gt;

&lt;p&gt;I added  &lt;del&gt;Wl,&lt;/del&gt;-as-needed -Wl,-zdefs for both builds.&lt;/p&gt;

&lt;p&gt;At some point we&apos;ll need to do some build system cleaning - but its hard given the complexity.&lt;/p&gt;</comment>
                            <comment id="16173" author="acm" created="Mon, 26 Jul 2010 21:04:58 +0000"  >
&lt;p&gt;Hmm. That is unfortunate. It is unlikely that we are going to switch to using your client tarball, since we already build our own debian packages from your main source tree, onto which we rebase our changes for &lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-1257&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://jira.mongodb.org/browse/SERVER-1257&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I guess I don&apos;t really understand why creating a separate client tarball is a better solution than fixing the build system: we really want to be able to build mongo, in all facets, from one source tree, then package the build artifacts into separate server, client, and -dev debian packages.&lt;/p&gt;

&lt;p&gt;Anyway, I guess we can also maintain our preferred fix for this issue, which is to use &lt;del&gt;Wl,&lt;/del&gt;-as-needed -Wl,-zdefs on the link line for libmongoclient.so, along with our debian packaging changes.&lt;/p&gt;



</comment>
                            <comment id="16171" author="mike" created="Mon, 26 Jul 2010 20:54:32 +0000"  >&lt;p&gt;Working on a fix for this now - thanks!&lt;/p&gt;

&lt;p&gt;Just as an FYI - the .so you get from a `scons --full --sharedclient install` will still link in libmozjs - to get around that you&apos;ll need to use the separate client tarball, see the case that eliot linked you to above.&lt;/p&gt;</comment>
                            <comment id="16170" author="acm" created="Mon, 26 Jul 2010 20:45:09 +0000"  >&lt;p&gt;OK:&lt;/p&gt;

&lt;p&gt;&apos;scons --full install&apos; does install the headers, libs, and binaries, but gets me a libmongoclient.a&lt;br/&gt;
&apos;scons --full install --sharedclient&apos; gets me only a &apos;bin&apos; directory, no headers, and notably, no library at all.&lt;/p&gt;

&lt;p&gt;So I can&apos;t seem to get both a shared library, and the headers + libs.&lt;/p&gt;

&lt;p&gt;Any ideas?&lt;/p&gt;
</comment>
                            <comment id="16161" author="mike" created="Mon, 26 Jul 2010 18:33:18 +0000"  >&lt;p&gt;should be able to do&lt;br/&gt;
scons --full install&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/mongodb/mongo/commit/b7358a8ea958a14c052cb5ca4ded2a6bcc8cb0e5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/b7358a8ea958a14c052cb5ca4ded2a6bcc8cb0e5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="16152" author="eliot" created="Mon, 26 Jul 2010 16:10:17 +0000"  >&lt;p&gt;We&apos;re going to add an option for a full/driver install in the main one.&lt;/p&gt;</comment>
                            <comment id="16151" author="acm" created="Mon, 26 Jul 2010 16:08:54 +0000"  >&lt;p&gt;Ah. Is that why I suddenly can&apos;t get the mongo build system to install the libmongoclient header files unless I call my &apos;prefix&apos; directory mongo-cxx-client?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/mongodb/mongo/blob/master/SConstruct#L494&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/blob/master/SConstruct#L494&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That seems a bit restrictive.&lt;/p&gt;</comment>
                            <comment id="16148" author="eliot" created="Mon, 26 Jul 2010 15:39:54 +0000"  >&lt;p&gt;We&apos;re going to package a separate c++ .tgz to keep things a bit cleaner for people who just want to use bson/c++ driver.&lt;br/&gt;
First version should be up soon&lt;br/&gt;
SEE: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1355&quot; title=&quot;separate c++ client tarball&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1355&quot;&gt;&lt;del&gt;SERVER-1355&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="16147" author="acm" created="Mon, 26 Jul 2010 15:24:48 +0000"  >&lt;p&gt;I just tried to build client libraries against &lt;a href=&quot;http://github.com/mongodb/mongo/commit/3083c08000747ec21ed5d723fa444ae698b4108a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/3083c08000747ec21ed5d723fa444ae698b4108a&lt;/a&gt; as follows:&lt;/p&gt;

&lt;p&gt;scons --prefix ~/tmp/mongo-tmp-install --release --nostrip --sharedclient mongoclient&lt;/p&gt;

&lt;p&gt;which is failing as follows:&lt;/p&gt;

&lt;p&gt;scons: Reading SConscript files ...&lt;br/&gt;
scons version: 1.2.0.d20100117&lt;br/&gt;
python version: 2 6 5 &apos;final&apos; 0&lt;br/&gt;
Checking whether the C++ compiler worksyes&lt;br/&gt;
Checking for C library stdc++... yes&lt;br/&gt;
Checking for C++ header file pcrecpp.h... yes&lt;br/&gt;
Checking for C++ header file boost/filesystem/operations.hpp... yes&lt;br/&gt;
Checking for C++ header file execinfo.h... yes&lt;br/&gt;
ERROR: can&apos;t find static version of: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;mozjs&amp;#39;, &amp;#39;js&amp;#39;, &amp;#39;js_static&amp;#39;&amp;#93;&lt;/span&gt; in: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;/usr/lib64/xulrunner-1.9.2.7&amp;#39;, &amp;#39;/usr/lib64&amp;#39;, &amp;#39;/lib64&amp;#39;, &amp;#39;/usr/lib&amp;#39;, &amp;#39;/usr/local/lib&amp;#39;&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m not sure why it would be looking for static versions of mozjs when building the shared client libraries.&lt;/p&gt;

&lt;p&gt;Also, I&apos;m not sure what the &apos;new C++ driver thing / separate client tarball&apos; comments are referring to. &lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;
</comment>
                            <comment id="16146" author="mike" created="Mon, 26 Jul 2010 15:09:37 +0000"  >&lt;p&gt;no longer links in libmozjs w/ the separate client tarball.&lt;/p&gt;</comment>
                            <comment id="16122" author="eliot" created="Sat, 24 Jul 2010 22:45:28 +0000"  >&lt;p&gt;With the new c++ driver thing - this should be automatic - but this is just a sanity check.&lt;br/&gt;
resolve when you confirm.&lt;/p&gt;</comment>
                            <comment id="15284" author="acm" created="Thu, 1 Jul 2010 16:16:07 +0000"  >&lt;p&gt;So, obviously, this is really only a problem when building libmongoclient as a shared library. However, building it as a shared object is what we want to do, so:&lt;/p&gt;

&lt;p&gt;We looked into updating the sconscript so that libmongoclient didn&apos;t link libmozjs.so, but that turned out to be rather difficult given the architecture of the sconscript. As a workaround, at least when the linker is a binutils ld (bfd or gold), one solution is to add  &apos;&lt;del&gt;Wl,&lt;/del&gt;-as-needed&apos; to the link line. With this flag, link artifacts will only record DT_NEEDED entries for libraries from which a symbol was actually resolved at link time. So, since libmongoclient.so doesn&apos;t actually have any dependencies on libmozjs.so, it doesn&apos;t end up with a DT_NEEDED entry even though -lmozjs is on the link line, and libmozjs.so therefore doesn&apos;t get pulled into the address space of processes which link libmongoclient.so.&lt;/p&gt;

&lt;p&gt;I&apos;d recommend though, if building with &lt;del&gt;Wl,&lt;/del&gt;-as-needed, to also build with -Wl,-zdefs, which is just about always the right thing to do when building a shared library.&lt;/p&gt;

&lt;p&gt;So my recommended fix for this is to enable &lt;del&gt;Wl,&lt;/del&gt;-as-needed -Wl,-zdefs on the link line if libmongoclient is to be built as a shared object on a platform using GNU ld.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="12337">SERVER-1355</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>19.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sat, 24 Jul 2010 22:45:28 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 30 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-1355'>SERVER-1355</a></s>]]></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>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 30 weeks, 1 day 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>mike</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpl2f:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21982</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|hrku6f:</customfieldvalue>

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