public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH v5 1/6] [gdb/cli] Add signal_handler_selftest
Date: Wed, 22 Nov 2023 17:26:43 +0100	[thread overview]
Message-ID: <a527d06b-2b2c-45ee-9532-2090ee4e3d9e@suse.de> (raw)
In-Reply-To: <20231024094933.12009-2-tdevries@suse.de>

On 10/24/23 11:49, Tom de Vries wrote:
> +signal_handler_selftest::signal_handler_selftest () +{ + /* If SIGINT 
> or SIGTERM is pending, try to handle it as usual. */ + QUIT; + + /* 
> Assert SIGTERM is not pending. */ + gdb_assert (!pending_sigterm ()); + 
> + if (check_quit_flag ()) + { + /* SIGINT is still pending. This can 
> happen because QUIT doesn't + handle pending SIGINT in all cases. Bail 
> out. */ + set_quit_flag (); + return; + } + + /* Assert SIGINT is not 
> pending. */ + gdb_assert (!pending_sigint ()); +

I was about to check in this patch, and the following that uses it in 
the python selftest, but I decided to play a bit more with it, and ran 
the selftests while hitting control-C, and ran into:
...
Running selftest python.
/data/vries/gdb/src/gdb/event-top.c:1246: internal-error: 
signal_handler_selftest: Assertion `!pending_sigint ()' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x5a1ac2 gdb_internal_backtrace_1
	/data/vries/gdb/src/gdb/bt-utils.c:122
0x5a1b65 _Z22gdb_internal_backtracev
	/data/vries/gdb/src/gdb/bt-utils.c:168
0xcf93d6 internal_vproblem
	/data/vries/gdb/src/gdb/utils.c:396
0xcf97a5 _Z15internal_verrorPKciS0_P13__va_list_tag
	/data/vries/gdb/src/gdb/utils.c:476
0x14b002e _Z18internal_error_locPKciS0_z
	/data/vries/gdb/src/gdbsupport/errors.cc:58
0x788092 _ZN9selftests23signal_handler_selftestC2Ev
	/data/vries/gdb/src/gdb/event-top.c:1246
0xa84b53 test_python
	/data/vries/gdb/src/gdb/python/python.c:2331
0x42258f ???
0x6104af _ZNKSt8functionIFvvEEclEv
	/usr/include/c++/9/bits/std_function.h:688
0x14c4632 _ZN9selftests9run_testsEN3gdb10array_viewIKPKcEEb
	/data/vries/gdb/src/gdbsupport/selftest.cc:101
0x91cbaa maintenance_selftest
	/data/vries/gdb/src/gdb/maint.c:1164
0x5f60ee do_simple_func
	/data/vries/gdb/src/gdb/cli/cli-decode.c:95
0x5fb0e1 _Z8cmd_funcP16cmd_list_elementPKci
	/data/vries/gdb/src/gdb/cli/cli-decode.c:2735
0xc605b2 _Z15execute_commandPKci
	/data/vries/gdb/src/gdb/top.c:575
0x912551 catch_command_errors
	/data/vries/gdb/src/gdb/main.c:513
0x91275c execute_cmdargs
	/data/vries/gdb/src/gdb/main.c:612
0x913aac captured_main_1
	/data/vries/gdb/src/gdb/main.c:1293
0x913caf captured_main
	/data/vries/gdb/src/gdb/main.c:1314
0x913d4e _Z8gdb_mainP18captured_main_args
	/data/vries/gdb/src/gdb/main.c:1343
0x4188bd main
	/data/vries/gdb/src/gdb/gdb.c:39
---------------------
/data/vries/gdb/src/gdb/event-top.c:1246: internal-error: 
signal_handler_selftest: Assertion `!pending_sigint ()' 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]
...

I'm not sure yet how this happens, but it's clear this needs further work.

Thanks,
- Tom

  reply	other threads:[~2023-11-22 16:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  9:49 [PATCH v5 0/6] [gdb/cli] Allow source highlighting to be interrupted Tom de Vries
2023-10-24  9:49 ` [PATCH v5 1/6] [gdb/cli] Add signal_handler_selftest Tom de Vries
2023-11-22 16:26   ` Tom de Vries [this message]
2023-10-24  9:49 ` [PATCH v5 2/6] [gdb/python] Make python selftest more robust Tom de Vries
2023-10-24  9:49 ` [PATCH v5 3/6] [gdb/cli] Add gnu-source-highlight selftest Tom de Vries
2023-10-24 12:33   ` Tom de Vries
2023-10-24  9:49 ` [PATCH v5 4/6] [gdb/cli] Allow source highlighting to be interrupted Tom de Vries
2023-10-24  9:49 ` [PATCH v5 5/6] [gdb/cli] Ask if source highlighting should " Tom de Vries
2023-10-24  9:49 ` [PATCH v5 6/6] [gdb/cli] Simplify gdb_highlight_event_listener::notify Tom de Vries

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=a527d06b-2b2c-45ee-9532-2090ee4e3d9e@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@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).