Re: Bus Error on HP-UX (PA-RISC) (862 Views)
Reply
Occasional Contributor
ushanair
Posts: 4
Registered: ‎12-18-2011
Message 1 of 8 (880 Views)

Bus Error on HP-Ux(PARISC)

[ Edited ]

Hi Dennis,

 

sorry i lost the previous thread from here. On this issue, you had asked me to enable the heap check feature and debug..

I did as you suggested, but im not seeing any heap corruptions and/or leaks when i say "info leaks"

 

any sugegstions on this ? Thanks.

 

 

-bash-4.2$ /opt/langtools/bin/gdb lmadmin.debug
HP gdb 6.2 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11i
and target hppa1.1-hp-hpux11.00.
Copyright 1986 - 2011 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 6.2 (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.
..set args -foreground -webport 8090
(gdb) set args -foreground -webport 8090
(gdb) set heap-check leaks on
(gdb) set heap-check free on
(gdb) set heap-check bounds on
(gdb) set heap-check scramble on
warning: Scrambling feature of memory debugging is turned on.
This feature may result in unexpected crash or unpredictable
behavior sometimes.
(gdb) r
Starting program: /netapp-home/urani/lmadmin/pymake/lmadmin/_output/_release/hp700_u11i/lmadmin.debug -foreground -webport 8090
Warning: unable to set default locale.
[New process 3691]
Detaching after fork from process 3691
shl_load error: : No such file or directory
 4:51:10 (demo) Unable to initialize access to trusted storage: 2
 4:51:10 (demo) FLEXnet Licensing version v11.10.0.0 build 96758 hp700_u11i
 4:51:10 (demo) lmremove disabled

Program received signal SIGBUS, Bus error
  si_code: 0 - BUS_UNKNOWN - Unknown Error.
[Switching to thread 24 (system thread 3512565)]
0x7ad0daa0 in U_build_entry_exit_info+0x50 () from /usr/lib/libcl.2
(gdb) bt
#0  0x7ad0daa0 in U_build_entry_exit_info+0x50 () from /usr/lib/libcl.2
#1  0x7adc59cc in U_IS_ENTRY_EXIT+0x270 () from /usr/lib/libcl.2
#2  0x7adc6edc in U_get_previous_frame_x+0x4a8 () from /usr/lib/libcl.2
#3  0x7ae78eac in get_frame_pc_list+0x58 () from /opt/langtools/lib/librtc.sl
#4  0x7ae6d6ec in rtc_record_malloc+0x294 () from /opt/langtools/lib/librtc.sl
#5  0x7ae6e834 in malloc+0x2e8 () from /opt/langtools/lib/librtc.sl
#6  0x146e120 in operator new (sz=52) at ../../../../libstdc++-v3/libsupc++/new_op.cc:48
(gdb) info leaks
There are pending signals.
Scanning for memory leaks...

The current thread is inside the allocator. Try again later.

(gdb) q

 

Regards,

Usha

 

 

-----------------------------------------------

P.S. This thread has been moved from General to Languages & Scripting - Forum Moderator

Please use plain text.
Honored Contributor
Patrick Wallek
Posts: 13,736
Registered: ‎06-21-2000
Message 2 of 8 (871 Views)

Re: Bus Error on HP-Ux(PARISC)

You have 2 previous threads:

 

Re: Bus Error - Building on HP-UX (PA-RISC)
http://h30499.www3.hp.com/t5/Languages-and-Scripting/Bus-Error-Building-on-HP-UZ-PA-RISC/m-p/5421447...

Bus Error - Building on HP-UZ (PA-RISC)
http://h30499.www3.hp.com/t5/Languages-and-Scripting/Bus-Error-Building-on-HP-UZ-PA-RISC/m-p/5421225

 

If you click on your name that is to the left of your thread you will find  alist of your posts.

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,888
Registered: ‎03-06-2006
Message 3 of 8 (862 Views)

Re: Bus Error on HP-UX (PA-RISC)

[ Edited ]

>I lost the previous thread from here.

 

Your previous topic was moved to a better board.

 

>Program received signal SIGBUS, Bus error
#0  0x7ad0daa0 in U_build_entry_exit_info+0x50 /usr/lib/libcl.2
#1  0x7adc59cc in U_IS_ENTRY_EXIT+0x270

 

It looks like you are out of luck.  The Unwind lib doesn't seem to work with your bogus g++ unwind descriptors??

 

You'll have to debug your heap corruption the old fashion way by looking at raw memory and machine code.

Please use plain text.
Occasional Contributor
ushanair
Posts: 4
Registered: ‎12-18-2011
Message 4 of 8 (850 Views)

Re: Bus Error on HP-UX (PA-RISC)

Hi Dennis,

 

Thanks for the mail.

 

I do not know the raw memory debugging. Could you please help me in this.

 

Im seeing the error, while running my  app in gdb , in the begining, as - "Urlstring - Error accessing the memory" where in Urlstring is the variable name

And after the program runs for a while, i get SIGBUS at a entirerly different function.

 

 

I want to know, is this BUS error caused because gdb showed me " Error acessing memory" at some point.

If so, How can i trace this error down to Bus error ?

 

Thanks in advance!

Regards,

Usha

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,888
Registered: ‎03-06-2006
Message 5 of 8 (846 Views)

Re: Bus Error on HP-UX (PA-RISC)

[ Edited ]

>set heap-check leaks on

 

For tracking corruption, you might as well leave this off.  Also turn on string corruption checking.

You might also limit the trace back levels to a smaller value.

 

Try changing these options and rerunning.

 

>>The Unwind lib doesn't seem to work with your bogus g++ unwind descriptors??

 

What HP-UX version do you have?  What libcl patches do you have?

If you are optimizing your g++ code, leave that off.

 

>I do not know the raw memory debugging. Could you please help me in this?

 

You have to know PA-RISC assembly.  Also be able to reverse engineer what the heap routines are doing when it aborts.

 

If fiddling with the above checking options doesn't help, then don't turn on any options and just let the program run and abort.  Then provide this output:

(gdb) bt

(gdb) info reg

(gdb) disas $pc-4*24 $pc+4*8

 

>is this BUS error caused because gdb showed me "Error accessing memory" at some point.

 

Probably not related at all.  That error usually occurs with bad debug info, tricky addressing where pointers aren't valid yet, etc.

Please use plain text.
Occasional Contributor
ushanair
Posts: 4
Registered: ‎12-18-2011
Message 6 of 8 (841 Views)

Re: Bus Error on HP-UX (PA-RISC)

HI Dennis,

 

Thanks for the mail. Happy New Year, 2012.

 

My HP-UX PA Risc version is -

HP-UX hpux B.11.11 U 9000/785 2002328831

and Libc version is -

/usr/lib/libc.2:        PA-RISC2.0 shared library -not stripped

 

(gdb) bt
#0  0xde7b50 in xercesc_2_8::IconvLCPTranscoder::transcode (this=<incomplete type>, toTranscode=<incomplete type>, manager=<incomplete type>)
    at IconvTransService.cpp:323
#1  0xd1bdb8 in xercesc_2_8::XMLString::transcode (toTranscode=<incomplete type>, manager=<incomplete type>) at XMLString.cpp:548
#2  0xca6f48 in xercesc_2_8::XMLPlatformUtils::openFile (fileName=<incomplete type>, manager=<incomplete type>) at HPPlatformUtils.cpp:233
#3  0xd51ca0 in xercesc_2_8::BinFileInputStream::BinFileInputStream (this=<incomplete type>, fileName=<incomplete type>, manager=<incomplete type>)
    at BinFileInputStream.cpp:42

 

(gdb) info reg
      flags:          f000041
         r1:         7ac09200        rp/r2:           de7b2b           r3:         7ac09240           r4:         7ac08c18           r5:                0
         r6:                0           r7:         7abfa454           r8:         40290780           r9:                0          r10:                0
        r11:                0          r12:                0          r13:                0          r14:                0          r15:                0
        r16:                0          r17:                0          r18:                0          r19:         40001000          r20:         4016cc38
        r21:         4015433a          r22:           de7b20     arg3/r23:         4017b2f8     arg2/r24:         4017e780     arg1/r25:         402ed3a0
   arg0/r26:         401801d8    dp/gp/r27:         4016add0     ret0/r28:                0  ret1/ap/r29:                1       sp/r30:         7ac0a2c0
    mrp/r31:           d1bdbb     sar/cr11:               10        pcoqh:           de7b50        pcsqh:          f8fc400        pcoqt:           de7b54
      pcsqt:          f8fc400     iir/cr19:          fc31299     isr/cr20:          b9f9000     ior/cr21:         7ac0a2bc
  ipsw/cr22:            4001f         goto:                2          sr4:          f8fc400          sr0:          f8fc400          sr1:          f8fc400
        sr2:                0          sr3:                0          sr5:          b9f9000          sr6:          3040400          sr7:          3040400
   rctr/cr0:             4000    pidr1/cr8:          4300000    pidr2/cr9:            10000     ccr/cr10:                2   pidr3/cr12:             4300
 pidr4/cr13:          4320000         cr24:             1000         cr25:                2         cr26:             4320   mpsfu_high:         402a2140
  mpsfu_low:             4000  mpsfu_ovflo:                1         fpsr:         88000000         fpe1:                0
       fpe2:                0         fpe3:                0         fpe4:                0         fpe5:                0         fpe6:                0
       fpe7:                0
(gdb) disas $pc-4*24 $pc+4*8
Dump of assembler code from 0xde7af0 to 0xde7b70:
;;; File: IconvTransService.cpp
;;;  315         retVal = new char[1];
0xde7af0 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x200>:     copy %r4,%r19
0xde7af4 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x204>:     stw %ret0,8(%r3)
;;;  316         retVal[0] = 0;
0xde7af8 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x208>:     ldw 8(%r3),%r20
0xde7afc <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x20c>:     stb %r0,0(%r20)
;;;  318     return retVal;
0xde7b00 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x210>:     ldw 8(%r3),%r20
0xde7b04 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x214>:     stw %r20,0x101c(%r3)
;;;  319 }
0xde7b08 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x218>:     ldw 0x101c(%r3),%ret0
0xde7b0c <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x21c>:     ldw -0x14(%r3),%rp
0xde7b10 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x220>:     ldw 0x1020(%r3),%r4
0xde7b14 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x224>:     ldo 0x40(%r3),%sp
0xde7b18 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x228>:     ldw,mb -0x40(%sp),%r3
0xde7b1c <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*)+0x22c>:     bv,n %r0(%rp)
;;;  323 {
0xde7b20 <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE>:
    b,l 0xde7b40 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)>,%rp
