This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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 in bfd/dwarf2.c recently


2.16 didn't have a problem...

I used the October and 12/04 cvs snapshots and came across this problem:

nm -l 
cored at times...

Looking in gdb...

Program received signal SIGSEGV, Segmentation fault.
0x00be981a in strcmp () from /lib/tls/libc.so.6
(gdb) bt
#0  0x00be981a in strcmp () from /lib/tls/libc.so.6
#1  0x08062444 in lookup_symbol_in_function_table (unit=0x966473c,
    sym=0x965fb7c, addr=558, filename_ptr=0xfef14f6c,
    linenumber_ptr=0xfef14f64) at dwarf2.c:1467
#2  0x080634b5 in comp_unit_find_line (unit=0x966473c, sym=0x965fb7c,
    addr=558, filename_ptr=0xfef14f6c, linenumber_ptr=0xfef14f64,
    stash=0x9663a24) at dwarf2.c:2132
#3  0x08063c6c in _bfd_dwarf2_find_line (abfd=0x9655068, symbols=0x9656238,
    symbol=0x965fb7c, filename_ptr=0xfef14f6c, linenumber_ptr=0xfef14f64,
    addr_size=0, pinfo=0x96553d0) at dwarf2.c:2502

gdb) p *each_func
$3 = {prev_func = 0x9689680, caller_func = 0x0, caller_file = 0x0,
  caller_line = 0, file = 0x0, line = 0, tag = 46, name = 0x0, arange = {
    next = 0x0, low = 558, high = 1089}, sec = 0x0}

each_func->name was passed into strcmp, hence the core dump...

This seemed to fix the coredumping issue:

: leisner@dell3;rcsdiff -u dwarf2.c
===================================================================
RCS file: dwarf2.c,v
retrieving revision 1.1
diff -u -r1.1 dwarf2.c
--- dwarf2.c    2005/12/05 02:00:02     1.1
+++ dwarf2.c    2005/12/05 02:12:04
@@ -1465,6 +1465,7 @@
           arange = arange->next)
        {
          if ((!each_func->sec || each_func->sec == sec)
+              && each_func->name 
              && addr >= arange->low
              && addr < arange->high
              && strcmp (name, each_func->name) == 0




Marty Leisner
leisner@rochester.rr.com



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