Operating System - HP-UX
1752713 Members
5815 Online
108789 Solutions
New Discussion юеВ

Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

 
SOLVED
Go to solution
mj34656
New Member

Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

We are getting core in our exe. The exe has performed all its function and has ended with status = 0 (SUCCESS) but still we see the core error:

After looking at the core the error is
"Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object"

Here is the stack trace for the same.
(gdb) where
#0 0x158a9b0:0 in basic_string,allocator>::~basic_string()+0x70 ()
#1 0x60000000c0888140:0 in __cxa_finalize+0x1e0 ()
from /usr/lib/hpux32/libCsup.so.1
#2 0x60000000c0887f10:0 in __cxxTerm_body()+0x30 ()
from /usr/lib/hpux32/libCsup.so.1
#3 0x60000000c0887dc0:0 in __cxxTerm+0x20 () from /usr/lib/hpux32/libCsup.so.1
#4 0x60000000c02a4700:0 in __exit_handler+0xa0 ()
from /usr/lib/hpux32/libc.so.1
Current language: auto; currently c++


9 REPLIES 9
Dennis Handly
Acclaimed Contributor

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

All this says that at exit time, there is a global/static string that is being destroyed and some how the address or content has been corrupted and it aborts.

Is your application compiled with -AP?
Is your application threaded?
mj34656
New Member

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

1. No this is not a threaded application.
2. I have used -AP this time but didn't get much information and the new stack does not give any information. Here is what I am gettting now.

SEGV_MAPERR - Address not mapped to object
No object file symbols.
#0 0x149ed20 in ()
(gdb) where
#0 0x149ed20 in ()
warning: Attempting to unwind past bad PC 0x149ed20
#1 0x60000000c0888140 in ()
Dennis Handly
Acclaimed Contributor

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

>2. I have used -AP this time but didn't get much information

I'm saying you were already using -AP, which is not the default on IPF.

Are you looking at a core file or running it in the debugger?
mj34656
New Member

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

No I was not using -AP.
I am not using any of the debugger but I am looking at core file.
Dennis Handly
Acclaimed Contributor

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

>No I was not using -AP.

The symbol basic_string::~basic_string
only comes from the -AP version. The -AA version has std::basic_string. The address 0x158a9b0 is also very large for the executable.

You could try "info shared" to get a list of shlibs.

You might run it in the debugger to see if you are unloading a shlib before you are finished. Use:
catch load
catch unload
mj34656
New Member

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

Hi,
Your advice was very helpful. Thank you for your time. But I have a question here, why this problem is occuring;

I had defined a ├в static public function├в in my class Xclass. The function had the following declaration:

static string empty;

I was using the above string to return empty string. I changed it to:

string empty=├в ├в ;

Now I├в m not getting any core dump.

In my process, at the very begining, I was calling delete on the Xclass object pointer. I don├в t understand, why in the end it would crash and not while calling the delete. Can you please explain what is happening here.
Dennis Handly
Acclaimed Contributor

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

>why this problem is occurring;

Unfortunately we don't know yet.

>I had defined a "static public function" in my class Xclass. The function had the following declaration:
static string empty;

This is a static data member, not a function.

>I was using the above string to return empty string.

Do not do this. The aC++ runtime already has a special empty string, there is no need to have more.

>I changed it to: string empty="";

Did you remove "static"?
Also you don't need to have "". You can just use:
string Xclass::empty;

>I was calling delete on the Xclass object pointer.

That shouldn't change a static data member.

>Can you please explain what is happening here?

If you removed static, then it won't cause cause problems during static destruction.
But to answer your question, we would have to debug the issue.
mj34656
New Member

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

Thanks this information was helpful for us!! our problem is resolved.
Dennis Handly
Acclaimed Contributor
Solution

Re: Program terminated with signal 11, Segmentation fault."SEGV_MAPERR - Address not mapped to object"

>our problem is resolved.

If you are happy with your answers, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33