- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Segmentation fault, dlopen ,aCC -AA -Ae
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2009 12:40 AM
08-24-2009 12:40 AM
ia64 HP-UX B.11.23
problem:
when program 'A' use dlopen function to load library 'B', program 'A' may crash
scene description :
program 'A' use dlopen to load dynamic library "B', and "A" and "B" is correct in syntax and
logic,and 'A' is compiled by C language ,and 'B' is complied by C++ language
'A' compile parameter is:
aCC -o A.out -Ae -g +DD64 -mt -dynamic -ldl -lpthread
'B' compile parameter is:
aCC -o B.so -AA -b -mt -Wl,+s -Wl,+vnocompatwarnings +DD64 +Olit=all -Wl,-hsqlca,+allowdups
-w -lunwind -lCsup -lstd_v2
'A" used (aCC -Ae),"B" used (aCC-AA)
print stack as below:
Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object
#0 0xc0000000000e7560:0 in pthread_mutex_destroy+0xc0 ()
from /usr/lib/hpux64/libpthread.so.1
(gdb) where
#0 0xc0000000000e7560:0 in pthread_mutex_destroy+0xc0 ()
from /usr/lib/hpux64/libpthread.so.1
#1 0xc000000000357de0:0 in __thread_mutex_free+0xc0 ()
from /usr/lib/hpux64/libc.so.1
#2 0xc00000000233f370:0 in _HPMutexWrapper::~_HPMutexWrapper()+0xd0 ()
from /usr/lib/hpux64/libstd_v2.so.1
#3 0xc000000006eda1e0:0 in std::basic_streambuf
>::~basic_streambuf () at EIClass.cpp:1
#4 0xc000000006eb6980:0 in
std::basic_stringstream
>::~basic_stringstream ()
at /opt/aCC/include_std/sstream:74
#5 0xc000000006ec8690:0 in EIClass::GetColVal () at EIClass.cpp:1441 //-----------------------> user
function
This problem happened in EIClass::GetColVal () return function,
snippet displayed as below
int EIClass::GetColVal (){
...
...
return 0; //-----------------------> coredump happen
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2009 02:31 AM - edited 08-21-2011 08:39 PM
08-24-2009 02:31 AM - edited 08-21-2011 08:39 PM
Solution>aCC -Ae -g +DD64 -mt -dynamic -ldl -lpthread
You should NOT be using "aCC -Ae". Instead use cc. You don't need -lpthread since you have -mt. Also you shouldn't use -dynamic since it is the default.
>aCC -AA -b -mt -Wl,+s -Wl,+vnocompatwarnings +DD64 +Olit=all -Wl,-hsqlca,+allowdups
+Olit=all is the default, you don't need this.
-Wl,-hsqlca,+allowdups should be split into two ld options: -Wl,-hsqlca -Wl,+allowdups
Why do you have the latter? Any duplicates violate the ODR rule and are illegal.
>-lunwind -lCsup -lstd_v2
This is illegal and doesn't match what's documented for plugins.
http://docs.hp.com/en/14487/distributing.htm#linking
The order is: -lstd_v2 -lCsup -lunwind -lm
This may be the cause. Also have you compiled everything with -mt?
You shouldn't use -w but suppress individual warnings with +Wnnnn.
- Tags:
- suppress warnings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2009 02:51 AM
08-24-2009 02:51 AM
Re: Segmentation fault, dlopen ,aCC -AA -Ae
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2009 03:28 AM
08-24-2009 03:28 AM
Re: Segmentation fault, dlopen ,aCC -AA -Ae
I have a question.
Does it have any problem when a 'C'program call 'C++' shared library with dlopen,
can you give me some suggestions or show me more relalted information, thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2009 06:49 PM
08-24-2009 06:49 PM
Re: Segmentation fault, dlopen ,aCC -AA -Ae
It shouldn't. The URL I provided above shows how to link an aC++ shlib for a plugin.