473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

libs compilation

We have a program, that was previous compiled by another people.
We develop a library that this program loads.

We have experience craches in this program. Looking at the gdb we
find:

#0 0xc020cc68 in kill+0x10 () from /usr/lib/libc.2
#1 0xc01a72a4 in raise+0x24 () from /usr/lib/libc.2
#2 0xc01e85f8 in abort_C+0x160 () from /usr/lib/libc.2
#3 0xc01e8654 in abort+0x1c () from /usr/lib/libc.2
#4 0xc04d3a78 in terminate+0x38 () from /usr/lib/libCsup.2
#5 0xc04cd904 in TCompTechCleanupAutomaticLocal::DestructActiveObje ct
+0x80 () from /usr/lib/libCsup.2
#6 0xc04d131c in TExceptionActionCleanup::ProcessThrow+0x24 () from /
usr/lib/libCsup.2
#7 0xc04d4010 in ThrowException+0x158 () from /usr/lib/libCsup.2
#8 0xc04d4478 in __throw__FPvT1+0x14c () from /usr/lib/libCsup.2
#9 0xd471f6e0 in
std::basic_string<char,std::char_traits<char>,std: :allocator<char>>::operator=
+0xb8 ()
from /appl/objectel/Objectel_2.9/bin/ObjectelCommands
#10 0xd41da7b0 in __ct__16SecurityServicesFPCcN21_2+0x478 () from /
appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#11 0xd38b04d4 in AgCServerSROP::UPSVerifyLoginInformation+0x114 ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#12 0xd38b2058 in AgCServerSROP::UPSPerformGetUserProfile+0x228 ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#13 0xd38af644 in AgCServerSROP::PerformLogin+0xb54 () from /appl/
objectel/Objectel_2.9/bin/libAG2SLIB.sl
#14 0xd391fef0 in AgpProcessSROPRequest+0x278 () from /appl/objectel/
Objectel_2.9/bin/libAG2SLIB.sl
#15 0xaeaa8 in singleUserThread+0x4a8 ()
#16 0xc005b2e4 in __pthread_body+0x44 () from /usr/lib/libpthread.1
#17 0xc0065574 in __pthread_start+0x14 () from /usr/lib/libpthread.1

This is happens because we use the string class from STL in our
library. This problem do not occorus where we do not use std::string.

We are compiling our code with the directive -AA and by using this
directive it implies the following:

-AA Turns on newly supported ANSI C++ Standard
features
like namespace std and the new C++ Standard
Library.
This option also implies -Aa. Include paths are
changed to include_std and libraries are
libCsup_v2 and
libstd_v2.
NOTE: Objects and libraries compiled with -AA are
binary incompatible with objects and libraries
compiled
without -AA.

As we could see the program uses the libCsup_v2 as well as the libCsup
libraries which are incompatible by -AA (we see that using ldd)

The lib libCsup comes from the xerces library.

We try recompiles the xerces library using +AA option and the gdb
backtrace stay like:
#0 0x680a6c68 in kill+0x10 () from /usr/lib/libc.2
#1 0x680412a4 in raise+0x24 () from /usr/lib/libc.2
#2 0x680825f8 in abort_C+0x160 () from /usr/lib/libc.2
#3 0x68082654 in abort+0x1c () from /usr/lib/libc.2
#4 0x651d2a78 in terminate+0x38 () from /usr/lib/libCsup.2
#5 0x651cceb0 in
TCompTechCleanupMemberInCtorDtor::DestructActiveOb ject+0x74 () from /
usr/lib/libCsup.2
#6 0x651d031c in TExceptionActionCleanup::ProcessThrow+0x24 () from /
usr/lib/libCsup.2
#7 0x651d3010 in ThrowException+0x158 () from /usr/lib/libCsup.2
#8 0x651d3478 in __throw__FPvT1+0x14c () from /usr/lib/libCsup.2
#9 0xabc48 in
std::basic_string<char,std::char_traits<char>,std: :allocator<char>>::_C_unlink
+0xb0 ()
#10 0x65698664 in SecurityServices::~SecurityServices+0x64 () from /
appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#11 0x651cc8ec in TCompTechCleanupAutomaticLocal::DestructActiveObje ct
+0x68 () from /usr/lib/libCsup.2
#12 0x651d031c in TExceptionActionCleanup::ProcessThrow+0x24 () from /
usr/lib/libCsup.2
#13 0x651d3010 in ThrowException+0x158 () from /usr/lib/libCsup.2
#14 0x651d3478 in __throw__FPvT1+0x14c () from /usr/lib/libCsup.2
#15 0x6563f9b0 in
std::basic_string<char,std::char_traits<char>,std: :allocator<char>>::basic_string<char,std::char_tra its<char>,std::allocator<char>>
+0xc0 () from /appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#16 0x6569d14c in SecurityServices::SendRecvXML+0x9c () from /appl/
objectel/Objectel_2.9/bin/libAG2LIB.sl
#17 0x6569b134 in SecurityServices::GetBool+0xac () from /appl/
objectel/Objectel_2.9/bin/libAG2LIB.sl
#18 0x6569a37c in SecurityServices::AuthenticateUser+0x38c () from /
appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#19 0x657a74ec in AgCServerSROP::UPSVerifyLoginInformation+0x12c ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#20 0x657a9058 in AgCServerSROP::UPSPerformGetUserProfile+0x228 ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#21 0x657a6644 in AgCServerSROP::PerformLogin+0xb54 () from /appl/
objectel/Objectel_2.9/bin/libAG2SLIB.sl
#22 0x65816ef0 in AgpProcessSROPRequest+0x278 () from /appl/objectel/
Objectel_2.9/bin/libAG2SLIB.sl
#23 0xaeaa8 in singleUserThread+0x4a8 ()
#24 0x67b592e4 in __pthread_body+0x44 () from /usr/lib/libpthread.1
#25 0x67b63574 in __pthread_start+0x14 () from /usr/lib/libpthread.1

