bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/6832] New: Crash while handling


From: divis1969 at gmail dot com
Subject: [Bug binutils/6832] New: Crash while handling
Date: 11 Aug 2008 09:10:55 -0000

For this case I was using
http://www.kernel.org/pub/linux/devel/binutils/binutils-2.18.50.0.8.tar.bz2.

My application is using BFD library for handling ELF file generated by ADS 1.2.
Unfortunately, I cannot share this ELF file since it contains some proprietary
info. Nevertheless, I suppose I can describe the condition this ELF must to
conform. 

Application is crashing attempting to access the memory it is not allowed
(SIGSEGV). See stack (from Eclipse) attached.

After some debugging I found that problem is with find_line(), line 3143:

         if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
             == stash->sec->size)
           {
             stash->sec = find_debug_info (stash->bfd, stash->sec);
             stash->sec_info_ptr = stash->info_ptr;
           }

This code is changing stash->sec and stash->sec_info_ptr if this unit
was the last one. When find_abstract_instance_name() uses it later
(unit->stash->sec_info_ptr), it calculates the address that is over
the limits. This causes a crash.

So, to be able to reproduce this test case, ELF file should contain compilation
unit that is the last unit in .debug_info section (it will be better to have
just one section as in my case). This unit should have DW_AT_abstract_origin for
some of its subtags (in my case this was DW_TAG_subprogram. I've attached the
example.

I was able to fix problem locally by moving the code above to the end of the
function (i.e. after the call to comp_unit_find_line). Not sure this is correct 
fix.

Dmitry

-- 
           Summary: Crash while handling
           Product: binutils
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: divis1969 at gmail dot com
                CC: bug-binutils at gnu dot org


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]