symtab/2161: Debug Info|ELF| GDB shows memory as being mapped when it might not be

alex00882007@gmail.com alex00882007@gmail.com
Mon Aug 28 00:18:00 GMT 2006


>Number:         2161
>Category:       symtab
>Synopsis:       Debug Info|ELF| GDB shows memory as being mapped when it might not be
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 28 00:18:01 UTC 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alex
>Release:        GNU gdb 6.4
>Organization:
>Environment:
Linux oxygen 2.6.15-26-386 #1 PREEMPT Thu Aug 3 02:52:00 UTC 2006 i686 GNU/Linux
>Description:

If a section header entry describes a mapped section:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
...
  [34]                   PROGBITS        0904d000 001d67 000400 00  AX  0   0  4

...which is out of the range of any phdr entries, GDB will still report the data as being mapped into memory

The program crashes when it tries to read from this memory address. (Just in case I also tried to mprotect it to make sure it wasnt just not marked readable in some strange twist)

Program received signal SIGSEGV, Segmentation fault.
0x0804846c in main ()
(gdb) x/i $eip
0x804846c <main+144>:   mov    (%eax),%eax
(gdb) x/wx $eax
0x904d000 <completed.4463+16791820>:    0x44434241

...
The section header entry above describes 256 "ABCD"'s at the very end, which gdb reads.

I'm not entirely sure this is a bug but it could be misleading.
>How-To-Repeat:
Make a section header entry that appears to map information at a certain address. It won't actually get mapped but looking around with gdb it might appear to be.
>Fix:
Uh im lazy... If this is a bug just check that the section entries correspond with the phdr segment entries. 
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gdb-prs mailing list