0xde7b24 <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0x4>:  nop
0xde7b28 <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0x8>:  ldw -0x18(%sp),%rp
0xde7b2c <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0xc>:  ldsid (%rp),%r1
0xde7b30 <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0x10>: mtsp %r1,%sr0
0xde7b34 <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0x14>: be,n 0(%sr0,%rp)
0xde7b38 <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0x18>: ldil L'0x238000,%r1
0xde7b3c <_ZN11xercesc_2_818IconvLCPTranscoder9transcodeEPKtPNS_13MemoryManagerE+0x1c>: be,n 0x5a8(%sr4,%r1)
0xde7b40 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)>:      stw %rp,-0x14(%sp)
0xde7b44 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x4>:  copy %r3,%r1
0xde7b48 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x8>:  copy %sp,%r3
0xde7b4c <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0xc>:  stw,ma %r1,0x1080(%sp)
0xde7b50 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x10>: stw %r3,-4(%sp)
0xde7b54 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x14>: stw %r4,0x1020(%r3)
0xde7b58 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x18>: stw %r19,-0x20(%sp)
0xde7b5c <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x1c>: stw %r26,-0x24(%r3)
0xde7b60 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x20>: stw %r25,-0x28(%r3)
0xde7b64 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x24>: stw %r24,-0x2c(%r3)
;;;  324     if (!toTranscode)
0xde7b68 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x28>: ldw -0x28(%r3),%r20
0xde7b6c <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x2c>:
    cmpib,<>,n 0,%r20,0xde7b78 <xercesc_2_8::IconvLCPTranscoder::transcode(const unsigned short*, xercesc_2_8::MemoryManager*)+0x38>
