[SERVER-9786] Missing external symbol strcasestr on Solaris 10 Created: 27/May/13  Updated: 11/Jul/16  Resolved: 17/Jun/13

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.4.3
Fix Version/s: 2.4.6, 2.5.1

Type: Bug Priority: Major - P3
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris 10


Issue Links:
Depends
is depended on by SERVER-9761 Mongo executables should be built wit... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: Solaris
Participants:

 Description   

Along with backtrace (SERVER-7080) and posix_fadvise (SERVER-7404), there is an unresolved symbol "strcasestr" on Solaris 10 in mongod version 2.4.

~/mongodb-sunos5-x86_64-2.4.3/bin
$ env LD_LIBRARY_PATH=. ldd -r ./mongod
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libresolv.so.2 =>        /lib/64/libresolv.so.2
        librt.so.1 =>    /lib/64/librt.so.1
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libstdc++.so.6 =>        ./libstdc++.so.6
        libm.so.2 =>     /lib/64/libm.so.2
        libgcc_s.so.1 =>         ./libgcc_s.so.1
        libpthread.so.1 =>       /lib/64/libpthread.so.1
        libc.so.1 =>     /lib/64/libc.so.1
        libaio.so.1 =>   /lib/64/libaio.so.1
        libmd.so.1 =>    /lib/64/libmd.so.1
        libmp.so.2 =>    /lib/64/libmp.so.2
        libscf.so.1 =>   /lib/64/libscf.so.1
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        symbol not found: posix_fadvise         (mongod)
        symbol not found: strcasestr            (mongod)
        symbol not found: backtrace             (mongod)
        symbol not found: backtrace_symbols_fd          (mongod)
        symbol not found: backtrace_symbols             (mongod)

The symbol is referenced from src/mongo/db/fts/fts_matcher.cpp line 241. The code has a workaround for Windows (#ifdef _WIN32) but otherwise assumes that the routine is available.



 Comments   
Comment by auto [ 18/Jul/13 ]

Author:

{u'username': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9786 Visual Studio – add strcasestr.

{cpp,h}

Branch: v2.4
https://github.com/mongodb/mongo/commit/b1d2d93414998318b12308ffabb55e14369e7558

Comment by auto [ 17/Jul/13 ]

Author:

{u'username': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9786 Link to strcasestr at runtime for Solaris

For the Solaris/SmartOS build, do not make direct calls to strcasestr,
which is present in Solaris 11 but not in Solaris 10. Instead, see if
it is available in a loaded library (which will be libc.so.1) at runtime
and either call it or call an emulation. Use the emulated version on
Windows, which is also missing this function.
Branch: v2.4
https://github.com/mongodb/mongo/commit/e1320f91ee711c64f6b00482b23e21fa496f4b5b

Comment by auto [ 17/Jun/13 ]

Author:

{u'username': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9786 Link to strcasestr at runtime for Solaris

For the Solaris/SmartOS build, do not make direct calls to strcasestr,
which is present in Solaris 11 but not in Solaris 10. Instead, see if
it is available in a loaded library (which will be libc.so.1) at runtime
and either call it or call an emulation. Use the emulated version on
Windows, which is also missing this function.
Branch: master
https://github.com/mongodb/mongo/commit/75b4cddd29af46fb3902fd5a064bb7093fe68bea

Generated at Thu Feb 08 03:21:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.