emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGTRAP in kill emulation on Windows


From: Eli Zaretskii
Subject: Re: SIGTRAP in kill emulation on Windows
Date: Fri, 26 Aug 2016 11:24:52 +0300

> From: Alain Schneble <address@hidden>
> CC: <address@hidden>
> 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 <address@hidden>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]