End of assembler dump.


Is this an  excercise to see if any unaligned memory access by the application ?

 

Thanks!

 

Regards,

Usha

Please use plain text.
Occasional Contributor
ushanair
Posts: 4
Registered: ‎12-18-2011
Message 7 of 8 (840 Views)

Re: Bus Error on HP-UX (PA-RISC)

Can you * please * help me in understanding, how to reverse engineer at the point of SIGBUS ? Thanks.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,888
Registered: ‎03-06-2006
Message 8 of 8 (834 Views)

Re: Bus Error on HP-UX (PA-RISC)

>libc version is: /usr/lib/libc.2: PA-RISC2.0 shared library -not stripped

 

You need to do a what(1) not file(1) and I asked for libcl.  But this is moot because that's not the problem.


#0  0xde7b50 ...::transcode
#1  0xd1bdb8 ...::transcode
#2  0xca6f48 ...::openFile
#3  0xd51ca0 ...::BinFileInputStream

 

Any reason there are only 4 frames?

 

sp/r30:         7ac0a2c0

 

0xde7b40 <::transcode+0x00>:  stw %rp,-0x14(%sp)
0xde7b44 <::transcode+0x04>:  copy %r3,%r1
0xde7b48 <::transcode+0x08>:  copy %sp,%r3
0xde7b4c <::transcode+0x0c>:  stw,ma %r1,0x1080(%sp)
0xde7b50 <::transcode+0x10>: stw %r3,-4(%sp)   <<<

 

>Is this an  exercise to see if any unaligned memory access by the application?

 

Yes but I don't see any.

It appears you have a thread stack overflow since normally you won't get a signal storing into a local.

And you seem to have a 4K frame in transcode.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation