Bug 26576 - infrun.c:5335: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected'
Summary: infrun.c:5335: internal-error: int finish_step_over(execution_control_state*)...
Status: WAITING
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: 8.3.1
: P2 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-05 05:42 UTC by mathieu
Modified: 2022-11-29 20:38 UTC (History)
4 users (show)

See Also:
Host: Windows 10
Target: ARM GCC
Build:
Last reconfirmed: 2022-11-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mathieu 2020-09-05 05:42:52 UTC
OS: Windows 10
Fatal error when server sends ->~"[New Thread 2]\n"

Upgrading to newest version of Arm toolchain doesn't resolve the issue

    C:\Program Files (x86)\GNU Arm Embedded Toolchain\9 2020-q2-update\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    GNU gdb (GNU Arm Embedded Toolchain 9-2020-q2-update) 8.3.1.20191211-git
    Copyright (C) 2019 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.

Stack trace of the debug session included below
    1: (112559) 1106: elapsed time 2
    1: (112560) <-1107-var-create - * "ftp_err"
    1: (112569) ->1107^done,name="var30",numchild="0",value="<optimized out>",type="TcpServerStartStatus",thread-id="2",has_more="0"
    1: (112570) ->(gdb)
    1: (112570) 1107: elapsed time 9
    1: (112570) ->&"\n"
    1: (112570) ->^done
    1: (112570) ->(gdb)
    <--   C (variables-43): {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":43}
    <--   C (stepIn-44): {"command":"stepIn","arguments":{"threadId":536886584},"type":"request","seq":44}
    1: (114754) <-1108-exec-step
    1: (114764) ->1108^running
    1: (114764) ->*running,thread-id="all"
    1: (114764) 1108: elapsed time 9
    1: (114765) ->(gdb)
    1: (114765) ->&"\n"
    1: (114770) ->^done
    1: (114770) ->(gdb)
    1: (114895) ->=thread-created,id="7",group-id="i1"
    1: (114895) <-1109-thread-info 7
    1: (114895) ->~"[New Thread 2]\n"
    1: (114896) ->&"/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-200_20200521_1590053374/src/gdb/gdb/infrun.c:5335: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\n"
    1: (114897) ->&"\nThis is a bug, please report it."
    1: (114897) ->&"  For instructions, see:\n<http://www.gnu.org/software/gdb/bugs/>."
    1: (114897) ->&"\n\n"
    [New Thread 2]
    1: (115046) "C:\Program Files (x86)\GNU Arm Embedded Toolchain\9 2020-q2-update\bin\arm-none-eabi-gdb.exe" exited with code 3 (0x3).
    1: (115054) <-logout
    1: (115055) <-logout
    1: (115062) Send Event AD7MessageEvent
ERROR: GDB exited unexpectedly with exit code 3 (0x3). Debugging will now abort.
    1: (115065) Send Event AD7ProgramDestroyEvent
The program 'C:\Users\mjmen\Documents\vscode\pvconnex\firmware\BUILD\DISCO_F746NG\GCC_ARM-DEBUG\firmware.elf' has exited with code -1 (0xffffffff).
    <--   C (disconnect-45): {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":45}

Possible duplicates :

Bug 21497 - FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
Bug 21774 - Ubuntu: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
Bug 22063 - infrun.c:5570: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed.
Bug 22925 - gdb assumes target can activate threads at will, causes internal error in infrun.c in 'finish_step_over'
Bug 24674 - GDB crash on remote target reconnect: Assertion `ecs->event_thread->control.trap_expected' failed.
Bug 26284 - [arm] infrun.c:5312: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
Comment 1 Simon Marchi 2020-09-06 12:34:01 UTC
This bug targets an old branch (8.3.x).  Can you please check with the master branch (soon to be the 10.x branch), as no further fixes will be made to the 8.3.x branch?
Comment 2 Luke 2020-09-13 19:07:24 UTC
I'm having the same issue except with MSYS2 (apologies if it is wrong to post this here, but I thought it could help), with the error exactly as described.

I w working with a downgraded version of MinGW gdb (8.3.1-3). Upgrading to the latest package available on MSYS2 9.1.4 is no help - it does change the error line to 5292, rather than 5335.

I've tried multiple versions of GDB, but eventually (though it doesn't happen all the time) after reaching a breakpoint, and entering 'next' or 'continue', there's an error in infrun.
Comment 3 Tom Tromey 2020-10-31 18:05:10 UTC
(In reply to Luke from comment #2)
> I'm having the same issue except with MSYS2 (apologies if it is wrong to
> post this here, but I thought it could help), with the error exactly as
> described.

There was a bug in windows-nat.c that had these symptoms.
That's been fixed, so try a newer gdb.
Comment 4 Tom Tromey 2022-11-29 20:38:56 UTC
Is this still an issue?