Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

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

SOLVED
Go to Solution
Occasional Advisor

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

Hi

 

We are currently doing platform migration from sun solaris  to HP-UX   B.11.31.

 

version:
HP-UX hva03ads B.11.31 U ia64 0291095592 unlimited-user license

 

compiler:

 

Hewlett-Packard Company           - 41 -          HP C/aC++ Version A.06.25

 

 

 

on sun solaris unix it worked fine.  When I am executing on HP it showing coredump error.

 

when i am trying to debug corefiles with gdb  <binary filename>  <corefilename>

 

it showing following warnings

 

 

 

HP gdb 6.1 for HP Itanium (32 or 64 bit) and target HP-UX 11iv2 and 11iv3.
Copyright 1986 - 2009 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 6.1 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `ksopogmf'.
Program terminated with signal 11, Segmentation fault.
SEGV_MAPERR - Address not mapped to object

warning: Load module /logiciel/oracle/client_10204/lib/libclntsh.so.10.1 has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libutil.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libind.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libgmf.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/librpm.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libweibull.so has been stripped.
Debugging information is not available.


warning: Load module /logiciel/oracle/client_10204/lib/libnnz10.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libgmfi.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libgmr.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libpp.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libgsttv.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libtctp.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/lib6pc.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libap.so has been stripped.
Debugging information is not available.


warning: Load module /sopdev01/sop/sopdevt/version_encours/../lib/libatk.so has been stripped.
Debugging information is not available.

#0  0xc0000000003cb110:0 in free+0xb0 () from /usr/lib/hpux64/libc.so.1

 

 

(gdb) bt
#0  0xc0000000003cb110:0 in free+0xb0 () from /usr/lib/hpux64/libc.so.1
#1  0x40000000000a3870:0 in mon_free_data () at ./src/moniteur.c:298
#2  0x40000000000a31b0:0 in svc_generique () at ./src/moniteur_tuxedo.c:583
#3  0x40000000000219b0:0 in sopogmf_dlist () at ./src/ksopogmf.pc:617
#4  0xc0000000257dcb30:0 in _tmsvcdsp () at tmsvcdsp.c:547
#5  0xc000000025838e70:0 in _tmrunserver () at tmrunsvr.c:2121
#6  0xc0000000257d9d90:0 in _tmstartserver () at tmstrtsrvr.c:166
#7  0x4000000000011150:0 in main () at BS-6caa.c:82

 

 

(gdb) frame 0
#0  0xc0000000003cb110:0 in free+0xb0 () from /usr/lib/hpux64/libc.so.1
(gdb) set $sp_save = $sp
(gdb) # the frame # of main or __pthread_bound_body
(gdb) frame 13
No frame with frame# or frame_address 13
(gdb) p $sp - $sp_save
$1 = 0
(gdb)


 

 

Please help on this.

 

Thanks & Regards

Mallesh

1 ACCEPTED SOLUTIONS
Highlighted
Occasional Advisor

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


yes. Actually this issue is raised due to  insuficiant allocation memory for a string.

 

ps_sc_nom_fic = (char *)malloc((strlen(ps_local)+strlen(ps_cs_ipn)+strlen(ps_type)+strlen(ps_num_jd)+strlen(ps_complement)+1)*sizeof(char));

 

then i added sufficient size. Now it is working fine.

 

Thanks for help

6 REPLIES
Acclaimed Contributor Acclaimed Contributor

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

>#0  0xc0000000003cb110:0 in free+0xb0

 

You have heap corruption.  You need to use gdb's "set heap-check".

 

>#7  0x4000000000011150:0 in main BS-6caa.c:82

>(gdb) # the frame # of main or __pthread_bound_body
>No frame with frame# or frame_address 13

 

As the comment said, you need to use frame 7.  But it is unlikely you have a stack overflow.

Occasional Advisor

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

>You have heap corruption. You need to use gdb's "set heap-check".

 

I am new to HP unix and Gdb .  please can you explain how set gdb's "set heap-check".

 

 

Acclaimed Contributor Acclaimed Contributor

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

>please can you explain how set gdb's "set heap-check".

 

Before you run, you issue "set heap-check on".

Use "help set heap-check" for more options.

 

 

Occasional Advisor

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

Thanks Dennis Handly for your help.

 

Now my issue is solved.

 

 

 

Acclaimed Contributor Acclaimed Contributor

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

>Thanks Dennis Handly for your help.

 

If you are happy, please click on the Kudos star.

>Now my issue is solved.

 

It would be helpful to everyone else if you could explain how you solved the problem.  Was it forgetting to allocate one more more for a string?  Did gdb help?

Highlighted
Occasional Advisor

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


yes. Actually this issue is raised due to  insuficiant allocation memory for a string.

 

ps_sc_nom_fic = (char *)malloc((strlen(ps_local)+strlen(ps_cs_ipn)+strlen(ps_type)+strlen(ps_num_jd)+strlen(ps_complement)+1)*sizeof(char));

 

then i added sufficient size. Now it is working fine.

 

Thanks for help