Bug 1253887 - Cannot access memory at address
Cannot access memory at address
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
22
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-14 22:13 EDT by Sean Richards
Modified: 2015-08-15 02:02 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-15 02:02:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sean Richards 2015-08-14 22:13:47 EDT
Description of problem:

I am trying disassemble helloworld compiled from helloWorld.cpp.  When I go to look at the stack I keep getting the error in the summary.


Version-Release number of selected component (if applicable):
GNU gdb (GDB) Fedora 7.9.1-17.fc22

How reproducible:

#include <iostream>

int main()
{
	std::cout << "\nHello World!!\n";

	return 0;
}

Steps to Reproduce:
1. compile helloworld program
2. load it into GDB
3. disas main
4. break *main+9
5. r
6. ni
7. x/10x $esp

Actual results:
(gdb) x/10x $esp
0xffffffffffffdec0:	Cannot access memory at address 0xffffffffffffdec0
(gdb) 

Expected results:


Additional info:
Comment 1 Jan Kratochvil 2015-08-15 02:02:20 EDT
You haven't explicitly stated 32-bit vs. 64-bit kinds of all the components.  Bug arch says x86_64 so I expect you run on 64-bit Fedora and therefore 64-bit GDB.  As you haven't specified anything special about the helloworld application I expected it is also 64-bit as usual on 64-bit OS.

Therefore I just think you mistakenly use $esp instead of $rsp.  But it is even easier to just use $sp which works on all archs (even with completely differently called stack pointer register on some non-x86* archs).

64-bit GDB (Fedora 22 x86_64), 64-bit helloworld:
(gdb) x/10x $esp
0xffffffffffffd8e0:	Cannot access memory at address 0xffffffffffffd8e0
(gdb) x/10x $rsp
0x7fffffffd8e0:	0x00400820	0x00000000	0xf719b790	0x00007fff
0x7fffffffd8f0:	0x00011c00	0x00000000	0xffffd9c8	0x00007fff
0x7fffffffd900:	0x00000000	0x00000001
(gdb) x/10x $sp
0x7fffffffd8e0:	0x00400820	0x00000000	0xf719b790	0x00007fff
0x7fffffffd8f0:	0x00011c00	0x00000000	0xffffd9c8	0x00007fff
0x7fffffffd900:	0x00000000	0x00000001

64-bit GDB (Fedora 22 x86_64),  32-bit helloworld:
(gdb) x/10x $esp
0xffffca80:	0xf7ddb3dc	0xffffcaa0	0x00000000	0xf7c2a6c7
0xffffca90:	0xf7ddb000	0xf7ddb000	0x00000000	0xf7c2a6c7
0xffffcaa0:	0x00000001	0xffffcb34
(gdb) x/10x $rsp
Value can't be converted to integer.
(gdb) x/10x $sp
0xffffca80:	0xf7ddb3dc	0xffffcaa0	0x00000000	0xf7c2a6c7
0xffffca90:	0xf7ddb000	0xf7ddb000	0x00000000	0xf7c2a6c7
0xffffcaa0:	0x00000001	0xffffcb34

32-bit GDB (Fedora 22 i386), 32-bit helloworld:
(gdb) x/10x $esp
0xffffca90:	0xf7ddd3dc	0xffffcab0	0x00000000	0xf7c20615
0xffffcaa0:	0x00000001	0xf7ddd000	0x00000000	0xf7c20615
0xffffcab0:	0x00000001	0xffffcb44
(gdb) x/10x $rsp
Value can't be converted to integer.
(gdb) x/10x $sp
0xffffca90:	0xf7ddd3dc	0xffffcab0	0x00000000	0xf7c20615
0xffffcaa0:	0x00000001	0xf7ddd000	0x00000000	0xf7c20615
0xffffcab0:	0x00000001	0xffffcb44

Note You need to log in before you can comment on or make changes to this bug.