From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18649: 25.0.50; Closing TTY menus on MS-Windows Date: Wed, 08 Oct 2014 15:49:37 +0300 Message-ID: <83fveyk9pa.fsf@gnu.org> References: <83oatnlw6i.fsf@gnu.org> <543504AF.9050300@gmx.at> <83lhoqkg67.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1412772631 10015 80.91.229.3 (8 Oct 2014 12:50:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2014 12:50:31 +0000 (UTC) Cc: 18649-done@debbugs.gnu.org To: rudalics@gmx.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 08 14:50:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XbqhD-0004bg-F8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Oct 2014 14:50:23 +0200 Original-Received: from localhost ([::1]:36015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbqhD-00086L-2u for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Oct 2014 08:50:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xbqh4-000846-7f for bug-gnu-emacs@gnu.org; Wed, 08 Oct 2014 08:50:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xbqgt-0000Qj-C7 for bug-gnu-emacs@gnu.org; Wed, 08 Oct 2014 08:50:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xbqgt-0000QN-9u for bug-gnu-emacs@gnu.org; Wed, 08 Oct 2014 08:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xbqgs-0006Qj-U5 for bug-gnu-emacs@gnu.org; Wed, 08 Oct 2014 08:50:03 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Oct 2014 12:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 18649 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 18649@debbugs.gnu.org, eliz@gnu.org, dmoncayo@gmail.com Original-Received: via spool by 18649-done@debbugs.gnu.org id=D18649.141277257224674 (code D ref 18649); Wed, 08 Oct 2014 12:50:01 +0000 Original-Received: (at 18649-done) by debbugs.gnu.org; 8 Oct 2014 12:49:32 +0000 Original-Received: from localhost ([127.0.0.1]:37523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbqgN-0006Pt-BI for submit@debbugs.gnu.org; Wed, 08 Oct 2014 08:49:32 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:41776) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbqgH-0006Pg-Sc for 18649-done@debbugs.gnu.org; Wed, 08 Oct 2014 08:49:27 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0ND400900LE2PX00@mtaout24.012.net.il> for 18649-done@debbugs.gnu.org; Wed, 08 Oct 2014 15:43:16 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0ND4006P8M04IR50@mtaout24.012.net.il>; Wed, 08 Oct 2014 15:43:16 +0300 (IDT) In-reply-to: <83lhoqkg67.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94290 > Date: Wed, 08 Oct 2014 13:29:52 +0300 > From: Eli Zaretskii > Cc: 18649@debbugs.gnu.org > > > Date: Wed, 08 Oct 2014 11:32:31 +0200 > > From: martin rudalics > > CC: 18649@debbugs.gnu.org > > > > > IOW, we throw to top level too early > > > or too radically. > > > > Do you see any way to debug this? > > If no other idea presents itself, the hard way: by stepping through > the code in keyboard.c that processes keyboard input. There _is_ a better way: set a breakpoint in process_quit_flag (which is called as part of QUIT), and see who called it. Using this method, I was able to catch the villain in no time, see below. > > > Update: the problem is definitely caused by r117587; reverting it > > > fixes the problem. I reviewed the diffs, more than once, and I cannot > > > see what could be the reason. Martin, your help will be appreciated. > > > > I'm just as lost as you are. I tried to partially revert changes that > > could have affected this on w32 but with no luck. > > Sigh. I guess that commit just exposed some other bug, then. It wasn't an old bug, it was indeed caused by the pixel-wise changes. Specifically, the fact that as part of the call to change_frame_size, we can now call Lisp (in frame_windows_min_size). The other part of the puzzle is that w32_console_read_socket calls change_frame_size unconditionally on every event it reads, because Windows doesn't tell us about resizes of the console window. So what happened was that we read the C-g key, called kbd_buffer_store_event for it, which set Vquit_flag, and then we called change_frame_size, which did QUIT when frame_windows_min_size called Lisp. I fixed that by passing a non-zero DELAY argument to change_frame_size, so that it delays the actual resize to the next opportunity, like the next redisplay cycle. I'm closing this bug. For the record, here's the backtrace I obtained from the breakpoint set in process_quit_flag: #0 process_quit_flag () at eval.c:1440 #1 0x0118e71f in Ffuncall (nargs=4, args=0x82e780) at eval.c:2659 #2 0x0118e5bd in call3 (fn=22541890, arg1=22499637, arg2=22425250, arg3=22425250) at eval.c:2592 #3 0x01010acd in frame_windows_min_size (frame=22499637, horizontal=22425250, pixelwise=22425250) at frame.c:333 #4 0x01010cce in adjust_frame_size (f=0x1575130 , new_width=80, new_height=56, inhibit=5, pretend=false) at frame.c:409 #5 0x0100e9a2 in change_frame_size_1 (f=0x1575130 , new_width=80, new_height=56, pretend=false, delay=false, safe=false, pixelwise=false) at dispnew.c:5531 #6 0x0100ea00 in change_frame_size (f=0x1575130 , new_width=80, new_height=56, pretend=false, delay=false, safe=false, pixelwise=false) at dispnew.c:5562 #7 0x0123c934 in maybe_generate_resize_event () at w32inevt.c:605 #8 0x0123cc99 in w32_console_read_socket ( terminal=0x18fd358 , hold_quit=0x82e9ac) at w32inevt.c:795 #9 0x0110a875 in gobble_input () at keyboard.c:6911 #10 0x01104e33 in kbd_buffer_get_event (kbp=0x82eac4, used_mouse_menu=0x82ed93, end_time=0x0) at keyboard.c:3957 #11 0x011011f4 in read_event_from_main_queue (end_time=0x0, local_getcjmp=0x82ebec, used_mouse_menu=0x82ed93) at keyboard.c:2254 #12 0x01101430 in read_decoded_event_from_main_queue (end_time=0x0, local_getcjmp=0x82ebec, prev_event=22425218, used_mouse_menu=0x82ed93) at keyboard.c:2319 #13 0x01102886 in read_char (commandflag=0, map=24485206, prev_event=22425218, used_mouse_menu=0x82ed93, end_time=0x0) at keyboard.c:2916 #14 0x0110f4cb in read_key_sequence (keybuf=0x82eeb4, bufsize=30, prompt=19897305, dont_downcase_last=false, can_return_switch_frame=false, fix_current_buffer=false, prevent_redisplay=false) at keyboard.c:9171 #15 0x01110bf6 in read_key_sequence_vs (prompt=19897305, continue_echo=22425218, dont_downcase_last=22425218, can_return_switch_frame=22425218, cmd_loop=22425218, allow_string=true) at keyboard.c:9865 #16 0x01110cad in Fread_key_sequence (prompt=19897305, continue_echo=22425218, dont_downcase_last=22425218, can_return_switch_frame=22425218, cmd_loop=22425218) at keyboard.c:9938 #17 0x0118eaf4 in Ffuncall (nargs=2, args=0x82f014) at eval.c:2739 #18 0x011d05f9 in exec_byte_code (bytestr=19897113, vector=19897141, maxdepth=16, args_template=22425218, nargs=0, args=0x0) at bytecode.c:920 #19 0x011cfa56 in Fbyte_code (bytestr=19897113, vector=19897141, maxdepth=16) at bytecode.c:486 #20 0x0118d70c in eval_sub (form=19897102) at eval.c:2184 #21 0x0118cf0e in Feval (form=19897102, lexical=22425218) at eval.c:1993 #22 0x01186634 in Fcall_interactively (function=24528330, record_flag=22425218, keys=22450893) at callint.c:379 #23 0x0118ea75 in Ffuncall (nargs=4, args=0x82f56c) at eval.c:2730 #24 0x011d05f9 in exec_byte_code (bytestr=19853809, vector=19853829, maxdepth=52, args_template=4100, nargs=1, args=0x82f8a0) at bytecode.c:920 #25 0x0118f24d in funcall_lambda (fun=19853789, nargs=1, arg_vector=0x82f89c) at eval.c:2890 #26 0x0118ec5a in Ffuncall (nargs=2, args=0x82f898) at eval.c:2772 #27 0x0118e55d in call1 (fn=22471274, arg1=24528330) at eval.c:2576 #28 0x010ffab9 in command_loop_1 () at keyboard.c:1569 #29 0x0118b976 in internal_condition_case (bfun=0x10ff458 , handlers=22478818, hfun=0x10fecbd ) at eval.c:1344 #30 0x010ff110 in command_loop_2 (ignore=22425218) at keyboard.c:1197 #31 0x0118af11 in internal_catch (tag=22476146, func=0x10ff0ec , arg=22425218) at eval.c:1105 #32 0x010ff0c6 in command_loop () at keyboard.c:1176 #33 0x010fe85a in recursive_edit_1 () at keyboard.c:786 #34 0x010fea16 in Frecursive_edit () at keyboard.c:857 #35 0x010fcafd in main (argc=3, argv=0xa42808) at emacs.c:1643 Lisp Backtrace: "read-key-sequence" (0x82f018) "byte-code" (0x82f298) "call-interactively" (0x82f570) "command-execute" (0x82f89c)