From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: SIGTRAP in kill emulation on Windows Date: Fri, 26 Aug 2016 12:13:07 +0300 Message-ID: <83shtrdhb0.fsf@gnu.org> References: <86d1kwj37g.fsf@realize.ch> <83bn0gesab.fsf@gnu.org> <868tvkiplu.fsf@realize.ch> <83wpj4c4yz.fsf@gnu.org> <86zinzhpnx.fsf@realize.ch> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1472202834 32063 195.159.176.226 (26 Aug 2016 09:13:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Aug 2016 09:13:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alain Schneble Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 26 11:13:45 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdDCp-0007Ob-2V for ged-emacs-devel@m.gmane.org; Fri, 26 Aug 2016 11:13:43 +0200 Original-Received: from localhost ([::1]:59617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdDCm-0006Kg-AI for ged-emacs-devel@m.gmane.org; Fri, 26 Aug 2016 05:13:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdDC1-0006Jz-Nm for emacs-devel@gnu.org; Fri, 26 Aug 2016 05:12:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdDBv-0002k0-Mz for emacs-devel@gnu.org; Fri, 26 Aug 2016 05:12:52 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdDBv-0002jv-JH; Fri, 26 Aug 2016 05:12:47 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3672 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bdDBt-000598-LD; Fri, 26 Aug 2016 05:12:46 -0400 In-reply-to: <86zinzhpnx.fsf@realize.ch> (message from Alain Schneble on Fri, 26 Aug 2016 10:58:58 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206814 Archived-At: > From: Alain Schneble > CC: > Date: Fri, 26 Aug 2016 10:58:58 +0200 > > Eli Zaretskii writes: > > >> Sending SIGTRAP to a process -- whether it's an unrelated, child or the > >> calling Emacs process itself -- does not seem to have any effect as long > >> as no debugger is attached to the receiving process. > > > > Do you see the same with the debugbreak program you've built earlier? > > If not, then that program does something that your patch doesn't. > > Yes, debugbreak and the proposed implementation behave identically. Then I guess that's a limitation we will have to live with. It doesn't sound like a grave one to me: after all, what exactly SIGTRAP does when no debugger is attached is not very important, since that is not the primary use case for that signal, AFAIU. If a Lisp program wants to kill the process, it doesn't need to use SIGTRAP. > >> But with all processes I tried, none of them was ever terminated. > > > > That's a pity; on GNU/Linux the target program does terminate. If > > there's nothing that can be done, we will just have to document this > > quirk, at least for many/most programs Emacs users will meet on their > > systems. > > Yes, and on GNU/Linux I observed that it prints a backtrace prior to > termination. That depends on ulimit and suchlikes, I think: on a GNU/Linux system I tried that, the program was simply dumped to the shell prompt without printing anything. > But that's kind of irrelevant here I guess. Where would be the best > place to document this quirk (c, signal-process, info manual)? In the Info manual, I think. > FWIW, there is probably something we could do about it -- query if the > process in question is attached to a debugger. If not, we could > terminate it. That's for the application to decide, IMO. Signal delivery is too low-level to replace one signal with another one.