From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25875: 26.0.50; Hang logging out of MS-Windows Date: Mon, 27 Feb 2017 17:36:23 +0200 Message-ID: <83shmzprwo.fsf@gnu.org> References: <83lgsuqacv.fsf@gnu.org> <83efylq7m4.fsf@gnu.org> <834lzgreqq.fsf@gnu.org> <3f07808e-ab1c-d6b5-9ea0-dfc4c6fd6fc9@cornell.edu> <8337f0rbz6.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488211102 14200 195.159.176.226 (27 Feb 2017 15:58:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 15:58:22 +0000 (UTC) Cc: 25875@debbugs.gnu.org To: Richard Copley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 27 16:58:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ciNgi-0002ke-0I for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 16:58:12 +0100 Original-Received: from localhost ([::1]:53876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciNgn-0002Hk-U1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 10:58:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciNMI-0000kD-5a for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 10:37:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciNME-00054e-9Y for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 10:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciNME-00054a-6A for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 10:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ciNMD-0007h9-TE for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 10:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2017 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25875 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25875-submit@debbugs.gnu.org id=B25875.148820981229564 (code B ref 25875); Mon, 27 Feb 2017 15:37:01 +0000 Original-Received: (at 25875) by debbugs.gnu.org; 27 Feb 2017 15:36:52 +0000 Original-Received: from localhost ([127.0.0.1]:58453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciNM4-0007gm-Ah for submit@debbugs.gnu.org; Mon, 27 Feb 2017 10:36:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciNM2-0007gX-IR for 25875@debbugs.gnu.org; Mon, 27 Feb 2017 10:36:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciNLu-000501-38 for 25875@debbugs.gnu.org; Mon, 27 Feb 2017 10:36:45 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciNLt-0004zx-Vr; Mon, 27 Feb 2017 10:36:42 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2744 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ciNLt-0003HT-7A; Mon, 27 Feb 2017 10:36:41 -0500 In-reply-to: (message from Richard Copley on Mon, 27 Feb 2017 08:14:22 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129883 Archived-At: > From: Richard Copley > Date: Mon, 27 Feb 2017 08:14:22 +0000 > Cc: Eli Zaretskii , 25875@debbugs.gnu.org > > > Here's a quick and dirty attempt. If I haven't made a mistake, it replaces > > every relevant call to SendMessage by a call to SendMessageTimeout with a > > 100ms timeout. > > > > --- a/src/w32term.c > > +++ b/src/w32term.c > > @@ -537,6 +537,15 @@ x_update_begin (struct frame *f) > > } > > > > > > +#undef SendMessage > > +#define SendMessage DebugSendMessage > > + > > +static LRESULT WINAPI > > +DebugSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) > > +{ > > + return SendMessageTimeoutA (hWnd, Msg, wParam, lParam, 0, 100, NULL); > > +} > > + > > /* Start update of window W. */ > > > > static void > > > > Ken > > Sorry Ken, I can't sabotage myself like that, I have work to do. This could be a misunderstanding: the above change is not supposed to sabotage anything, it's supposed to be a 100% compatible change for the current behavior when all threads are running, and also provide a "fire escape" when the addressee of the message is for some reason stuck, as we think happens in your scenario. If you are unwilling to make such a sweeping change, could you at least replace the call SendMessage in my_show_window with SendMessageTimeoutA, using the above patch as a template? TIA