On 32bit host arm-linux-gnueabi-objdump segfaults

Bug #832243 reported by Jani Monoses
36
This bug affects 4 people
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Fix Released
Undecided
Unassigned
binutils-armel-cross (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

While building https://github.com/swetland/omap4boot on Oneiric with latest packages

arm-linux-gnueabi-objdump -D out/panda/aboot > aboot.list
produces output but segfaults at the end. So it is unclear whether it finished its job.

Tags: patch cross
Revision history for this message
Jani Monoses (jani) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

14:38 hrw@puchatek:a$ arm-linux-gnueabi-objdump -D aboot >a.l
14:38 hrw@puchatek:a$ arm-linux-gnueabi-objdump --version
GNU objdump (GNU Binutils for Ubuntu) 2.21.52.20110707
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
14:38 hrw@puchatek:a$ apt-cache policy binutils-arm-linux-gnueabi
binutils-arm-linux-gnueabi:
  Zainstalowana: 2.21.52.20110707-1ubuntu1cross1.71
  Kandydująca: 2.21.52.20110707-1ubuntu1cross1.71
  Tabela wersji:
 *** 2.21.52.20110707-1ubuntu1cross1.71 0
        999 http://de.archive.ubuntu.com/ubuntu/ oneiric/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Jani Monoses (jani) wrote :

I am on i386 but otherwise same toolchain version.

Marcin Juszkiewicz (hrw)
Changed in armel-cross-toolchain-base (Ubuntu):
status: New → Confirmed
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

binutils 20110810 fails too

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Program received signal SIGSEGV, Segmentation fault.
0xf7cd2410 in _IO_vfprintf_internal (s=Cannot access memory at address 0xffffffff
) at vfprintf.c:1620
1620 vfprintf.c: No such file or directory.
        in vfprintf.c
(gdb) bt
#0 0xf7cd2410 in _IO_vfprintf_internal (s=Cannot access memory at address 0xffffffff
) at vfprintf.c:1620
#1 0xf7d74f48 in ___vsnprintf_chk (s=0x8096259 ", #-16]0xf0a4>", maxlen=<optimized out>, flags=1, slen=4294967295, format=0xf7f52a68 ", #%d]%s",
    args=0xffffd618 "\360\377\377\377\377\377\377\377\321(\365\367^") at vsnprintf_chk.c:65
#2 0x0804bdde in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Compiled with -O0:

Program received signal SIGSEGV, Segmentation fault.
0xf7ca1410 in _IO_vfprintf_internal (s=Cannot access memory at address 0xffffffff
) at vfprintf.c:1620
1620 vfprintf.c: No such file or directory.
        in vfprintf.c
(gdb) bt
#0 0xf7ca1410 in _IO_vfprintf_internal (s=Cannot access memory at address 0xffffffff
) at vfprintf.c:1620
#1 0xf7cc0dbb in _IO_vsnprintf (string=0x809f259 ", #-16]0xf0a4>", maxlen=<optimized out>, format=0xf7f59610 ", #%d]%s",
    args=0xffffd4f8 "\360\377\377\377\377\377\377\377\315\t\365\367\251") at vsnprintf.c:120
#2 0x0804c750 in ?? ()
#3 0xf7f3f00e in print_insn_coprocessor (pc=1076923648, info=0xffffda24, given=1291845636, thumb=0) at ../../opcodes/arm-dis.c:1893
#4 0xf7f41afb in print_insn_arm (pc=1076923648, info=0xffffda24, given=1291845636) at ../../opcodes/arm-dis.c:2943
#5 0xf7f465c0 in print_insn (pc=1076923648, info=0xffffda24, little=1) at ../../opcodes/arm-dis.c:4952
#6 0xf7f466ba in print_insn_little_arm (pc=1076923648, info=0xffffda24) at ../../opcodes/arm-dis.c:4977
#7 0x0804d073 in ?? ()
#8 0x0804e501 in ?? ()
#9 0xf7e10fd7 in bfd_map_over_sections (abfd=0x809d038, operation=0x804dbc8, user_storage=0xffffda24) at ../../bfd/section.c:1285
#10 0x0804e9aa in ?? ()
#11 0x08050e02 in ?? ()
#12 0x08050f72 in ?? ()
#13 0x0805115d in ?? ()
#14 0x08051a4d in ?? ()
#15 0xf7c77113 in __libc_start_main (main=0x805116e, argc=3, ubp_av=0xffffdca4, init=0x8088290, fini=0x8088300, rtld_fini=0xf7fecba0, stack_end=0xffffdc9c)
    at libc-start.c:226
