From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-ch2-03v.sys.comcast.net (resqmta-ch2-03v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:35]) by sourceware.org (Postfix) with ESMTPS id 27AB6398E425 for ; Wed, 3 Feb 2021 14:01:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 27AB6398E425 Received: from resomta-ch2-15v.sys.comcast.net ([69.252.207.111]) by resqmta-ch2-03v.sys.comcast.net with ESMTP id 7GR5lP6Rtf72J7IihlnKyi; Wed, 03 Feb 2021 14:01:23 +0000 Received: from pkoning.akdesign.com ([73.60.223.101]) by resomta-ch2-15v.sys.comcast.net with ESMTPSA id 7Iiflmgxj1LZY7Iigl81xE; Wed, 03 Feb 2021 14:01:23 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgeduledrgedvgdehkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtddvnecuhfhrohhmpefrrghulhcumfhonhhinhhguceophgruhhlkhhonhhinhhgsegtohhmtggrshhtrdhnvghtqeenucggtffrrghtthgvrhhnpedvtdevjeeuhefhiedvteffjeeuffehkefgudeutdevffefkeeijeelfeevuefhgeenucfkphepjeefrdeitddrvddvfedruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehpkhhonhhinhhgrdgrkhguvghsihhgnhdrtghomhdpihhnvghtpeejfedriedtrddvvdefrddutddupdhmrghilhhfrhhomhepphgruhhlkhhonhhinhhgsegtohhmtggrshhtrdhnvghtpdhrtghpthhtoheplhgvohhnrdhhvgesmhhsnhdrtghomhdprhgtphhtthhopehguggssehsohhurhgtvgifrghrvgdrohhrgh X-Xfinity-VMeta: sc=-100.00;st=legit Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: APP cannot be interrupted to gdb console by contrl+c, if APP enters into kernel mode via ioctl. From: Paul Koning In-Reply-To: Date: Wed, 3 Feb 2021 09:01:20 -0500 Cc: "gdb@sourceware.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: He Leon X-Mailer: Apple Mail (2.3445.104.17) X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 14:01:25 -0000 > On Feb 2, 2021, at 11:13 PM, He Leon wrote: >=20 > Paul, >=20 > Thanks for your reply. >=20 > 1) APP cannot capture interrupt: for current *PROCESS* or for current = *THREAD*? >=20 > 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.=20 Process, I believe. Signals are delivered to a process. >=20 > 2) Actually my ioctl is very simple, only inifinit loop of "printk()" = or "msleep()", how it impacts "interruptible" attribution? >=20 > 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. =20 paul