1754963 Members
2222 Online
108828 Solutions
New Discussion

Core dump

 
prabhakarbhatt
Advisor

Core dump

Dear,

 

I see the following core dump in strcpy. Please could suggest some pointers if you hace faced this already!!!

 

Program terminated with signal 11, Segmentation fault.

SEGV_MAPERR - Address not mapped to object

#0  0x60000000c01f2720:0 in strcpy+0x480 () from /usr/lib/hpux32/libc.so.1

 

(gdb) bt

#0  0x60000000c01f2720:0 in strcpy+0x480 () from /usr/lib/hpux32/libc.so.1

 

 

 

 

Regards,

Prabhakar

6 REPLIES 6
Steven Schweda
Honored Contributor

Re: Core dump

 
Dennis Handly
Acclaimed Contributor

Re: Core dump SIGSEGV (in strcpy)

As Steven said, you need to look at the values being passed to strcpy.

At the start of strcpy, $r32 contains the target and $r33 contains the source.

 

You could have ran off the end of either source or target.  Or trying to write to readonly data.

 

What libc patch do you have?

 

Using these gdb commands may help:

bt

info reg

disas $pc-16*12 $pc+16*4

prabhakarbhatt
Advisor

Re: Core dump SIGSEGV (in strcpy)

Dear Dennis ,

I found that "r8" register contains the address of r32  in frame 0. After examining the "r8" address I am getting invalid address. Pls can you confirm is my analysis correct or not

(gdb) frame 0
#0  0x60000000c01f2720:0 in strncat+0x20 () from /usr/lib/hpux32/libc.so.1
(gdb) x $r8
0xc18004c:      Cannot access memory at address 0xc18004c
(gdb) x/x $r8

full output of "disas" is attached 

 



 

Thanks and Regards,

Prabhakar Bhatt

Dennis Handly
Acclaimed Contributor

Re: Core dump SIGSEGV (in strcpy)

>I found that "r8" register contains the address of r32  in frame 0. ...  Pls can you confirm is my analysis correct or not

 

I see no register dump.  And you can't get addresses of registers, unless you are talking about the RSE.

>#0  0x60000000c01f2720:0 in strncat+0x20  /usr/lib/hpux32/libc.so.1

 

This is not the libc.so.1 on the system that aborted.  All debugging must be done there or with a packcore.

>full output of "disas" is attached

 

But not of strcpy where it aborted.

prabhakarbhatt
Advisor

Re: Core dump SIGSEGV (in strcpy)

Dear,

 

Pls find the proper bt with its replated packcore and frame 0 data is attached:

 

(gdb) bt
#0  0x200000007e5aa430:0 in strcpy+0x190 () at locinst.cpp:561

Pls can youo let me know which reg contains the source/destination in the attaced disas

 

Thanks and Regards,

Prabhakar Bhatt

Dennis Handly
Acclaimed Contributor

Re: Core dump SIGSEGV (in strcpy)

>frame 0 data is attached:

 

Again, I don't see a register dump.

 

>can you let me know which reg contains the source/destination in the attached disas

0x200000007e5aa430:0 <strcpy+0x190>: (p15) st8 [r31]=r35,8

 

r31 is the current 8 byte aligned target, masked from r32.  r30 is the next aligned source.

Note: The loop is pipelined with rotating registers.