public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: He Leon <leon.he@msn.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: APP cannot be interrupted to gdb console by contrl+c, if APP enters into kernel mode via ioctl.
Date: Wed, 3 Feb 2021 09:01:20 -0500	[thread overview]
Message-ID: <A7C9B58E-D40F-42B5-A06B-AF067D98BE39@comcast.net> (raw)
In-Reply-To: <ME3PR01MB6104A7C20E589FCA43C0B389EEB49@ME3PR01MB6104.ausprd01.prod.outlook.com>



> On Feb 2, 2021, at 11:13 PM, He Leon <leon.he@msn.com> wrote:
> 
> Paul,
> 
> Thanks for your reply.
> 
> 1) APP cannot capture interrupt: for current *PROCESS*  or for current *THREAD*?
> 
>     For multi-thread secario, if current thread stays inside ioctl and other threads are not.  Can "contrl+c" work for gdb and switch to other thread?
>     I have checked this, seems not work. 

Process, I believe.  Signals are delivered to a process.

> 
> 2) Actually my ioctl is very simple, only inifinit loop of "printk()" or "msleep()", how it impacts "interruptible" attribution?
> 
>     seem if not quit from ioctl, "control+c" doesn't work.
>     I have even added "set_current_state(TASK_INTERRUPTIBLE)" in ioctl, still doesn't work.

I don't know Linux drivers (is this Linux?).  In the operating systems I know, a thread isn't interruptible in kernel mode.  That makes sense, in kernel mode there can be kernel state being modified, and to allow the thread to be interrupted in the middle of that would make the OS state invalid.  So typically syscalls or drivers have to allow explicitly for interrupts at specific points in their execution.  If they do, an interrupt can take effect but only at those points; if they don't do this then the operation isn't interruptible at all and Control/C doesn't take effect until the thread returns to user mode.

Again, that's a general statement; I don't know the Linux specifics.  

	paul


      parent reply	other threads:[~2021-02-03 14:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 12:13 He Leon
2021-02-02 13:47 ` Paul Koning
     [not found]   ` <ME3PR01MB6104A7C20E589FCA43C0B389EEB49@ME3PR01MB6104.ausprd01.prod.outlook.com>
2021-02-03 14:01     ` Paul Koning [this message]

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=A7C9B58E-D40F-42B5-A06B-AF067D98BE39@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gdb@sourceware.org \
    --cc=leon.he@msn.com \
    /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).