public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
       [not found] <bug-21497-4717@http.sourceware.org/bugzilla/>
@ 2022-11-25 16:23 ` morrand276 at gmail dot com
  2022-11-29 20:26 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: morrand276 at gmail dot com @ 2022-11-25 16:23 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=21497

Andrew Morris <morrand276 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |morrand276 at gmail dot com

--- Comment #6 from Andrew Morris <morrand276 at gmail dot com> ---
Hate to comment on a five-year-old bug report, but this or something very much
like it is now coming up for me in GDB 12.1 coming from FreeBSD ports (where
they call it 12.1_1). I do see a couple of other, more recent, bug reports that
sound similar (26819 and 27509 are what I have in my notes here) but as this
one is specific to FreeBSD I wanted to file here rather than there.

In the replay below, it's coming up pretty reliably when stepping around line
597 of the code. I have also gotten it while stepping into the constructor
there rather than stepping over it, but both times there was a "new LWP" notice
right before the error.

System says it's: FreeBSD [hostname] 12.3-RELEASE-p8 FreeBSD 12.3-RELEASE-p8
releng/12.3-n234239-458f3d1c51a4 EARL  amd64
Compiler says it's: gcc version 10.3.0 (FreeBSD Ports Collection)

The code under test at line 597 is me trying to fish out an unrelated error and
is not necessarily going to make any practical sense.

---
earl:build_debug $ gdb salsa
GNU gdb (GDB) 12.1 [GDB v12.1 for FreeBSD]
Copyright (C) 2022 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 "x86_64-portbld-freebsd12.3".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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"...
Reading symbols from salsa...
(gdb) br mapping.cpp:597
Breakpoint 1 at 0x4c99bc: file /home/morrand/salsa-1.15/src/gui/mapping.cpp,
line 597.
(gdb) r
Starting program: /usr/home/morrand/salsa-1.15/build_debug/salsa 
[New LWP 102353 of process 87800]
[New LWP 102354 of process 87800]
[Detaching after fork from child process 87802]
[New LWP 102355 of process 87800]
qt.svg: Cannot open file
'/usr/home/morrand/salsa-1.15/data/marble/svg/mercurymap.svg', because: No such
file or directory
[Other unfound files cut out for brevity]
libGL error: No matching fbConfigs or visuals found
warning: Temporarily disabling breakpoints for unloaded shared library
"/usr/local/llvm13/lib/libLLVM-13.so"
libGL error: failed to load driver: swrast
[New LWP 102357 of process 87800]

Thread 1 hit Breakpoint 1, Mapping::sortPointsInFolders (this=0x8056b7800) at
/home/morrand/salsa-1.15/src/gui/mapping.cpp:597
597         Marble::GeoDataFolder *testOne = new GeoDataFolder;
(gdb) info threads
  Id   Target Id                   Frame 
* 1    LWP 101791 of process 87800 Mapping::sortPointsInFolders (
    this=0x8056b7800) at /home/morrand/salsa-1.15/src/gui/mapping.cpp:597
  2    LWP 102353 of process 87800 _poll () at _poll.S:3
  3    LWP 102354 of process 87800 _poll () at _poll.S:3
  4    LWP 102355 of process 87800 _poll () at _poll.S:3
  5    LWP 102357 of process 87800 thread_start (curthread=0x80bbf7f00)
    at /usr/src/lib/libthr/thread/thr_create.c:256
(gdb) l
592     }
593
594     void Mapping::sortPointsInFolders()
595     {    
596     //  The following is just some test code to see how all this works and
(I hope) why it doesn't.
597         Marble::GeoDataFolder *testOne = new GeoDataFolder;
598         Marble::GeoDataFolder *testTwo = new GeoDataFolder();
599         
600         testOne->setName(QString("Tweedledee"));
601         testTwo->setName(QString("Tweedledum"));
(gdb) n
[New LWP 102356 of process 87800]
/usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:5825: internal-error:
finish_step_over: Assertion `ecs->event_thread->control.trap_expected' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x12b3e61 _ZL24gdb_internal_backtrace_1v
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/bt-utils.c:122
0x12b3e61 _Z22gdb_internal_backtracev
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/bt-utils.c:122
0x12b3e61 _Z22gdb_internal_backtracev
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/bt-utils.c:168
0x16cdd4d _ZL17internal_vproblemP16internal_problemPKciS2_P13__va_list_tag
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/utils.c:394
0x16cdbc8 _Z15internal_verrorPKciS0_P13__va_list_tag
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/utils.c:471
0x1b237f3 _Z14internal_errorPKciS0_z
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdbsupport/errors.cc:55
0x144d22a _ZL16finish_step_overP23execution_control_state
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:5825
0x144d22a _ZL18handle_signal_stopP23execution_control_state
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:5935
0x1442299 _ZL21handle_inferior_eventP23execution_control_state
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:5681
0x1440e4f _Z20fetch_inferior_eventv
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:4085
0x1b23eb2 _ZL18gdb_wait_for_eventi
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdbsupport/event-loop.cc:0
0x1b238f6 _Z16gdb_do_one_eventv
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdbsupport/event-loop.cc:212
0x148f854 _ZL16start_event_loopv
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/main.c:421
0x148f854 _ZL21captured_command_loopv
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/main.c:481
0x148c844 _ZL13captured_mainPv
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/main.c:1351
0x148c844 _Z8gdb_mainP18captured_main_args
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/main.c:1366
0x11e184d main
        /usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/gdb.c:38
