Operating System - HP-UX
1752398 Members
5516 Online
108788 Solutions
New Discussion юеВ

STL string is causing problem in destructor in 64 bit itanium platform

 
Vincent Paul S
Occasional Contributor

STL string is causing problem in destructor in 64 bit itanium platform

Hi,

We are migrating from 32 bit version of the code to 64 bit version. The platform we use for 64 bit is Itanium hp-ux. Getting a strange error in basic_string class.

string httpBuffer;
....
....
//a sample block inside main
{
string sHeaders;

sHeaders=httpBuffer.substr(....);
}

When the flow is coming out of the block we are getting segmentation fault in basic_string destructor. Please help on this also let me know if you require more information.
4 REPLIES 4
Mike Stroyan
Honored Contributor

Re: STL string is causing problem in destructor in 64 bit itanium platform

This question is better suited to the
"HP-UX" > "languages and scripting" forum.

My first suspicion when a simple destructor segfaults is that some other code has corrupted the malloc information. That could happen because of overwritting a buffer or accessing freed memory. You could try compiling with aCC's +check option to see if it catches a problem.
Vincent Paul S
Occasional Contributor

Re: STL string is causing problem in destructor in 64 bit itanium platform

can you please clarify how to use the option. I checked in this link: http://docs.hp.com/en/8/options.htm#option-index

I couldn't find the +check option. Please help.
Dennis Handly
Acclaimed Contributor

Re: STL string is causing problem in destructor in 64 bit itanium platform

>When the flow is coming out of the block we are getting segmentation fault in basic_string destructor.

I need a stack trace. It might help if you recompile with +d first.
Is this application threaded?
What version of aCC6 are you using?

>I couldn't find the +check= option.

You need to use a later version of aC++:
http://docs.hp.com/en/14487/index.htm

>Mike: My first suspicion when a simple destructor segfaults is that some other code has corrupted the malloc information.

Right.
(I've asked the moderators to move this to the correct forum.)
Vincent Paul S
Occasional Contributor

Re: STL string is causing problem in destructor in 64 bit itanium platform

We got the solution now. The problem is only with the flags.

Using -mt option in aCC compiler is working. The problem happened because the string libraries were not used in thread safe mode !!