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 11:24:52 +0300 Message-ID: <83wpj4c4yz.fsf@gnu.org> References: <86d1kwj37g.fsf@realize.ch> <83bn0gesab.fsf@gnu.org> <868tvkiplu.fsf@realize.ch> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1472199918 22761 195.159.176.226 (26 Aug 2016 08:25:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Aug 2016 08:25:18 +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 10:25:14 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 1bdCRq-0005GZ-Uz for ged-emacs-devel@m.gmane.org; Fri, 26 Aug 2016 10:25:11 +0200 Original-Received: from localhost ([::1]:59506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdCRp-0004GY-4H for ged-emacs-devel@m.gmane.org; Fri, 26 Aug 2016 04:25:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdCRR-0004ER-FY for emacs-devel@gnu.org; Fri, 26 Aug 2016 04:25:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdCRE-0007Bc-Dq for emacs-devel@gnu.org; Fri, 26 Aug 2016 04:24:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdCRE-0007Ax-8V; Fri, 26 Aug 2016 04:24:32 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3633 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bdCRC-00082R-Fs; Fri, 26 Aug 2016 04:24:30 -0400 In-reply-to: <868tvkiplu.fsf@realize.ch> (message from Alain Schneble on Thu, 25 Aug 2016 22:02:37 +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:206812 Archived-At: > From: Alain Schneble > CC: > Date: Thu, 25 Aug 2016 22:02:37 +0200 > > > Please test what this functionality does when PID specifies a child > > process of Emacs (which is tracked via the child_procs[] array), and > > also when it specifies the calling Emacs process itself. If any of > > these use cases cause any kind of trouble, we may wish to disallow > > such usage, to prevent users from shooting themselves in the foot. > > 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. Also, were all the programs you tried built with MinGW? If so, perhaps try with other programs, like Python or one of the programs that came with Windows. I think the results of the call depend on the exception handlers installed by the program when it starts, so different programs and different ways of building programs might have different effects. And finally, what happens if you signal the calling Emacs process that is itself being debugged? I guess the debugger will kick in, but if you then continue execution, does Emacs continues to run normally? > At least this is what I observe on Windows 10. Shall I test on > other OS versions as well? We could ask people here to test on other versions and report their results. > If so, I would have to install say an Win XP first as I do not > have one available right now. I could test on XP here. > Unfortunately, on MSDN the remark on > DebugBreakProcess says it causes the receiving process to terminate in > most cases, see > https://msdn.microsoft.com/en-us/library/windows/desktop/ms679298(v=vs.85).aspx > > 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. > >From ecf00b52957bb0bf15735180a67cc9ce7027ff19 Mon Sep 17 00:00:00 2001 > From: Alain Schneble > Date: Thu, 25 Aug 2016 21:31:48 +0200 > Subject: [PATCH] Support SIGTRAP in kill emulation on Windows The (latest version of) your patch looks fine to me, modulo the issues mentioned above. If nothing new and no other comments come up within a week, let's install this, with the necessary updates for the NEWS entry. Thanks.