---------------------
/usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:5825: internal-error:
finish_step_over: Assertion `ecs->event_thread->control.trap_expected' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y   

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

/usr/ports/devel/gdb/work-py39/gdb-12.1/gdb/infrun.c:5825: internal-error:
finish_step_over: Assertion `ecs->event_thread->control.trap_expected' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Abort trap (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
       [not found] <bug-21497-4717@http.sourceware.org/bugzilla/>
  2022-11-25 16:23 ` [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed morrand276 at gmail dot com
@ 2022-11-29 20:26 ` tromey at sourceware dot org
  2023-08-14 20:39 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2022-11-29 20:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=21497

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
> Hate to comment on a five-year-old bug report

Totally fine :)
I'm not sure why the patches here never landed.
John?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
       [not found] <bug-21497-4717@http.sourceware.org/bugzilla/>
  2022-11-25 16:23 ` [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed morrand276 at gmail dot com
  2022-11-29 20:26 ` tromey at sourceware dot org
@ 2023-08-14 20:39 ` cvs-commit at gcc dot gnu.org
  2024-01-08 18:57 ` ssbssa at sourceware dot org
  2024-01-08 21:21 ` jhb at FreeBSD dot org
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-14 20:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=21497

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by John Baldwin <jhb@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a6f51542941e072d942fc8df7353bd10097974ea

commit a6f51542941e072d942fc8df7353bd10097974ea
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Mon Aug 14 13:38:42 2023 -0700

    fbsd-nat: Defer any ineligible events reported by wait.

    If wait_1 finds an event for a thread or process that does not match
    the set of threads and processes previously resumed, defer the event.
    If the event is for a specific thread, suspend the thread and continue
    the associated process before waiting for another event.

    One specific example of such an event is if a thread is created while
    another thread in the same process hits a breakpoint.  If the second
    thread's event is reported first, the target resume method does not
    yet "know" about the new thread and will not suspend it via
    PT_SUSPEND.  When wait is called, it will probably return the event
    from the first thread before the result of the step from second
    thread.  This is the case reported in PR 21497.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21497

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
       [not found] <bug-21497-4717@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2023-08-14 20:39 ` cvs-commit at gcc dot gnu.org
@ 2024-01-08 18:57 ` ssbssa at sourceware dot org
  2024-01-08 21:21 ` jhb at FreeBSD dot org
  4 siblings, 0 replies; 5+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-08 18:57 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=21497

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #9 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to Sourceware Commits from comment #8)
> The master branch has been updated by John Baldwin <jhb@sourceware.org>:
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=a6f51542941e072d942fc8df7353bd10097974ea
> 
> commit a6f51542941e072d942fc8df7353bd10097974ea
> Author: John Baldwin <jhb@FreeBSD.org>
> Date:   Mon Aug 14 13:38:42 2023 -0700
> 
>     fbsd-nat: Defer any ineligible events reported by wait.
>     
>     If wait_1 finds an event for a thread or process that does not match
>     the set of threads and processes previously resumed, defer the event.
>     If the event is for a specific thread, suspend the thread and continue
>     the associated process before waiting for another event.
>     
>     One specific example of such an event is if a thread is created while
>     another thread in the same process hits a breakpoint.  If the second
>     thread's event is reported first, the target resume method does not
>     yet "know" about the new thread and will not suspend it via
>     PT_SUSPEND.  When wait is called, it will probably return the event
>     from the first thread before the result of the step from second
>     thread.  This is the case reported in PR 21497.
>     
>     Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21497

Can this be closed?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed
       [not found] <bug-21497-4717@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2024-01-08 18:57 ` ssbssa at sourceware dot org
@ 2024-01-08 21:21 ` jhb at FreeBSD dot org
  4 siblings, 0 replies; 5+ messages in thread
From: jhb at FreeBSD dot org @ 2024-01-08 21:21 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=21497

jhb at FreeBSD dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from jhb at FreeBSD dot org ---
Should be fixed by the referenced commit which was included in GDB 14.1.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-08 21:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21497-4717@http.sourceware.org/bugzilla/>
2022-11-25 16:23 ` [Bug breakpoints/21497] FreeBSD: infrun.c:5565: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed morrand276 at gmail dot com
2022-11-29 20:26 ` tromey at sourceware dot org
2023-08-14 20:39 ` cvs-commit at gcc dot gnu.org
2024-01-08 18:57 ` ssbssa at sourceware dot org
2024-01-08 21:21 ` jhb at FreeBSD dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).