GDB segfault when loading elf

Bug #1809919 reported by Artur Troian
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
Undecided
Unassigned

Bug Description

Hi folks,
I have just updated from 7-2018-q2-update to 8-2018-q4-major and gdb segfaults while loading elf

Hosts: MacOS 10.14.2, Ubuntu

8-2018-q4-major with segfault:

arm-none-eabi-gdb
GNU gdb (GNU Tools for Arm Embedded Processors 8-2018-q4-major) 8.2.50.20181213-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file firmware.elf
Reading symbols from firmware.elf...
[1] 29555 segmentation fault arm-none-eabi-gdb

7-2018-q2-update on same elf file
~/Downloads/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gdb
GNU gdb (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 8.1.0.20180315-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file firmware.elf
Reading symbols from firmware.elf...done.
(gdb)

Core dumps for both MacOS and Ubuntu attached

Tags: gdb
Revision history for this message
Artur Troian (troian) wrote :
description: updated
Artur Troian (troian)
tags: added: gdb
summary: - arm-none-eabi-gdb segfault when loading elf
+ GDB segfault when loading elf
Revision history for this message
Bothersome Bloke (ahsee9ziegh2saithainaeciyache4ob-deactivatedaccount) wrote :
Download full text (3.2 KiB)

I can't reproduce this. I tried with the firmware I'm working on, and with https://github.com/blacksphere/blackmagic.

platform:

```
$ uname -a
Darwin anaesthetic-mac.local 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
```

Since brew deleted the formula in response to this bug report, I'm using this tap to install 8-2018-q4-major:

```
$ brew tap ArmMbed/homebrew-formulae && brew install arm-none-eabi-gcc
$ # this installs https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-mac.tar.bz2
$ arm-none-eabi-gdb --version
GNU gdb (GNU Tools for Arm Embedded Processors 8-2018-q4-major) 8.2.50.20181213-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law
```

```
$ cd `mktemp -d`
anaesthetic-mac:tmp.ycHoXRkx nguenthe$ git clone https://github.com/blacksphere/blackmagic
Cloning into 'blackmagic'...
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 6156 (delta 3), reused 6 (delta 2), pack-reused 6143
Receiving objects: 100% (6156/6156), 2.32 MiB | 8.67 MiB/s, done.
Resolving deltas: 100% (4402/4402), done.
anaesthetic-mac:tmp.ycHoXRkx nguenthe$ cd blackmagic/
anaesthetic-mac:blackmagic nguenthe$ make # ...wait
anaesthetic-mac:blackmagic nguenthe$ file src/blackmagic*
src/blackmagic: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
src/blackmagic.bin: data
src/blackmagic_dfu: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
src/blackmagic_dfu.bin: data
src/blackmagic_dfu.hex: ASCII text, with CRLF line terminators
anaesthetic-mac:blackmagic nguenthe$ arm-none-eabi-gdb
GNU gdb (GNU Tools for Arm Embedded Processors 8-2018-q4-major) 8.2.50.20181213-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file src/blackmagic
Reading symbols from src/blackmagic...
(gdb) file src/blackmagic_dfu
Load new symbol table from "src/blackmagic_dfu"? (y or n) y
Reading symbols from src/blackmagic_dfu...
(gdb) quit
```

Can you post your firmware.bin? If you can't, can you strip it down and make a test case that you can share? Right now everyone doing embedd...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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