Re: static && non-static libraries, duplicated symbols, core
- From: asclearuc@xxxxxxxxx
- Date: Sat, 17 May 2008 12:04:58 -0700 (PDT)
Hello
Thank you for prompt answer
Thank you for the clue - but let me give you more information, so
correct solution could be fount quicker
Cause looks like I need to be enlighten :)
First of all - please excuse me - this letter would be quite long ;)
Second - some questions on your ideas:
Sure. There are several ways: you could rename all symbols via some
macro, or via objcopy; or you could link with archive versions of
xerces and xalan, and then make sure they are not exported from
your executable via version script.
1. To rename - in my application? or in 3rd party library (I'm quite
new to objcopy)? What options do you advise
2. may it won't be required? May be correct version script would help
3. may be correct gcc/g++/ld options would help?
The OS
[asclearuc@otcdev4 ~/distro/lib32]$ uname -a
Linux otcdev4.sriinfotech.com 2.6.9-67.0.1.ELsmp #1 SMP Fri Nov 30
11:57:43 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
The library
[asclearuc@otcdev4 ~/distro/lib32]$ ls -l libsw_api.so
-rw-r--r-- 1 asclearuc asclearuc 49539036 May 13 12:48 libsw_api.so
Library does not depend on xerces/xalan
[asclearuc@otcdev4 ~/distro/lib32]$ ldd libsw_api.so
linux-gate.so.1 => (0xffffe000)
libnsl.so.1 => /lib/libnsl.so.1 (0xf5078000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xf5066000)
libc.so.6 => /lib/tls/libc.so.6 (0xf4f3a000)
librt.so.1 => /lib/tls/librt.so.1 (0xf4f26000)
libm.so.6 => /lib/tls/libm.so.6 (0xf4f03000)
libdl.so.2 => /lib/libdl.so.2 (0xf4efe000)
/lib/ld-linux.so.2 (0x56555000)
Library export only its OWN symbols
[asclearuc@otcdev4 ~/distro/lib32]$ nm -g libsw_api.so
0000000000f28090 T SW_AllocateString
0000000001401240 T SW_BatchAck
00000000014002a0 T SW_BatchGetDetails
00000000013ff420 T SW_BatchGetOutstanding
0000000000f0cbd0 T SW_BrokeredDealGetInfo
0000000000f15b10 T SW_BrokeredDealGetPickupIdentityByRecipient
0000000000f1aa10 T SW_BrokeredDealGetRecipientIDs
0000000000f111b0 T SW_BrokeredDealGetRecipientXML
0000000000f18290 T SW_BrokeredDealGetRejectReasonByRecipient
0000000000f0acf0 T SW_BrokeredDealGetState
[skipped]
The interesting fact for me - that THERE ARE NO other symbols excepts
3rd party API calls
Could smbd ENLIGHT me how this was done? may be it is a solution for
me?
[asclearuc@otcdev4 ~/distro/lib32]$ nm libsw_api.so | grep -v SW_
[asclearuc@otcdev4 ~/distro/lib32]$
I myself use version script which looks like next:
libXSLRP.so.1.1
{
global:
XSLRPInitialize ;
XSLRPDeinitialize;
XSLRPIsInitialized;
[skip]
local:
*;
};
For my libraries, smth is declared as ...
For example, for library that uses xalan/xerces:
[asclearuc@otcdev4 ~/projects/service_app/service_app-200805132045-
swapswire/out/outRelease64/xslrp]$ ldd libXSLRP.so
libxalan-c.so.110 => /home/otcapp/lib/lib64/libxalan-c.so.110
(0x0000002a95672000)
libxerces-c.so.27 => /home/otcapp/lib/lib64/libxerces-c.so.27
(0x0000002a95c75000)
libpthread.so.0 => /lib64/tls/libpthread.so.0
(0x0000002a961b2000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000002a962c8000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6
(0x0000002a963cb000)
libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a965bb000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000002a96742000)
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a9684f000)
libxalanMsg.so.110 => /home/otcapp/lib/lib64/libxalanMsg.so.
110 (0x0000002a96a84000)
/lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)
[asclearuc@otcdev4 ~/projects/service_app/service_app-200805132045-
swapswire/out/outRelease64/xslrp]$ nm libXSLRP.so
U __assert_fail@@GLIBC_2.2.5
U atoi@@GLIBC_2.2.5
0000000000119950 a __bss_start
0000000000004990 t call_gmon_start
U close@@GLIBC_2.2.5
0000000000119960 b completed.1
0000000000119018 d __CTOR_END__
0000000000119000 d __CTOR_LIST__
U __cxa_allocate_exception@@CXXABI_1.3
U __cxa_atexit@@GLIBC_2.2.5
U __cxa_begin_catch@@CXXABI_1.3
U __cxa_call_unexpected@@CXXABI_1.3
U __cxa_end_catch@@CXXABI_1.3
w __cxa_finalize@@GLIBC_2.2.5
U __cxa_rethrow@@CXXABI_1.3
U __cxa_throw@@CXXABI_1.3
U dlerror@@GLIBC_2.2.5
U dlopen@@GLIBC_2.2.5
00000000000128d0 t __do_global_ctors_aux
00000000000049b0 t __do_global_dtors_aux
0000000000119820 d __dso_handle
0000000000119028 d __DTOR_END__
0000000000119020 d __DTOR_LIST__
0000000000119870 d DW.ref.__gxx_personality_v0
0000000000119898 d DW.ref._ZTIN11xalanc_1_1012XSLExceptionE
0000000000119948 d DW.ref._ZTIN8datetime5ErrorE
0000000000119940 d DW.ref._ZTIN8datetime7InvalidE
0000000000119890 d DW.ref._ZTISt9bad_alloc
0000000000119088 a _DYNAMIC
0000000000119950 a _edata
0000000000119a48 a _end
U __errno_location@@GLIBC_2.2.5
U fclose@@GLIBC_2.2.5
U fflush@@GLIBC_2.2.5
0000000000012908 t _fini
000000000000502c t flushCallback
U fopen@@GLIBC_2.2.5
U fprintf@@GLIBC_2.2.5
0000000000004a00 t frame_dummy
0000000000017808 r __FRAME_END__
U fread@@GLIBC_2.2.5
U free@@GLIBC_2.2.5
U g_DebugLogger
0000000000119968 b g_DebugLoggerPtr
[skip]
3rd party Library has xerces inside (the same could be done to prove
that xalan is inside)
[asclearuc@otcdev4 ~/distro/lib32]$ nm -D libsw_api.so | c++filt |
grep xerces | grep -v xalan
0000000002f3e688 V guard variable for void boost::function1<void,
xercesc_2_7::DOMNode*, _STL::allocator<boost::function_base>
::assign_to<boost::_bi::bind_t<void, boost::_mfi::mf1<void,SwapsWire::XML::XercesParser, xercesc_2_7::DOMNode*>,
boost::_bi::list2<boost::_bi::value<SwapsWire::XML::XercesParser*>,
boost::arg<1> (*)()> > >(boost::_bi::bind_t<void,
boost::_mfi::mf1<void, SwapsWire::XML::XercesParser,
xercesc_2_7::DOMNode*>,
boost::_bi::list2<boost::_bi::value<SwapsWire::XML::XercesParser*>,
boost::arg<1> (*)()> >)::stored_vtable
000000000269f4b8 W xercesc_2_7::Attributes::~Attributes()
000000000269f49a W xercesc_2_7::Attributes::~Attributes()
000000000271aef6 T xercesc_2_7::CMBinaryOp::getLeft()
000000000271af0e T xercesc_2_7::CMBinaryOp::getRight()
000000000271a9f0 T
xercesc_2_7::CMBinaryOp::CMBinaryOp(xercesc_2_7::ContentSpecNode::NodeTypes,
xercesc_2_7::CMNode*, xercesc_2_7::CMNode*,
xercesc_2_7::MemoryManager*)
000000000271a888 T
xercesc_2_7::CMBinaryOp::CMBinaryOp(xercesc_2_7::ContentSpecNode::NodeTypes,
xercesc_2_7::CMNode*, xercesc_2_7::CMNode*,
xercesc_2_7::MemoryManager*)
000000000271adac T xercesc_2_7::CMBinaryOp::~CMBinaryOp()
000000000271ac82 T xercesc_2_7::CMBinaryOp::~CMBinaryOp()
000000000271ab58 T xercesc_2_7::CMBinaryOp::~CMBinaryOp()
[skipped]
One more output - BUT THIS TIME OUTPUT LOOKS INTERESTING FOR ME
(~SAXParser is declared 3 times as TEXT)
[asclearuc@otcdev4 ~/distro/lib32]$ nm -D libsw_api.so | c++filt |
grep xerces | grep -v xalan | grep ~SAXParser
00000000025d22fc T xercesc_2_7::SAXParser::~SAXParser()
00000000025d21be T xercesc_2_7::SAXParser::~SAXParser()
00000000025d2080 T xercesc_2_7::SAXParser::~SAXParser()
00000000025d47ac W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d474c W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d4794 W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d4734 W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d47dc W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d477c W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d47c4 W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
00000000025d4764 W non-virtual thunk to
xercesc_2_7::SAXParser::~SAXParser()
Core stack:
[asclearuc@otcdev4 ~/tests/service_test_area/service32/bin]$ gdb
otcservice core.22602
GNU gdb Red Hat Linux (6.3.0.0-1.153.el4_6.1rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
Core was generated by `otcservice.SwapsWire -conf ../cfg/
otcservice_SwapsWire.ini'.
Program terminated with signal 11, Segmentation fault.
warning: svr4_current_sos: Can't read pathname for load map: Input/
output error
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libXSLRP.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libXSLRP.so
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libDBAPI.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libDBAPI.so
Reading symbols from /home/asclearuc/distro/lib32/libxalan-c.so.
110...done.
Loaded symbols for /home/asclearuc/distro/lib32/libxalan-c.so.110
Reading symbols from /home/asclearuc/distro/lib32/libxerces-c.so.
27...done.
Loaded symbols for /home/asclearuc/distro/lib32/libxerces-c.so.27
Reading symbols from /home/asclearuc/distro/lib32/libxalanMsg.so.
110...done.
Loaded symbols for /home/asclearuc/distro/lib32/libxalanMsg.so.110
Reading symbols from /lib/tls/libpthread.so.0...done.
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libSQLExecConnection.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libSQLExecConnection.so
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libSQLExecutor.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libSQLExecutor.so
Reading symbols from /home/asclearuc/distro/lib32/
libsqlapi.so...done.
Loaded symbols for /home/asclearuc/distro/lib32/libsqlapi.so
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libServiceStatusModule.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libServiceStatusModule.so
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libWebRequests.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libWebRequests.so
Reading symbols from /home/asclearuc/tests/service_test_area/
service32/bin/libSwapswire.so...done.
Loaded symbols for /home/asclearuc/tests/service_test_area/service32/
bin/libSwapswire.so
Reading symbols from /home/asclearuc/distro/lib32/
libsw_api.so...done.
Loaded symbols for /home/asclearuc/distro/lib32/libsw_api.so
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/tls/librt.so.1...done.
Loaded symbols for /lib/tls/librt.so.1
Reading symbols from /otc/oracle/product/10.2.0/db_1/lib32/
libclntsh.so...done.
Loaded symbols for /otc/oracle/product/10.2.0/db_1/lib32/libclntsh.so
Reading symbols from /otc/oracle/product/10.2.0/db_1/lib32/
libnnz10.so...done.
Loaded symbols for /otc/oracle/product/10.2.0/db_1/lib32/libnnz10.so
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
#0 0x00176f6d in std::ostream::flush () from /usr/lib/libstdc++.so.6
(gdb) where
#0 0x00176f6d in std::ostream::flush () from /usr/lib/libstdc++.so.6
#1 0x0015b0b1 in std::istream::sentry::sentry () from /usr/lib/
libstdc++.so.6
#2 0x0015bb44 in std::istream::read () from /usr/lib/libstdc++.so.6
#3 0xf7c6aa7b in xalanc_1_10::StdBinInputStream::readBytes () from /
home/asclearuc/distro/lib32/libxalan-c.so.110
#4 0xf79ef61a in xercesc_2_7::XMLReader::refreshRawBuffer () from /
home/asclearuc/distro/lib32/libxerces-c.so.27
#5 0xf79ec962 in xercesc_2_7::XMLReader::XMLReader () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#6 0xf7964434 in xercesc_2_7::ReaderMgr::createReader () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#7 0xf7935a40 in xercesc_2_7::IGXMLScanner::scanReset () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#8 0xf793b934 in xercesc_2_7::IGXMLScanner::scanDocument () from /
home/asclearuc/distro/lib32/libxerces-c.so.27
#9 0xf797a5af in xercesc_2_7::SAXParser::parse () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#10 0xf7d5f82f in xalanc_1_10::XercesParserLiaison::parseXMLStream ()
from /home/asclearuc/distro/lib32/libxalan-c.so.110
#11 0xf7d990fa in
xalanc_1_10::XalanSourceTreeParserLiaison::parseXMLStream () from /
home/asclearuc/distro/lib32/libxalan-c.so.110
#12 0xf7ebcdd5 in xalanc_1_10::XSLTEngineImpl::processStyle*** ()
from /home/asclearuc/distro/lib32/libxalan-c.so.110
#13 0xf7ed20e3 in
xalanc_1_10::XalanCompiledStylesheetDefault::XalanCompiledStylesheetDefault
() from /home/asclearuc/distro/lib32/libxalan-c.so.110
#14 0xf7ed2356 in xalanc_1_10::XalanCompiledStylesheetDefault::create
() from /home/asclearuc/distro/lib32/libxalan-c.so.110
#15 0xf7ed8076 in xalanc_1_10::XalanTransformer::compileStyle*** ()
from /home/asclearuc/distro/lib32/libxalan-c.so.110
#16 0xf63694cd in SW_QueryDeals () from /home/asclearuc/distro/lib32/
libsw_api.so
#17 0xf565146b in SW_QueryDeals () from /home/asclearuc/distro/lib32/
libsw_api.so
#18 0xf565aa5b in SW_QueryDeals () from /home/asclearuc/distro/lib32/
libsw_api.so
#19 0xf509e594 in SW_DealTerminate () from /home/asclearuc/distro/
lib32/libsw_api.so
#20 0xf5591c88 in SW_Login () from /home/asclearuc/distro/lib32/
libsw_api.so
#21 0xf70f31ed in SwapswireModuleManager::queryDeals
(this=0xf7116c20, dateTime=@0xf3d4b630)
at ../../../OTCDeriv/Modules/Swapswire/SwapswireModuleManager.cpp:
555
#22 0xf70f1937 in SwapswireModuleManager::ExecuteRequestBinEx
(this=0xf7116c20, hHandle=0, serv_context=0xf3d4b7e0,
request=0x814ae64 "Stage1", flags=0,
output=0xf3d4c068, nOutLen=0xf3d4c060, error=0xf3d4c064)
at ../../../OTCDeriv/Modules/Swapswire/SwapswireModuleManager.cpp:243
#23 0xf70ef1d3 in ModAPI_ExecuteRequestBinEx (hHandle=0,
serv_context=0xf3d4b7e0, request=0x814ae64 "Stage1", flags=0,
output=0xf3d4c068,
nOutLen=0xf3d4c060, error=0xf3d4c064) at ../../../OTCDeriv/
Modules/Swapswire/SwapswireAPI.cpp:72
#24 0x0809df4f in Module::ExecuteRequestBinEx (this=0x82215f8,
hHandle=0, serv_context=0xf3d4b7e0, szRequest=0x814ae64 "Stage1",
flags=0,
pReply=0xf3d4c068, nOutLen=0xf3d4c060, pszError=0xf3d4c064)
at ../../../ModuleAPI/servicecontext/ModuleProxyExec.cpp:154
#25 0x0809d79e in ModuleProxy::ExecuteRequestBinEx
(szModuleName=0x81c28ac "Swapswire", hHandle=0,
serv_context=0xf3d4b7e0, szRequest=0x814ae64 "Stage1",
flags=0, pReply=0xf3d4c068, nOutLen=0xf3d4c060,
pszError=0xf3d4c064) at ../../../ModuleAPI/servicecontext/
ModuleProxyExec.cpp:64
#26 0x080be86a in StageProcessor::ExecuteMessage (this=0x81c28e0,
message=0x81c6120, penv=@0xf3d4c100, results=@0xf3d4c0d0,
bSuccess=@0xf3d4c117,
pContext=0x0) at ../../../cinclude/QueueInclude/
StageProcessor.cpp:73
#27 0x080736d0 in
BaseMessageProcessor<IProcessingEnv>::ProcessMessage (this=0x81c28e0,
message=0x81c6120, pContext=0x0)
at ../../../cinclude/QueueInclude/BaseMessageProcessor.h:42
#28 0x080f5247 in BaseProcessingManager::ProcessMessage
(this=0x81a2498, message=0x81c6120, pContext=0x0)
at ../../../cinclude/QueueInclude/BaseProcessingManager.cpp:176
#29 0x080e96cf in BaseMessageQueue::ProcessMessage (this=0x81a2968,
message=0x81c6120, pContext=0x0)
at ../../../cinclude/QueueInclude/BaseMessageQueue.cpp:219
#30 0x080ee25c in SpokeProcQueueTask::Execute (this=0x81c3638,
pContext=0x0) at ../../../cinclude/QueueInclude/SpokeProcQueue.cpp:25
#31 0x08119c6d in WorkerThread::Run (this=0x81a3220) at ../../../
cinclude/ThreadPool.cpp:70
#32 0x0811a61d in WorkerThread::_ExecuteWorkerThread
(workerTh=0x81a3220) at ../../../cinclude/ThreadPool.cpp:170
#33 0x00ac63cc in start_thread () from /lib/tls/libpthread.so.0
#34 0x00a1f1ae in clone () from /lib/tls/libc.so.6
(gdb) info shared
From To Syms Read Shared Object Library
0xf7fe75d0 0xf7ff6504 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libXSLRP.so
0xf7fa2f70 0xf7fd1fc4 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libDBAPI.so
0xf7c50534 0xf7f02b0c Yes /home/asclearuc/distro/lib32/
libxalan-c.so.110
0xf7899f34 0xf7a293b0 Yes /home/asclearuc/distro/lib32/
libxerces-c.so.27
0xf7774a60 0xf7774b84 Yes /home/asclearuc/distro/lib32/
libxalanMsg.so.110
0x00ac52d0 0x00acd8b8 Yes /lib/tls/libpthread.so.0
0x00a84bb0 0x00a858c4 Yes /lib/libdl.so.2
0x0013ec30 0x001a7188 Yes /usr/lib/libstdc++.so.6
0x00a8d300 0x00aa65a4 Yes /lib/tls/libm.so.6
0x00ad67e8 0x00add12c Yes /lib/libgcc_s.so.1
0x0096abc0 0x00a5d370 Yes /lib/tls/libc.so.6
0x0093c7a0 0x0094ebdf Yes /lib/ld-linux.so.2
0xf73393d0 0xf7344de4 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libSQLExecConnection.so
0xf7315900 0xf732d1f4 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libSQLExecutor.so
0xf728dcb0 0xf72e0014 Yes /home/asclearuc/distro/lib32/
libsqlapi.so
0xf7153760 0xf7165af4 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libServiceStatusModule.so
0xf711c330 0xf7142204 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libWebRequests.so
0xf70eef00 0xf710c5a4 Yes /home/asclearuc/tests/
service_test_area/service32/bin/libSwapswire.so
0xf508af20 0xf694d420 Yes /home/asclearuc/distro/lib32/
libsw_api.so
0xf41688d0 0xf4176218 Yes /lib/libnsl.so.1
0xf41530d0 0xf415866c Yes /lib/tls/librt.so.1
0xf2fc9040 0xf3b10ec4 Yes /otc/oracle/product/10.2.0/db_1/
lib32/libclntsh.so
0xf2d0d6c0 0xf2e745a4 Yes /otc/oracle/product/10.2.0/db_1/
lib32/libnnz10.so
0xf2b9eb10 0xf2ba597c Yes /lib/libnss_files.so.2
0xef1d2dc0 0xef1d51c8 Yes /lib/libnss_dns.so.2
0x008ce3f0 0x008d9ecc Yes /lib/libresolv.so.2
Taking all these into consideration - could smbd enlight me what to
do?
Looks like an option should be used at compile/link stage - but what
option?
And how :)
Tx
On May 17, 10:43 am, Paul Pluzhnikov <ppluzhnikov-...@xxxxxxxxx>
wrote:
asclea...@xxxxxxxxx writes:
I have one commercial SO library which I need to use.
This library IS STATICALLY LINKED with libxerces-c.a && libxalan-c.a
(according to nm it has xerces && xalan inside).
This library DOES NOT export anything, except its own API calls
(according to nm).
It's not clear that you are interpreting output of 'nm' correctly.
Exactly how did you come to the conclusion above?
I do not have any sources of this library, and do not know how it was
compiled
According to nm - xerces is 2.7 && xalan 1.10
Same question: what exactly did 'nm' tell you, and how did you come
to the conclusion above?
On the other hand, I do have my program which has to use this library
(it loads it using dlopen)
The program also uses xerces 2.7 && xalan 1.10 (tested distrubution
for RH, downloaded from apache)
The problem is - the program crashes on the same API call of
commercial library (most probaly this call does some XML parsing).
And according to the core - stack dump is permanently the same
(gdb) where
#0 0x00176f6d in std::ostream::flush () from /usr/lib/libstdc++.so.6
#1 0x0015b0b1 in std::istream::sentry::sentry () from /usr/lib/libstdc
++.so.6
#2 0x0015bb44 in std::istream::read () from /usr/lib/libstdc++.so.6
#3 0xf7c6aa7b in xalanc_1_10::StdBinInputStream::readBytes () from /
home/asclearuc/distro/lib32/libxalan-c.so.110
#4 0xf79ef61a in xercesc_2_7::XMLReader::refreshRawBuffer () from /
home/asclearuc/distro/lib32/libxerces-c.so.27
#5 0xf79ec962 in xercesc_2_7::XMLReader::XMLReader () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#6 0xf7964434 in xercesc_2_7::ReaderMgr::createReader () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#7 0xf7935a40 in xercesc_2_7::IGXMLScanner::scanReset () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
#8 0xf793b934 in xercesc_2_7::IGXMLScanner::scanDocument () from /
home/asclearuc/distro/lib32/libxerces-c.so.27
#9 0xf797a5af in xercesc_2_7::SAXParser::parse () from /home/
asclearuc/distro/lib32/libxerces-c.so.27
Where is the rest of the stack?
What does gdb 'info shared' say?
Also, it looks like xalan/xerces libraries are mine:
Reading symbols from /home/asclearuc/distro/lib32/libxalan-c.so.
110...done.
Loaded symbols for /home/asclearuc/distro/lib32/libxalan-c.so.110
Reading symbols from /home/asclearuc/distro/lib32/libxerces-c.so.
27...done.
Loaded symbols for /home/asclearuc/distro/lib32/libxerces-c.so.27
If this commercial library is disabled - all works fine (other
libraries are loaded, XMLs are parsed && transformed using xalan) -
all works perfect
So, my idea is that the core is because xerces && xalan libraries are
duplicated present in the process image.
That's one (but not the only one) possible explanation.
THE QUESTION:
Is it possible for me (for example - using some linker optons) to
control access to the xerces && xalan
I mean - to disable access to my xerces/xalan from commercial library?
Sure. There are several ways: you could rename all symbols via some
macro, or via objcopy; or you could link with archive versions of
xerces and xalan, and then make sure they are not exported from
your executable via version script.
Unfortunatelly - I can't do anything to change commercial library
It might be easier to rename xerces/xalan functions inside that
library (via objcopy).
But I would first advise you to understand your problem, rather
than trying "random" fixes. For example, you can find out which
version of g++ the commercial library was compiled with.
Are you using the same version? If not, that's likely the answer
right there :(
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.
- Follow-Ups:
- Re: static && non-static libraries, duplicated symbols, core
- From: Jan Engelhardt
- Re: static && non-static libraries, duplicated symbols, core
- References:
- static && non-static libraries, duplicated symbols, core
- From: asclearuc
- Re: static && non-static libraries, duplicated symbols, core
- From: Paul Pluzhnikov
- static && non-static libraries, duplicated symbols, core
- Prev by Date: Re: file descriptors are not being free even after closing the socket connection..
- Next by Date: Re: socket behavior - already bound
- Previous by thread: Re: static && non-static libraries, duplicated symbols, core
- Next by thread: Re: static && non-static libraries, duplicated symbols, core
- Index(es):