Bug 4746 - Segmentation fault from avr-objdump -h -S
Summary: Segmentation fault from avr-objdump -h -S
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-06 02:00 UTC by Cliff Jefferies
Modified: 2007-07-09 09:07 UTC (History)
1 user (show)

See Also:
Host: i586
Target: AVR
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cliff Jefferies 2007-07-06 02:00:04 UTC
[cliff@localhost My16M]$ make
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o main.o ../main.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o SparkTmg.o ../SparkTmg.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o Injector.o ../Injector.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o events.o ../events.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o Cmd.o ../Cmd.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o map.o ../map.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o CalcTiming.o ../CalcTiming.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o o2loop.o ../o2loop.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o serial.o ../serial.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o common.o ../common.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o tableidx.o ../tableidx.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o finterpolate.o ../finterpolate.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o raw2mb.o ../raw2mb.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o config.o ../config.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o Baro.o ../Baro.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o comnctlr.o ../comnctlr.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o ECUGBLData.o ../ECUGBLData.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .   -c -o BootLDR.o ../BootLDR.c
avr-gcc -g -Wall -O2 -mmcu=atmega32 -I .  -Wl,--section-start=.bootloader=0x7F80
-Wl,--section-start=.mapdata=0x7800 -Wl,--section-start=.cfgdata=0x7700
-Wl,-Map,My16M_32.map -o My16M_32.elf main.o SparkTmg.o Injector.o events.o
Cmd.o map.o CalcTiming.o o2loop.o serial.o common.o tableidx.o finterpolate.o
raw2mb.o config.o Baro.o comnctlr.o ECUGBLData.o BootLDR.o
avr-objdump -h -S My16M_32.elf > My16M_32.lst
/bin/sh: line 1:  4999 Segmentation fault      avr-objdump -h -S My16M_32.elf
>My16M_32.lst

make: *** [My16M_32.lst] Error 139

Under gdb ...
GNU gdb 6.3-8mdv2007.0 (Mandriva Linux release 2007.0)
This GDB was configured as "i586-mandriva-linux-gnu".

Program received signal SIGSEGV, Segmentation fault.
bfd_getl32 (p=0x8119544) at ../../bfd/libbfd.c:567
567       v |= (unsigned long) addr[1] << 8;
(gdb) bt
#0  bfd_getl32 (p=0x8119544) at ../../bfd/libbfd.c:567
#1  0x0807f8ef in read_4_bytes (abfd=Variable "abfd" is not available.
) at ../../bfd/dwarf2.c:265
#2  0x0807fd2d in read_rangelist (unit=0x80f5690, arange=0x81153f0,
    offset=15500) at ../../bfd/dwarf2.c:1611
#3  0x08080f3a in scan_unit_for_symbols (unit=0x80f5690)
    at ../../bfd/dwarf2.c:1759
#4  0x08082277 in comp_unit_find_nearest_line (unit=0x80f5690, addr=10098,
    filename_ptr=0xbfac75a4, functionname_ptr=0xbfac75a0,
    linenumber_ptr=0xbfac759c, stash=0x80ddf74) at ../../bfd/dwarf2.c:2089
#5  0x08082352 in _bfd_dwarf2_find_nearest_line (abfd=0x80d6490,
    section=0x80d88dc, symbols=0x80d7530, offset=10098,
    filename_ptr=0xbfac75a4, functionname_ptr=0xbfac75a0,
    linenumber_ptr=0xbfac759c, addr_size=4, pinfo=0x80d67e8)
    at ../../bfd/dwarf2.c:2421
#6  0x08088f87 in _bfd_elf_find_nearest_line (abfd=0x80d6490,
    section=0x80d88dc, symbols=0x80d7530, offset=10098,
    filename_ptr=0xbfac75a4, functionname_ptr=0xbfac75a0, line_ptr=0xbfac759c)
    at ../../bfd/elf.c:6969
#7  0x0804d14c in disassemble_section (abfd=0x80d6490, section=0x80d88dc,
    info=0xbfac7618) at ../../binutils/objdump.c:1062