Do we have to recompile the program using the new libxerces, or are we
using a wrong compile option?

Feb 10 '07 #1
2 1836
On Feb 10, 11:18 am, "Andre Siqueira" <aasi...@gmail.comwrote:
We have a program, that was previous compiled by another people.
We develop a library that this program loads.

We have experience craches in this program. Looking at the gdb we
find:

#0 0xc020cc68 in kill+0x10 () from /usr/lib/libc.2
#1 0xc01a72a4 in raise+0x24 () from /usr/lib/libc.2
#2 0xc01e85f8 in abort_C+0x160 () from /usr/lib/libc.2
#3 0xc01e8654 in abort+0x1c () from /usr/lib/libc.2
#4 0xc04d3a78 in terminate+0x38 () from /usr/lib/libCsup.2
#5 0xc04cd904 in TCompTechCleanupAutomaticLocal::DestructActiveObje ct
+0x80 () from /usr/lib/libCsup.2
#6 0xc04d131c in TExceptionActionCleanup::ProcessThrow+0x24 () from /
usr/lib/libCsup.2
#7 0xc04d4010 in ThrowException+0x158 () from /usr/lib/libCsup.2
#8 0xc04d4478 in __throw__FPvT1+0x14c () from /usr/lib/libCsup.2
#9 0xd471f6e0 in
std::basic_string<char,std::char_traits<char>,std: :allocator<char>>::operat*or=
+0xb8 ()
from /appl/objectel/Objectel_2.9/bin/ObjectelCommands
#10 0xd41da7b0 in __ct__16SecurityServicesFPCcN21_2+0x478 () from /
appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#11 0xd38b04d4 in AgCServerSROP::UPSVerifyLoginInformation+0x114 ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#12 0xd38b2058 in AgCServerSROP::UPSPerformGetUserProfile+0x228 ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#13 0xd38af644 in AgCServerSROP::PerformLogin+0xb54 () from /appl/
objectel/Objectel_2.9/bin/libAG2SLIB.sl
#14 0xd391fef0 in AgpProcessSROPRequest+0x278 () from /appl/objectel/
Objectel_2.9/bin/libAG2SLIB.sl
#15 0xaeaa8 in singleUserThread+0x4a8 ()
#16 0xc005b2e4 in __pthread_body+0x44 () from /usr/lib/libpthread.1
#17 0xc0065574 in __pthread_start+0x14 () from /usr/lib/libpthread.1

This is happens because we use the string class from STL in our
library. This problem do not occorus where we do not use std::string.

We are compiling our code with the directive -AA and by using this
directive it implies the following:

-AA Turns on newly supported ANSI C++ Standard
features
like namespace std and the new C++ Standard
Library.
This option also implies -Aa. Include paths are
changed to include_std and libraries are
libCsup_v2 and
libstd_v2.
NOTE: Objects and libraries compiled with -AA are
binary incompatible with objects and libraries
compiled
without -AA.

As we could see the program uses the libCsup_v2 as well as the libCsup
libraries which are incompatible by -AA (we see that using ldd)

The lib libCsup comes from the xerces library.

