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 dap/31354] [gdb/dap] FAIL: gdb.dap/pause.exp: python command failed
Date: Thu, 08 Feb 2024 12:47:59 +0000	[thread overview]
Message-ID: <bug-31354-4717-C5jETj0Em4@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31354-4717@http.sourceware.org/bugzilla/>

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
So, AFAICT the following happens:
- dap calls gdb.interrupt to cancel a request
- in gdbpy_interrupt, the quit flag is set
- at the end of gdbpy_interrupt, the no_python_sigint destructor is called,
  which calls restore_active_language, during which check_quit_flag is called,
  followed by set_quit_flag
- this calls gdbpy_set_quit_flag, which calls PyErr_SetInterrupt
  (I'm not sure if that's legal at this point.  It's not necessary to hold the
GIL,
  but we're also in a PyEval_SaveThread context which has set thread state to
null).
- the interrupt is caught while executing the python script using
PyRun_SimpleFile,
  throwing a KeyboardInterrupt exception
- the KeyboardInterrupt propagates up to PyRun_SimpleFile, where the exception
is
  dumped on the output 
- PyRun_SimpleFile returns -1 because of the KeyboardInterrupt exception, but
  that's silently ignored by python_run_simple_file

The KeyboardInterrupt is intended to propagate all the way up to the python
runnable, which would capture the exception and hand it back to the dap thread,
but instead it's captured by PyRun_SimpleFile.

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

  reply	other threads:[~2024-02-08 12:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  8:41 [Bug dap/31354] New: " vries at gcc dot gnu.org
2024-02-08 12:47 ` vries at gcc dot gnu.org [this message]
2024-02-08 16:54 ` [Bug dap/31354] " tromey at sourceware dot org
2024-02-15 18:55 ` tromey at sourceware dot org
2024-02-16 18:38 ` tromey at sourceware dot org
2024-02-27 16:56 ` cvs-commit at gcc dot gnu.org
2024-02-27 16:56 ` cvs-commit at gcc dot gnu.org
2024-02-27 16:57 ` tromey at sourceware dot org

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-31354-4717-C5jETj0Em4@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).