gdb crashes when you set a break point at the end of the code

Bug #1375517 reported by brent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Fix Released
Critical
Terry Guo

Bug Description

The following code will crash GDB with the following when you set a break point at line with the symbol loop. I am using GDB with Eclipse and openocd-0.8.0 on windows 7 system(64 bit). On Linux I have not encountered this problem. Also removing the symbol loop prevents the crash from happening.

Eclipse version:

Version: Kepler Service Release 2
Build id: 20140224-0627

gdb version:

GNU gdb (GNU Tools for ARM Embedded Processors) 7.6.0.20140529-cvs

openocd version:

Open On-Chip Debugger 0.8.0 (2014-04-28-08:39)

Code:

       .text
       .global main
main:
  nop
  mov r4, #5 // Load register r4 with the value 5
        mov r5, #4 // Load register r5 with the value 4
        add r0, r4, r5 // Add r5 and r4 and store in r0
loop: b main

error displayed in console:

/home/build/work/GCC-4-8-build/src/gdb/gdb/linespec.c:2445: internal-error: decode_line_full: Assertion `state->canonical_names[i].suffix != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Hope this helps

Brent

Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
assignee: nobody → Terry Guo (terry.guo)
Revision history for this message
Terry Guo (terry.guo) wrote :

Thanks for reporting. Is the final elf file debugged by gdb generated from a C source file or from the assembly file mentioned in description? I am trying to reproduce the issue.

Revision history for this message
brent (brent-r) wrote : Re: [Bug 1375517] Re: gdb crashes when you set a break point at the end of the code

Hi Terry,

The main code is assembly language the other files in the project are c
used for initialization. Forgot to mention It was written for the
cortex-m0. Here is a link to the complete project file.

http://www.ece.uvic.ca/~ceng255/lab/

The zip file was lab1a. You will need to remove the NOP between the
symbol stop and the final branch for it to crash. Please let me know if
you require further information.

Best regards

Brent

On 14-09-29 07:03 PM, Terry Guo wrote:
> Thanks for reporting. Is the final elf file debugged by gdb generated
> from a C source file or from the assembly file mentioned in description?
> I am trying to reproduce the issue.
>

Revision history for this message
Terry Guo (terry.guo) wrote :

Thanks Brent. Now the issue can be easily reproduced by below steps on windows 7 (I am using cygwin):

$ cat main.s
.text
.global main

main:
        nop
        mov r4, #5
        mov r5, #4
        add r0, r4, r5
loop: b main

$ ./gcc-arm-none-eabi-4_8-2014q3-20140805-win32/bin/arm-none-eabi-gcc -mthumb -mcpu=cortex-m0 -specs=rdimon.specs -g -o a.out ./main.s

$ ./gcc-arm-none-eabi-4_8-2014q3-20140805-win32/bin/arm-none-eabi-gdb.exe a.out
GNU gdb (GNU Tools for ARM Embedded Processors) 7.6.0.20140731-cvs
Copyright (C) 2013 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=i686-w64-mingw32 --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from D:\ToolChain\a.out...done.
(gdb) b main.s:9
/home/build/work/GCC-4-8-build/src/gdb/gdb/linespec.c:2445: internal-error: decode_line_full: Assertion `state->canonical_names[i].suffix != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
/home/build/work/GCC-4-8-build/src/gdb/gdb/linespec.c:2445: internal-error: decode_line_full: Assertion `state->canonical_names[i].suffix != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Changed in gcc-arm-embedded:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → 4.8-2015-q3-update
Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
milestone: 4.8-2015-q3-update → 4.9-2014-q4-major
no longer affects: gcc-arm-embedded/4.9
no longer affects: gcc-arm-embedded/4.8
Revision history for this message
Terry Guo (terry.guo) wrote :

Just found this issue is gone in 4.9 Q4 major release candidate. Please try when the release is published.

Changed in gcc-arm-embedded:
status: Confirmed → Fix Committed
Revision history for this message
brent (brent-r) wrote :

Hi Terry,

Thanks; will check it out when it is released.

Best regards

Brent

On 14-10-01 07:21 PM, Terry Guo wrote:
> Just found this issue is gone in 4.9 Q4 major release candidate. Please
> try when the release is published.
>
> ** Changed in: gcc-arm-embedded
> Status: Confirmed => Fix Committed
>

Revision history for this message
Terry Guo (terry.guo) wrote :

Double confirmed that it is fixed in 4.9 major release which is just published. Please try with it.

Changed in gcc-arm-embedded:
status: Fix Committed → Fix Released
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.