#16 0x0804a2e1 in ?? ()
Backtrace stopped: Not enough registers or memory available to unwind further
(gdb)

summary: - objdump segfaults
+ On 32bit host arm-linux-gnueabi-objdump segfaults
Revision history for this message
Michael Hope (michaelh1) wrote :

See also LP: #974832. Doesn't appear in 2.22 on x86_64.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Download full text (76.2 KiB)

Still happens on i386 under precise:

root@puchatek:/etc/apt# arm-linux-gnueabi-objdump --version
GNU objdump (GNU Binutils for Ubuntu) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
root@puchatek:/etc/apt# arm-linux-gnueabi-objdump -D aboot

aboot: file format elf32-littlearm

Disassembly of section .text:

40308000 <_start>:
40308000: e24f7008 sub r7, pc, #8
40308004: e28f8028 add r8, pc, #40 ; 0x28
40308008: e5988000 ldr r8, [r8]
4030800c: e0887007 add r7, r8, r7
40308010: e59f8030 ldr r8, [pc, #48] ; 40308048 <disable_irqs+0x8>
40308014: e59f9030 ldr r9, [pc, #48] ; 4030804c <disable_irqs+0xc>

40308018 <copy>:
40308018: e4176004 ldr r6, [r7], #-4
4030801c: e4096004 str r6, [r9], #-4
40308020: e1590008 cmp r9, r8
40308024: 1afffffb bne 40308018 <copy>
40308028: e59f8020 ldr r8, [pc, #32] ; 40308050 <disable_irqs+0x10>
4030802c: e12fff18 bx r8
40308030: eafffffe b 40308030 <copy+0x18>

40308034 <size>:
40308034: 0000209c muleq r0, ip, r0

40308038 <enable_irqs>:
40308038: f1080080 cpsie i
4030803c: e12fff1e bx lr

40308040 <disable_irqs>:
40308040: f10c0080 cpsid i
40308044: e12fff1e bx lr
40308048: 40308000 eorsmi r8, r0, r0
4030804c: 4030a09c mlasmi r0, ip, r0, sl
40308050: 40309879 eorsmi r9, r0, r9, ror r8

40308054 <_serial_putc>:
40308054: 4b04 ldr r3, [pc, #16] ; (40308068 <_serial_putc+0x14>)
40308056: 681b ldr r3, [r3, #0]
40308058: f103 0214 add.w r2, r3, #20
4030805c: 7811 ldrb r1, [r2, #0]
4030805e: 0689 lsls r1, r1, #26
40308060: d5fc bpl.n 4030805c <_serial_putc+0x8>
40308062: 7018 strb r0, [r3, #0]
40308064: 4770 bx lr
40308066: bf00 nop
40308068: 40309f94 mlasmi r0, r4, pc, r9 ; <UNPREDICTABLE>

4030806c <serial_init>:
4030806c: 4b0d ldr r3, [pc, #52] ; (403080a4 <serial_init+0x38>)
4030806e: 2200 movs r2, #0
40308070: b510 push {r4, lr}
40308072: 2483 movs r4, #131 ; 0x83
40308074: 6819 ldr r1, [r3, #0]
40308076: 710a strb r2, [r1, #4]
40308078: 2107 movs r1, #7
4030807a: 6818 ldr r0, [r3, #0]
4030807c: f880 1020 strb.w r1, [r0, #32]
40308080: 6818 ldr r0, [r3, #0]
4...

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

1260 lines of output instead of 9351

Changed in binutils (Ubuntu):
status: New → Confirmed
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Same happens with objdump from binutils-multiarch.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Looks like I found out where problem is.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

With this patch applied binutils/cross works fine on i386.

Changed in armel-cross-toolchain-base (Ubuntu):
status: Confirmed → Triaged
Changed in binutils (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
tags: added: cross patch
Revision history for this message
Matthias Klose (doko) wrote :

the patch is wrong. it should conditionalize on the target arch instead

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Cross part has own copy of --enable-targets block. We can unify it during q-cycle.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

cross binutils is now separate package

affects: armel-cross-toolchain-base (Ubuntu) → binutils-armel-cross (Ubuntu)
Revision history for this message
Matthias Klose (doko) wrote :

this was fixed for 2.23 in quantal

Changed in binutils (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

fixed in precise (12.04 LTS) and later

Changed in binutils-armel-cross (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.