This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/14098] New: Bogus jitted image crashes GDB


http://sourceware.org/bugzilla/show_bug.cgi?id=14098

             Bug #: 14098
           Summary: Bogus jitted image crashes GDB
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: hjl.tools@gmail.com
    Classification: Unclassified


I am debugging a GDB crash caused by the bogus
ELF header in a jitted memory image.  My process
is 32bit and the jitted memory image has an ELF64
header with bogus offset:

(top-gdb) p *i_ehdrp
$35 = {e_ident = "\177ELF\002\001\001\000\000\000\000\000\000\000\000", 
  e_entry = 0, e_phoff = 52, e_shoff = 11258999068426292, e_version = 1, 
  e_flags = 65541, e_type = 1, e_machine = 62, e_ehsize = 0, e_phentsize = 0, 
  e_phnum = 0, e_shentsize = 0, e_shnum = 0, e_shstrndx = 0}
(top-gdb) 

When bfd_elf64_object_p tries to get the section headers
at 11258999068426292, gdb crashes:

#0  0x00000038e5338e93 in __memcpy_ssse3_back () from /lib64/libc.so.6
#1  0x000000000043bcde in inf_ptrace_xfer_partial (ops=0xbfc7c0, 
    object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7fffffffeffc "", 
    writebuf=0x0, offset=12277336, len=12263000)
    at /export/gnu/import/git/gdb-x32/gdb/inf-ptrace.c:573
#2  0x000000000044a460 in linux_xfer_partial (ops=0xbfc7c0, 
    object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7fffffffeffc "", 
    writebuf=0x0, offset=12277336, len=12263000)
    at /export/gnu/import/git/gdb-x32/gdb/linux-nat.c:4767
#3  0x00000000004493ac in linux_nat_xfer_partial (ops=0xbfc7c0, 
    object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7fffffffeffc "", 
    writebuf=0x0, offset=11258999080703576, len=12263000)
    at /export/gnu/import/git/gdb-x32/gdb/linux-nat.c:4330
#4  0x000000000059022d in default_xfer_partial (ops=0xba0520, 
    object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7fffffffeffc "", 
    writebuf=0x0, offset=11258999080703576, len=12263000)
    at /export/gnu/import/git/gdb-x32/gdb/target.c:1956
#5  0x000000000058f79c in memory_xfer_partial_1 (ops=0xba0520, 
    object=TARGET_OBJECT_MEMORY, readbuf=0x7fffffffeffc, writebuf=0x0, 
    memaddr=11258999080703576, len=12263000)
    at /export/gnu/import/git/gdb-x32/gdb/target.c:1577
#6  0x000000000058f88a in memory_xfer_partial (ops=0xba0520, 
    object=TARGET_OBJECT_MEMORY, readbuf=0x7fffffffeffc, writebuf=0x0, 
...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]