We try recompiles the xerces library using +AA option and the gdb
backtrace stay like:
#0 0x680a6c68 in kill+0x10 () from /usr/lib/libc.2
#1 0x680412a4 in raise+0x24 () from /usr/lib/libc.2
#2 0x680825f8 in abort_C+0x160 () from /usr/lib/libc.2
#3 0x68082654 in abort+0x1c () from /usr/lib/libc.2
#4 0x651d2a78 in terminate+0x38 () from /usr/lib/libCsup.2
#5 0x651cceb0 in
TCompTechCleanupMemberInCtorDtor::DestructActiveOb ject+0x74 () from /
usr/lib/libCsup.2
#6 0x651d031c in TExceptionActionCleanup::ProcessThrow+0x24 () from /
usr/lib/libCsup.2
#7 0x651d3010 in ThrowException+0x158 () from /usr/lib/libCsup.2
#8 0x651d3478 in __throw__FPvT1+0x14c () from /usr/lib/libCsup.2
#9 0xabc48 in
std::basic_string<char,std::char_traits<char>,std: :allocator<char>>::_C_unl*ink
+0xb0 ()
#10 0x65698664 in SecurityServices::~SecurityServices+0x64 () from /
appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#11 0x651cc8ec in TCompTechCleanupAutomaticLocal::DestructActiveObje ct
+0x68 () from /usr/lib/libCsup.2
#12 0x651d031c in TExceptionActionCleanup::ProcessThrow+0x24 () from /
usr/lib/libCsup.2
#13 0x651d3010 in ThrowException+0x158 () from /usr/lib/libCsup.2
#14 0x651d3478 in __throw__FPvT1+0x14c () from /usr/lib/libCsup.2
#15 0x6563f9b0 in
std::basic_string<char,std::char_traits<char>,std: :allocator<char>>::basic_*string<char,std::char_tr aits<char>,std::allocator<char>>
+0xc0 () from /appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#16 0x6569d14c in SecurityServices::SendRecvXML+0x9c () from /appl/
objectel/Objectel_2.9/bin/libAG2LIB.sl
#17 0x6569b134 in SecurityServices::GetBool+0xac () from /appl/
objectel/Objectel_2.9/bin/libAG2LIB.sl
#18 0x6569a37c in SecurityServices::AuthenticateUser+0x38c () from /
appl/objectel/Objectel_2.9/bin/libAG2LIB.sl
#19 0x657a74ec in AgCServerSROP::UPSVerifyLoginInformation+0x12c ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#20 0x657a9058 in AgCServerSROP::UPSPerformGetUserProfile+0x228 ()
from /appl/objectel/Objectel_2.9/bin/libAG2SLIB.sl
#21 0x657a6644 in AgCServerSROP::PerformLogin+0xb54 () from /appl/
objectel/Objectel_2.9/bin/libAG2SLIB.sl
#22 0x65816ef0 in AgpProcessSROPRequest+0x278 () from /appl/objectel/
Objectel_2.9/bin/libAG2SLIB.sl
#23 0xaeaa8 in singleUserThread+0x4a8 ()
#24 0x67b592e4 in __pthread_body+0x44 () from /usr/lib/libpthread.1
#25 0x67b63574 in __pthread_start+0x14 () from /usr/lib/libpthread.1

Do we have to recompile the program using the new libxerces, or are we
using a wrong compile option?
I was trying something here and I discovered that I can use string
with pointer like that:

std::string *test =new std::string("123456");
fprintf(stderr, "my test string = %s\n", test->c_str());

but I can not use like this:

std::string test;
test = "123456";
fprintf(stderr, "my test string = %s\n", test.c_str());

is there any problem with the default allocator?

Feb 10 '07 #2
I have a feeling that the runtime c++ libraries of the application and
the library you are writing are different. If the ABI of the runtime C++
libraries are not compatible, weird crashes in pretty bullet-proof
templates (such as std::string) can occur easily.

For example, gcc3.4 and gcc3.3 have different ABIs for the runtime c++
libraries and thus cannot be mixed easily. Try using the same compiler
that was used to compile the application and see if it solves your problem.
Feb 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Ströder | last post by:
HI! Is it possible to probe for installed libs with DistUtils? I'd like to automatically search for optional libs and adjust C compiler switchers before starting the build of a the extension...
35
by: Gabriel Zachmann | last post by:
Is there any generic way to use C++ libraries from within Python. I seem to recall that there are tools to generate wrappers for C-libraries semi-automatically. But those were still way too...
9
by: Robin Becker | last post by:
Does anyone know if it is feasible to have static libraries for both 2.3 and 2.4 compatible extensions. I'm worrying about libjpeg etc in a win32 environment. -- Robin Becker
1
by: Ingo Nolden | last post by:
When I build a static lib how can I force the linker to include other lib modules or at least the symbols that are used in my libs? -- ~ Samba, more than a low cost File and Printer server ~ --...
1
by: miles.wrigley | last post by:
We need a C/C++ compiler: - Compiler will be used to create functions and OBJs/LIBs (C++ code with C language wrapper) that will be linked and called from an embedded application. - Preferred...
2
by: B Squared | last post by:
I recently installed PHP 5.0.4 on my Fedora system. I compiled in the GD option. (--with-gd). Then I tested the ImageTypes() function. It seems .png and .gif (IMG_PNG and IMG_GIF) are supported,...
0
by: ArtiB | last post by:
Hi, I have VC++ Windows form application in VS 2005. I am not able to access some static libs(VC6 migrated) from this application. Getting exception of type 'System.TypeInitializationException' in...
1
by: Raman | last post by:
Hi All, I have two libs (libFirst.a and libSecond.a). Both libs contains a common function func(). Now I want to link an application "app" with these two libs as gcc -o app libFirst.a...
1
by: tvnaidu | last post by:
I have windows code to port to Linux, there are some static libraries like xyz.lib, also shared libs ABC.dll, I have to convert those static and shared libs (basically static will be used to make...
0
by: tvnaidu | last post by:
created a shared library .so file, using "gcc -shared ...." command, when I did "ldd xyz.so", I cannot see those static libs which are added with -l option, also I gave path -L/opt/lib where I copied...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.