Error Accessing Memory Address Bad Address Hp Ux
Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... learn unix and linux commands gdb problem viewing variables HP-UX Thread Tools Search this Thread Display Modes #1 11-21-2007 rimon Registered User Join Date: Oct 2007 Last Activity: 12 October 2008, 7:02 AM EDT Posts: 15 Thanks: 0 Thanked 0 Times in 0 Posts gdb problem viewing variables Hi, I don't know if this is HP-UX specific, but I'll take my chances with this forum. I'm using WDB 5.7 on HP Itanium 11.23. 'file' on my executable shows: ELF-32 executable object file - IA64 The problem is with viewing the contents of the variables. Following is a sequence that demonstrates this: Code: HP gdb 5.7 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 5.7 (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. .. (gdb) stop in main Breakpoint 1 at 0x400c5b0:1: file loader.cpp, line 902 from loader. (gdb) run Starting program: loader Breakpoint 1, main (argc=Error accessing memory address 0xd08: Bad address. ) at loader.cpp:902 902 ll=new LclsLC_Library; (gdb) print argc Error accessing memory address 0xd08: Bad address. (gdb) print &argc $1 = (int *) 0xd08 (gdb) p ll Error accessing memory address 0xcec: Bad address. (gdb) p &ll $1 = (LclsLC_Library **) 0xcec (gdb) See that both the parameter 'argc' and the local variable ll have a problem. Now if I put a breakpoint in a function called by main, and then go up in the stack to main, I CAN see argc. See in the following s
Message-ID: CF5A888BE3E8BC41AE0B18ABE60C4D477C6760 () cafrfd1msgusr04 ! itservices ! sbc ! com [Download message RAW] I'm currently using the latest version of the debugger: jd2419 shdap2[/home/jd2419] what /opt/langtools/bin/wdb /opt/langtools/bin/wdb: $Revision: 92453-07 linker linker crt0.o B.11.30 020412 $ HP aC++ B3910B A.03.33 Classic Iostream Library HP aC++ B3910B A.03.33 Language Support Library HP WDB-GUI - HP Debugger Graphical User Interface - Version 3.3 Rev: 20031010.171641 ICS/EnhancementPak Version 3.0.0 (09/01/97) ICS/EnhancementPak Version 3.0.0 (09/01/97) jd2419 shdap2[/home/jd2419] http://www.unix.com/hp-ux/45481-gdb-problem-viewing-variables.html what /opt/langtools/bin/gdb /opt/langtools/bin/gdb: $Revision: 92453-07 linker linker crt0.o B.11.16.01 020913 $ Hewlett-Packard Wildebeest 3.3 10-Oct-2003 15:11 hppa1.1-hp-hpux11.00 $ Sep 8 2000 23:13:51 $ -Jerry > -----Original Message----- > From: DY, JERRY U (SBCSI) > Sent: Monday, March 15, 2004 2:14 PM > To: 'email@example.com' > Subject: RE: Error accessing memory address 0x1002b74: Bad address. > http://marc.info/?l=hpux-devtools&m=107939004208522 > I'm guessing that 0x1002b74 is bad because my program doesn't own that > memory segment. Am I to assume then that there is some member variable > that points to that address? > > Why would gdb error in this case?? I've seen objects with members that > hold invalid pointers all the time. > > -Jerry > > -----Original Message----- > From: DY, JERRY U (SBCSI) > Sent: Monday, March 15, 2004 2:06 PM > To: firstname.lastname@example.org > Subject: Error accessing memory address 0x1002b74: Bad > address. > > > I'm getting the following error while debugging an aC++ compiled > program: > > (gdb) p this > $9 = (class PageParser *) 0x7f7f15b8 > (gdb) p *this > Error accessing memory address 0x1002b74: Bad address. > > I get the same error when I print any of the object's member > variables. Can someone give me a clue as to what might be going on here? > I'm
Below is an analysis, but I'm uncertain on how to fix this. Ideas welcome. TL;DR - optimizer-caused, but is the optimizer really to blame? (0) pwd is http://www.nntp.perl.org/group/perl.perl5.porters/2014/06/msg216966.html CPAN/Digest-SHA (1) must compile with the optimizer (+O in HP-UX) - no optimizer, no core dump, and -g (to get the symbols): cc -c -I. -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -DDEBUGGING -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O -g -DVERSION=\"5.92\" -DXS_VERSION=\"5.92\" +Z "-I../.." SHA.c (2) make (3) gdb ../../perl == gdb run -I../../lib t/woodbury.t === Starting program: .../perl -I../../lib t/woodbury.t 1..21 ok 1 ok error accessing 2 ok 3 ok 4 ok 5 ok 6 ok 7 Program received signal SIGBUS, Bus error si_code: 0 - BUS_UNKNOWN - Unknown Error. 0x7ad9a120 in sha512 (s=warning: reading `' register: Invalid argument 0x2, block=0x7f7f11e0 '6'