public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/26881] infrun.c:6384: internal-error: void process_event_stop_test(execution_control_state*): Assertion `ecs->event_thread->control.exception_resume_breakpoint != NULL' failed.
Date: Sun, 15 Nov 2020 00:24:30 +0000	[thread overview]
Message-ID: <bug-26881-4717-jRSzdsVJOO@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26881-4717@http.sourceware.org/bugzilla/>

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

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
So, minimal version:
...
     1  #include <iostream>
     2
     3  void
     4  function1 (int val)
     5  {
     6    throw val;
     7  }
     8
     9  void
    10  function3 (int val)
    11  {
    12    {
    13      try
    14        {
    15          function1 (val);
    16        }
    17      catch (...) 
    18        {
    19          std::cout << "Caught and handled function1 exception" <<
std::endl;
    20        }
    21    }
    22  }
    23
    24  int
    25  main (void) 
    26  { 
    27    function3 (3);
    28
    29    return 0;
    30  }
...

Compiled like:
...
$ $ g++ nextoverthrow.cc -g
...

Reproduces like so:
...
$ gdb -batch ./a.out -ex 'b 27' -ex run -ex next
Breakpoint 1 at 0x400ae4: file nextoverthrow.cc, line 27.

Breakpoint 1, main () at nextoverthrow.cc:27
27        function3 (3);
infrun.c:6384: internal-error: void
process_event_stop_test(execution_control_state*): Assertion
`ecs->event_thread->control.exception_resume_breakpoint != NULL' failed.
...

With -ex "set debug infrun 1", we see:
...
Breakpoint 1, main () at nextoverthrow.cc:27
27        function3 (3);
[infrun] infrun_async: enable=0
[infrun] clear_proceed_status_thread: process 4142
[infrun] proceed: addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT
[infrun] start_step_over: step-over queue now empty
[infrun] start_step_over: resuming [process 4142] for step-over
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread
[process 4142] at 0x400ae4
[infrun] infrun_async: enable=1
[infrun] prepare_to_wait: prepare_to_wait
[infrun] proceed: [process 4142] resumed
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x400ae9
[infrun] process_event_stop_test: stepping inside range [0x400ae4-0x400aee]
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=0, current thread
[process 4142] at 0x400ae9
[infrun] prepare_to_wait: prepare_to_wait
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x400a83
[infrun] process_event_stop_test: stepped into subroutine
[infrun] insert_step_resume_breakpoint_at_sal_1: inserting step-resume
breakpoint at 0x400aee
[infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread
[process 4142] at 0x400a83
[infrun] prepare_to_wait: prepare_to_wait
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x7ffff74af050
[infrun] process_event_stop_test: BPSTAT_WHAT_SET_LONGJMP_RESUME
[infrun] insert_exception_resume_breakpoint: exception resume at 400a9b
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread
[process 4142] at 0x7ffff74af050
[infrun] prepare_to_wait: prepare_to_wait
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x7ffff74af054
[infrun] process_event_stop_test: BPSTAT_WHAT_SET_LONGJMP_RESUME
[infrun] insert_exception_resume_from_probe: exception resume at 0x400a9b
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread
[process 4142] at 0x7ffff74af054
[infrun] prepare_to_wait: prepare_to_wait
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x7ffff74af055
[infrun] process_event_stop_test: step-resume breakpoint is inserted
[infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread
[process 4142] at 0x7ffff74af055
[infrun] prepare_to_wait: prepare_to_wait
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x400a9b
[infrun] process_event_stop_test: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
[infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread
[process 4142] at 0x400a9b
[infrun] prepare_to_wait: prepare_to_wait
[infrun] target_wait (-1.0.0, status) =
[infrun]   4142.4142.0 [process 4142],
[infrun]   status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal =
GDB_SIGNAL_TRAP
[infrun] handle_signal_stop: stop_pc=0x400a9b
[infrun] process_event_stop_test: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
/home/vries/gdb_versions/devel/src/gdb/infrun.c:6384: internal-error: void
process_event_stop_test(execution_control_state*): Assertion
`ecs->event_thread->control.exception_resume_breakpoint != NULL' failed.
...

So, the first time we do BPSTAT_WHAT_CLEAR_LONGJMP_RESUME, we delete
ecs->event_thread->control.exception_resume_breakpoint.

Then we choose case 3, to keep going:
...
                /* Case 3.  */
                keep_going (ecs);
                return;
...

But it seems some somehow we hit again BPSTAT_WHAT_CLEAR_LONGJMP_RESUME at the
same stop_pc. And then run into the assert, because we've deleted it the first
time round.

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

  parent reply	other threads:[~2020-11-15  0:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14  9:58 [Bug gdb/26881] New: " vries at gcc dot gnu.org
2020-11-14 10:41 ` [Bug gdb/26881] " vries at gcc dot gnu.org
2020-11-14 10:45 ` vries at gcc dot gnu.org
2020-11-14 10:49 ` vries at gcc dot gnu.org
2020-11-14 13:07 ` vries at gcc dot gnu.org
2020-11-14 19:45 ` vries at gcc dot gnu.org
2020-11-15  0:24 ` vries at gcc dot gnu.org [this message]
2020-11-15  0:30 ` vries at gcc dot gnu.org
2020-11-16 14:35 ` vries at gcc dot gnu.org
2020-11-21  8:58 ` vries at gcc dot gnu.org
2021-01-05 10:41 ` vries at gcc dot gnu.org
2021-01-05 10:44 ` vries at gcc dot gnu.org
2021-01-05 13:30 ` [Bug breakpoints/26881] " vries at gcc dot gnu.org
2021-01-08 10:11 ` cvs-commit at gcc dot gnu.org
2021-01-08 10:58 ` cvs-commit at gcc dot gnu.org
2021-01-08 11:00 ` vries at gcc dot gnu.org
2021-06-27 17:49 ` ahmedsayeed1982 at yahoo dot com
2021-08-10 11:45 ` ucelsanicin at yahoo dot com
2021-08-27 17:51 ` ribevi6798 at enamelme dot com
2021-08-28 18:31 ` buranlevent at yahoo dot com
2021-09-06  9:10 ` focixujo at livinginsurance dot co.uk
2021-09-10 19:40 ` mehmetgelisin at aol dot com
2021-09-14 17:28 ` johnb6174 at gmail dot com
2021-09-14 18:48 ` mark at klomp dot org
2021-10-09 11:00 ` gulsenenginar at aol dot com
2021-10-17 19:48 ` vmireskazki at gmail dot com
2021-10-18 19:58 ` ahmedsayeed1982 at hotmail dot com
2021-10-19  7:15 ` progonsaytu at gmail dot com
2021-10-23 13:45 ` fiteva5725 at bomoads dot com
2021-10-24 10:02 ` glassmtech at ukr dot net
2021-10-29 10:57 ` kimolsun2020 at outlook dot com
2021-10-29 12:06 ` huracantili20 at gmail dot com
2021-11-02 15:21 ` gepaw63633 at dukeoo dot com
2021-11-06 21:11 ` paneki8601 at dukeoo dot com
2021-11-13 19:31 ` tesaso8237 at funboxcn dot com
2021-11-16 19:04 ` xecana8007 at funboxcn dot com
2021-11-22  7:37 ` gexed96894 at keagenan dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26881-4717-jRSzdsVJOO@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).