Operating System - HP-UX
1747985 Members
4922 Online
108756 Solutions
New Discussion юеВ

Re: SEGV_MAPERR - Address not mapped to object

 
SOLVED
Go to solution
Goutham YJ
Advisor

SEGV_MAPERR - Address not mapped to object

Hi,

We are porting our application (C++ code) to HP-UX 11i Itanium 64-bit platform and the compiler version we use is HP aC++ Version A.06.20. Our application runs as BEA Tuxedo servers.

During the server startup we are getting the following eror and coredump.

#0 0x60000000c01f2290:0 in memmove+0xb10 () from /usr/lib/hpux32/libc.so.1
#1 0x60000000dce71dc0:0 in RWCString::RWCString(RWCSubString const&)+0x260 ()
from /usr/lib/hpux32/librwtool.so.1
#2 0x4135870:0 in HostAccess::initialize (this=0x4008e330,
filename=0x7fffbc54) at RoutingSystem.cpp:83
#3 0x40a9f30:0 in tpsvrinit (argc=16, argv=0x7fffdfe4) at largemsg.cpp:33
#4 0x60000000d820be40:0 in _tmmain () at stdmain.c:262
#5 0x60000000d81e0cd0:0 in _tmstartserver () at tmstrtsrvr.c:129
#6 0x40a8590:0 in main () at BS-6dd4.c:76


The code it is pointing to is:


void HostAccess::initialize(String filename)
{
if( ( theHostData.entries() == 0 ) ||
( getLastFileTime( filename ) > _lastinited ) )
{
if( theHostData.entries() > 0 )
{
theHostData.clear();
}
ifstream file(filename);
String line;
String eol(";");
String del(",");
HostDataItem theEntry;
int delimLocation[4];
line.readLine(file);
while(!file.eof())
{
delimLocation[0] = line.index(del);
delimLocation[1] = line.index(del,delimLocation[0]+1);
delimLocation[2] = line.index(del,delimLocation[1]+1);
delimLocation[3] = line.index(eol);
theEntry.clientUser = line( 0, delimLocation[0]);
theEntry.region = line(delimLocation[0]+1,delimLocation[1]-delimLocation[0]-1);
theEntry.hostUserID = line(delimLocation[1]+1,delimLocation[2]-delimLocation[1]-1);
theEntry.hostOffice = line(delimLocation[2]+1,delimLocation[3]-delimLocation[2]-1);
theHostData.insert(theEntry);
line.readLine(file);
}
time( &_lastinited );
}
return;
};


This same code is running on PA-RISC systems without any issue. What can be causing the problem here? Appreciate any help on this.

Thanks,
Goutham
5 REPLIES 5
Dennis Handly
Acclaimed Contributor
Solution

Re: SEGV_MAPERR - Address not mapped to object

(I mentioned before, you shouldn't be using the non-default -AP option, you should port to the -AA default.)

#0 0x60000000c01f2290:0 memmove+0xb10 libc.so.1
#1 0x60000000dce71dc0:0 RWCString::RWCString(RWCSubString const&) +0x260 librwtool.so.1

It looks like your RWCSstring has been corrupted.

RoutingSystem.cpp:83
Which line is 83?

You may want to compile with +d to prevent inlining so you can see exactly library functions are being called.
Dennis Handly
Acclaimed Contributor

Re: SEGV_MAPERR - Address not mapped to object

Are the values in the delimLocation array reasonable? Or did index() return an error value?
Print these in the debugger.
Goutham YJ
Advisor

Re: SEGV_MAPERR - Address not mapped to object

Hi Dennis,

Thanks for your reply. I found out the coredump was due to a configuration issue. My code was not able to get the file loaction.

Goutham YJ
Advisor

Re: SEGV_MAPERR - Address not mapped to object

The flat file is the one which my code is trying to read. Now the issue is solved.
Goutham YJ
Advisor

Re: SEGV_MAPERR - Address not mapped to object

.