#8  0x08079d09 in bfd_map_over_sections (abfd=0x80d6490,
    operation=0x804cb50 <disassemble_section>, user_storage=0xbfcac7618)
    at ../../bfd/section.c:1220#9  0x0804b51a in dump_bfd (abfd=0x80d6490) at
../../binutils/objdump.c:1949
#10 0x0804bfd7 in display_bfd (abfd=0x80d6490) at ../../binutils/objdump.c:2885
#11 0x0804c0ea in display_file (filename=0xbfac8712 "My16M_32.elf",
target=Variable "target" is not available.
)
    at ../../binutils/objdump.c:2943
#12 0x0804c267 in main (argc=4, argv=0xbfac77f4)
    at ../../binutils/objdump.c:3182
Comment 1 Cliff Jefferies 2007-07-06 02:03:58 UTC
Using -O1 on compiles seems ok
Comment 2 Nick Clifton 2007-07-06 09:02:42 UTC
Hi Cliff,

  Hve you tried using an objcopy built from the current mainline binutils
development sources ?  If not then please do so, as it is possible that this bug
has already been fixed.  If you have, then please could you provide us with a
(compressed) copy of the My16M_32.elf binary for us to examine ?

Cheers
  Nick
Comment 3 cliff@cajinnovations.com 2007-07-07 01:21:56 UTC
Subject: Re:  Segmentation fault  from avr-objdump -h -S

nickc at redhat dot com wrote:
> ------- Additional Comments From nickc at redhat dot com  2007-07-06 09:02 -------
> Hi Cliff,
>
>   Hve you tried using an objcopy built from the current mainline binutils
> development sources ?  If not then please do so, as it is possible that this bug
> has already been fixed.  If you have, then please could you provide us with a
> (compressed) copy of the My16M_32.elf binary for us to examine ?
>
> Cheers
>   Nick
>
>   
Hi Nick thanks for your response. I just built the version from the
CVS head and the good news is it seems to work ok.

Did find another issue though. There seems to be an extra dependancy in 
building the software -

 
WARNING: `makeinfo' is missing on your system.  You should only need it if
         you modified a `.texi' or `.texinfo' file, or any other file
         indirectly affecting the aspect of the manual.  The spurious
         call might also be the consequence of using a buggy `make' (AIX,
         DU, IRIX).  You might want to install the `Texinfo' package or
         the `GNU make' package.  Grab either from any GNU archive site.
make[3]: *** [bfd.info] Error 1
make[3]: Leaving directory `/home/cliff/src/src/obj-avr/bfd/doc'
Making info in po
make[3]: Entering directory `/home/cliff/src/src/obj-avr/bfd/po'
make[3]: Nothing to be done for `info'.
make[3]: Leaving directory `/home/cliff/src/src/obj-avr/bfd/po'
make[3]: Entering directory `/home/cliff/src/src/obj-avr/bfd'
make[3]: Nothing to be done for `info-am'.
make[3]: Leaving directory `/home/cliff/src/src/obj-avr/bfd'
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory `/home/cliff/src/src/obj-avr/bfd'
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory `/home/cliff/src/src/obj-avr'
make: *** [all] Error 2

Comment 4 Nick Clifton 2007-07-09 09:07:21 UTC
Hi Cliff,

> I just built the version from the CVS head and the good news is it seems to 
> work ok.

OK - I will close this PR then.

> Did find another issue though. There seems to be an extra dependancy 
> in building the software -

> WARNING: `makeinfo' is missing on your system.  You should only need it if
> you modified a `.texi' or `.texinfo' file,

I think that this is not really a bug, but more a "feature" when building from a
new set of checked out sources -  the CVS repository does not include the .info
files, so the make system tries to build them for you.  If you had used a set of
release sources, then the .info files should already be present and this issue
would not arise.  (Of course the current release - 2.17 - does not contain all
of the bug fixes that are in the mainline CVS sources...)

Cheers
  Nick