From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 04 15:47:27 2015 Received: (at submit) by debbugs.gnu.org; 4 Jun 2015 19:47:27 +0000 Received: from localhost ([127.0.0.1]:40816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0b6s-0001ai-Jv for submit@debbugs.gnu.org; Thu, 04 Jun 2015 15:47:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51408) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0b6q-0001WF-0H for submit@debbugs.gnu.org; Thu, 04 Jun 2015 15:47:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0b6j-000156-Rb for submit@debbugs.gnu.org; Thu, 04 Jun 2015 15:47:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:32926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0b6j-00014y-Nj for submit@debbugs.gnu.org; Thu, 04 Jun 2015 15:47:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0b6f-0008PY-Ko for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 15:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0b6c-00010F-EM for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 15:47:13 -0400 Received: from mailrelay102.isp.belgacom.be ([195.238.20.129]:60964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0b6c-0000zi-4P for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 15:47:10 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=d6O4W030xngO5QkzyDOul/vmjwC4sFqcTOV5kZr+d1k= c=1 sm=2 a=a4K5GIyuExAA:10 a=mDV3o1hIAAAA:8 a=a-1JarA0xvu1VgBRLj4A:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AlCQBRqnBV/7KQsltbgxCBMqw+BQYFAQV/mg9NAQEBAQEBgQuEfzskNAEEJTeIMQGoGrQfhhmOZAWaKZtlJIFHAQuCJjwxgkcBAQE Received: from 178.144-178-91.adsl-dyn.isp.belgacom.be (HELO Aurora) ([91.178.144.178]) by relay.skynet.be with ESMTP; 04 Jun 2015 21:47:08 +0200 From: Nicolas Richard To: bug-gnu-emacs@gnu.org Subject: 25.0.50; "Args out of range" with help-window-select t Date: Thu, 04 Jun 2015 21:47:08 +0200 Message-ID: <86vbf3tfwj.fsf@members.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From ./emacs -Q Eval: (progn (setq help-window-select t debug-on-error t) (split-window) (switch-to-buffer "*Messages*") (message (make-string 9999 ?x))) Hit: C-h f if RET I get: Debugger entered--Lisp error: (args-out-of-range 20077) (no backtrace is shown). We can however get a gdb backtrace (I put a breakpoint in Fsignal, but it breaks more often than needed, so I say "continue" a few times in order to get the following) : #2 0x081ec7fe in xsignal1 (error_symbol=4392, arg=40270) at eval.c:1596 No locals. #3 0x0824bd80 in get_char_property_and_overlay (position=40270, prop=8640, object=140654805, overlay=0xbfffeec0) at textprop.c:636 noverlays = 22 overlay_vec = 0x20 obuf = 0x853b698 sa_avail = 22 sa_count = -1073746264 sa_must_free = 8 w = 0x8696cd0 #4 0x08163623 in adjust_point_for_property (last_pt=22, modified=true) at keyboard.c:1704 beg = 139541880 end = -1073746216 val = 135666171 overlay = 0 tmp = -1073746216 check_composition = false check_display = true check_invisible = true orig_pt = 10067 #5 0x081633b4 in command_loop_1 () at keyboard.c:1636 cmd = 1695712 keybuf = {34, 410, 0, 139555992, 0, 1, -1073745932, 143526584, 139555992, 0, 0, 0, -1073746040, 136237958, 2, 141273859, 3, 59, -1220163913, 141710811, 0, 2, 135640074, 141710811, -1073746008, 135668881, 141710811, 0, 0, -1073746008} i = 2 prev_modiff = 10542 prev_buffer = 0x853b698 already_adjusted = false #6 0x081ebfe8 in internal_condition_case (bfun=0x8162727 , handlers=9288, hfun=0x8161f3d ) at eval.c:1348 val = -1073745960 c = 0x88f54f0 #7 0x08162449 in command_loop_2 (ignore=0) at keyboard.c:1139 val = 0 #8 0x081eb8f2 in internal_catch (tag=23016, func=0x816241e , arg=0) at eval.c:1108 val = 23016 c = 0x88e0ac0 #9 0x081623e3 in command_loop () at keyboard.c:1118 No locals. #10 0x08161b9c in recursive_edit_1 () at keyboard.c:728 count = 1 val = 136247918 #11 0x08161d0e in Frecursive_edit () at keyboard.c:799 count = 0 buffer = 0 #12 0x0815fcfa in main (argc=10, argv=0xbffff1f4) at emacs.c:1626 dummy = -1073745664 stack_bottom_variable = 8 '\b' do_initial_setlocale = true dumping = false skip_args = 0 rlim = {rlim_cur = 8388608, rlim_max = 18446744073709551615} no_loadup = false junk = 0x0 dname_arg = 0x0 ch_to_dir = 0x0 original_pwd = 0x0 Looking at recent history shows that adjust_point_for_property was touched recently : Commit 18338b1dff981b17426048dfa20a4c6e6e12c5aa Author: Eli Zaretskii AuthorDate: Tue May 19 18:39:25 2015 +0300 Commit: Eli Zaretskii CommitDate: Tue May 19 18:39:25 2015 +0300 Fix display of overlapping window-specific overlays * src/keyboard.c (adjust_point_for_property): When adjusting point due to display strings, ignore overlays that are specific to windows other than the currently selected one. * src/xdisp.c (handle_single_display_spec): If the display property comes from an overlay, arrange for buffer iteration to resume only after the end of that overlay. (Bug#20607) I understand that get_char_property_and_overlay (make_number (PT), Qdisplay, selected_window, &overlay)) should not refer to PT but to "PT in selected_window", but I don't know how to do that. -- Nico. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 04 18:28:00 2015 Received: (at 20734) by debbugs.gnu.org; 4 Jun 2015 22:28:01 +0000 Received: from localhost ([127.0.0.1]:40894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0dcG-0005eC-7A for submit@debbugs.gnu.org; Thu, 04 Jun 2015 18:28:00 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60877) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0dcE-0005dy-BT for 20734@debbugs.gnu.org; Thu, 04 Jun 2015 18:27:58 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A2FgA731xV/3K9xEVcgxCEAoVVu0CEfoJNBAICgTw6EwEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBAQUBAQEBHos6hQUHhC0FmW2ZUoFFI4QUIoJ4AQEB X-IPAS-Result: A0A2FgA731xV/3K9xEVcgxCEAoVVu0CEfoJNBAICgTw6EwEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBAQUBAQEBHos6hQUHhC0FmW2ZUoFFI4QUIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="124462784" Received: from 69-196-189-114.dsl.teksavvy.com (HELO ceviche.home) ([69.196.189.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Jun 2015 18:27:51 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 7F831661A6; Thu, 4 Jun 2015 18:27:51 -0400 (EDT) From: Stefan Monnier To: Nicolas Richard Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t Message-ID: References: <86vbf3tfwj.fsf@members.fsf.org> Date: Thu, 04 Jun 2015 18:27:51 -0400 In-Reply-To: <86vbf3tfwj.fsf@members.fsf.org> (Nicolas Richard's message of "Thu, 04 Jun 2015 21:47:08 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > We can however get a gdb backtrace (I put a breakpoint in Fsignal, but > it breaks more often than needed, so I say "continue" a few times in > order to get the following) : You can put a break point in maybe_call_debugger, which tends to work better in this sense. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 02:41:45 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 06:41:45 +0000 Received: from localhost ([127.0.0.1]:40977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0lK4-0000T0-Mb for submit@debbugs.gnu.org; Fri, 05 Jun 2015 02:41:45 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:64327) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0lK2-0000Sk-3D for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 02:41:42 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NPG00700L6KHO00@a-mtaout21.012.net.il> for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 09:41:35 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPG00722L9BG250@a-mtaout21.012.net.il>; Fri, 05 Jun 2015 09:41:35 +0300 (IDT) Date: Fri, 05 Jun 2015 09:41:31 +0300 From: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t In-reply-to: <86vbf3tfwj.fsf@members.fsf.org> X-012-Sender: halo1@inter.net.il To: Nicolas Richard Message-id: <83r3pqpsh0.fsf@gnu.org> References: <86vbf3tfwj.fsf@members.fsf.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Nicolas Richard > Date: Thu, 04 Jun 2015 21:47:08 +0200 > > Fix display of overlapping window-specific overlays > > * src/keyboard.c (adjust_point_for_property): When adjusting point > due to display strings, ignore overlays that are specific to > windows other than the currently selected one. > > * src/xdisp.c (handle_single_display_spec): If the display > property comes from an overlay, arrange for buffer iteration to > resume only after the end of that overlay. (Bug#20607) > > I understand that > get_char_property_and_overlay > (make_number (PT), Qdisplay, selected_window, > &overlay)) > should not refer to PT but to "PT in selected_window", but I don't know > how to do that. Are you saying that adjust_point_for_property is called with the current buffer different from what's recorded in selected_window's buffer? If so, please show the evidence: what is in current_buffer and what is recorded as the selected window's buffer at that point. And please note that the conditions in the 'if' clause that determine whether adjust_point_for_property is called freely manipulate values of current_buffer and PT, so perhaps the solution is add there a condition that selected_window's buffer and current_buffer are equal, such that in the case in point adjust_point_for_property is not called at all. To answer your question directly, it should be possible to compute the (Lisp integer) value of point in the selected window as either make_number (marker_position (XWINDOW (selected_window)->pointm)) or Fwindow_point (selected_window) or make_number (XBUFFER (XWINDOW (selected_window)->contents)->pt) From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 05:26:14 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 09:26:14 +0000 Received: from localhost ([127.0.0.1]:41118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0ntF-0004Uf-Op for submit@debbugs.gnu.org; Fri, 05 Jun 2015 05:26:14 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:25562) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0ntC-0004US-Dz for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 05:26:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuEEAMhqcVWkD3Xu/2dsb2JhbABbhEKsVwEBAQEBAQaZWwKCAQEBAQEBAYELhCMBAQMBJ1IFCwgDISUPAQRJExuICgjbawEBAQEGAQEBAQEdhhmFKoUGB4QtBZ91g3iCT4wGg1kkggkcgVQ8MYJHAQEB Received: from wifi-nat238.ulb.ac.be (HELO Aurora) ([164.15.117.238]) by smtp.ulb.ac.be with ESMTP; 05 Jun 2015 11:25:37 +0200 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> Date: Fri, 05 Jun 2015 11:25:35 +0200 In-Reply-To: <83r3pqpsh0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jun 2015 09:41:31 +0300") Message-ID: <867fritskw.fsf@members.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Eli Zaretskii writes: >> I understand that >> get_char_property_and_overlay >> (make_number (PT), Qdisplay, selected_window, >> &overlay)) >> should not refer to PT but to "PT in selected_window", but I don't know >> how to do that. > > Are you saying that adjust_point_for_property is called with the > current buffer different from what's recorded in selected_window's > buffer? Yes, that's what I was guessing anyway. > If so, please show the evidence: what is in current_buffer > and what is recorded as the selected window's buffer at that point. Let me try that. What I did : 1. run under gdb 2. follow the recipe up to the point where I type "C-h f if", but don't hit RET 3. then go to gdb window 4. hit C-z to put a breakpoint in adjust_point_for_property 5. continue 6. go back to emacs and hit RET Now back to gdb : (gdb) p XBUFFER(XWINDOW(selected_window)->contents)->name_ $1 = 143880388 (gdb) xpr Lisp_String $2 = (struct Lisp_String *) 0x89370c0 "*Help*" (gdb) p current_buffer->name_ $3 = 139646148 (gdb) xpr Lisp_String $4 = (struct Lisp_String *) 0x852d4c0 "*Messages*" (gdb) p PT $5 = 10067 (gdb) p Fwindow_point (selected_window) $6 = 6 > And please note that the conditions in the 'if' clause that determine > whether adjust_point_for_property is called freely manipulate values > of current_buffer and PT, so perhaps the solution is add there a > condition that selected_window's buffer and current_buffer are equal, > such that in the case in point adjust_point_for_property is not called > at all. In command_loop_1 ? I can more or less follow the code step by step, but I don't really understand it. The only thing I'm now almost 100% confident is that in this call (found in adjust_point_for_property) : get_char_property_and_overlay (make_number (PT), Qdisplay, selected_window, &overlay)) PT refers to current_buffer, which is different from the buffer in selected_window in the situation I encountered. > To answer your question directly, it should be possible to compute the > (Lisp integer) value of point in the selected window as either Thanks. This works for me, but is it TRT ? Commit 53fb39a08a6d18b67ea6073966874fa700d9f97f References: yf-master Author: Nicolas Richard AuthorDate: Fri Jun 5 11:18:19 2015 +0200 Commit: Nicolas Richard CommitDate: Fri Jun 5 11:20:08 2015 +0200 * src/keyboard.c (adjust_point_for_property): Use selected window (Bug#20590) 1 parent commit, 6 merged branches, 1 containing branch Parent | f10a924 (todo-show): Throw an error if buffer is empty but was modified. Merged | emacs-24 master run-2015-05-29_19-09 running yf-fix-query-replace-with-NULs yf-master Containing | yf-master Follows | emacs-24.5-rc3-fixed (4919) 1 file changed, 4 insertions(+), 2 deletions(-) src/keyboard.c | 6 ++++-- modified src/keyboard.c @@ -1702,8 +1702,10 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified) if (check_display && PT > BEGV && PT < ZV && !NILP (val = get_char_property_and_overlay - (make_number (PT), Qdisplay, selected_window, - &overlay)) + (make_number + (marker_position + (XWINDOW (selected_window)->pointm)), + Qdisplay, selected_window, &overlay)) && display_prop_intangible_p (val, overlay, PT, PT_BYTE) && (!OVERLAYP (overlay) ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) -- Nico. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 05:34:07 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 09:34:08 +0000 Received: from localhost ([127.0.0.1]:41129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0o0t-0004hD-G1 for submit@debbugs.gnu.org; Fri, 05 Jun 2015 05:34:07 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:45121) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0o0r-0004h2-13 for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 05:34:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjYKACJscVWkD3Xu/2dsb2JhbABbhEKsVwEBAQEBAQaZWwKCAQEBAQEBAYELQQWDXQEBAwF5EAgDISUPAQRJE4glCNtmAQEBAQYBAQEBAR2GGYUqhQYHhC0BBJoxjAuPXySDeTwxgkcBAQE Received: from wifi-nat238.ulb.ac.be (HELO Aurora) ([164.15.117.238]) by smtp.ulb.ac.be with ESMTP; 05 Jun 2015 11:33:48 +0200 From: Nicolas Richard To: Stefan Monnier Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t References: <86vbf3tfwj.fsf@members.fsf.org> Date: Fri, 05 Jun 2015 11:33:46 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 04 Jun 2015 18:27:51 -0400") Message-ID: <866172ts79.fsf@members.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Stefan Monnier writes: >> We can however get a gdb backtrace (I put a breakpoint in Fsignal, but >> it breaks more often than needed, so I say "continue" a few times in >> order to get the following) : > > You can put a break point in maybe_call_debugger, which tends to work > better in this sense. Thanks. Would the following make sense in etc/DEBUG ? -`Fsignal' is a very useful place to put a breakpoint in. -All Lisp errors go through there. +`Fsignal' is a very useful place to put a breakpoint in. All Lisp +errors go through there. If you are only interested in errors that +would fire the debugger, breaking at `maybe_call_debugger' is useful. -- Nico. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 09:45:53 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 13:45:53 +0000 Received: from localhost ([127.0.0.1]:41269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0rwW-0003fW-Gn for submit@debbugs.gnu.org; Fri, 05 Jun 2015 09:45:53 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:46211) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0rwS-0003fF-Vt for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 09:45:49 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NPH006004V1II00@a-mtaout20.012.net.il> for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 16:45:35 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPH0066J4VZ9S70@a-mtaout20.012.net.il>; Fri, 05 Jun 2015 16:45:35 +0300 (IDT) Date: Fri, 05 Jun 2015 16:45:32 +0300 From: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t In-reply-to: <867fritskw.fsf@members.fsf.org> X-012-Sender: halo1@inter.net.il To: Nicolas Richard Message-id: <83bngup8ub.fsf@gnu.org> References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> <867fritskw.fsf@members.fsf.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Nicolas Richard > Cc: 20734@debbugs.gnu.org > Date: Fri, 05 Jun 2015 11:25:35 +0200 > > 1. run under gdb > 2. follow the recipe up to the point where I type "C-h f if", but don't > hit RET > 3. then go to gdb window > 4. hit C-z to put a breakpoint in adjust_point_for_property > 5. continue > 6. go back to emacs and hit RET > > Now back to gdb : > (gdb) p XBUFFER(XWINDOW(selected_window)->contents)->name_ > $1 = 143880388 > (gdb) xpr > Lisp_String > $2 = (struct Lisp_String *) 0x89370c0 > "*Help*" You could also do this, which is slightly easier: (gdb) p XWINDOW(selected_window)->contents (gdb) xtype # make sure it's a buffer (gdb) xbuffer > > And please note that the conditions in the 'if' clause that determine > > whether adjust_point_for_property is called freely manipulate values > > of current_buffer and PT, so perhaps the solution is add there a > > condition that selected_window's buffer and current_buffer are equal, > > such that in the case in point adjust_point_for_property is not called > > at all. > > In command_loop_1 ? Yes. > I can more or less follow the code step by step, but I don't really > understand it. The only thing I'm now almost 100% confident is that in > this call (found in adjust_point_for_property) : > get_char_property_and_overlay > (make_number (PT), Qdisplay, selected_window, > &overlay)) > PT refers to current_buffer, which is different from the buffer in > selected_window in the situation I encountered. Yes, that's the bug. But the real problem is that we've switched windows temporarily, and we shouldn't move point in the current buffer at all when we do that. > > To answer your question directly, it should be possible to compute the > > (Lisp integer) value of point in the selected window as either > > Thanks. This works for me, but is it TRT ? No, I think we shouldn't call adjust_point_for_property in this case at all. Can you see if adding && EQ (XWINDOW (selected_window)->contents, current_buffer) to the condition that guards the call to adjust_point_for_property fixes the problem? I.e., instead of this (after the label 'finalize'): if (current_buffer == prev_buffer && last_point_position != PT && NILP (Vdisable_point_adjustment) && NILP (Vglobal_disable_point_adjustment)) the condition should read if (current_buffer == prev_buffer && EQ (XWINDOW (selected_window)->contents, current_buffer) && last_point_position != PT && NILP (Vdisable_point_adjustment) && NILP (Vglobal_disable_point_adjustment)) IOW, if the selected window's buffer is not the current buffer, we shouldn't be adjusting point in the current buffer at all. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 09:46:33 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 13:46:33 +0000 Received: from localhost ([127.0.0.1]:41273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0rxA-0003gt-M5 for submit@debbugs.gnu.org; Fri, 05 Jun 2015 09:46:32 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:55962) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0rx8-0003gd-3P for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 09:46:30 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NPH000004FZ4M00@a-mtaout23.012.net.il> for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 16:46:24 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPH000TN4XB5000@a-mtaout23.012.net.il>; Fri, 05 Jun 2015 16:46:24 +0300 (IDT) Date: Fri, 05 Jun 2015 16:46:20 +0300 From: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t In-reply-to: <866172ts79.fsf@members.fsf.org> X-012-Sender: halo1@inter.net.il To: Nicolas Richard Message-id: <83a8wep8sz.fsf@gnu.org> References: <86vbf3tfwj.fsf@members.fsf.org> <866172ts79.fsf@members.fsf.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20734 Cc: monnier@iro.umontreal.ca, 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Nicolas Richard > Date: Fri, 05 Jun 2015 11:33:46 +0200 > Cc: 20734@debbugs.gnu.org > > Stefan Monnier writes: > > >> We can however get a gdb backtrace (I put a breakpoint in Fsignal, but > >> it breaks more often than needed, so I say "continue" a few times in > >> order to get the following) : > > > > You can put a break point in maybe_call_debugger, which tends to work > > better in this sense. > > Thanks. Would the following make sense in etc/DEBUG ? > > -`Fsignal' is a very useful place to put a breakpoint in. > -All Lisp errors go through there. > +`Fsignal' is a very useful place to put a breakpoint in. All Lisp > +errors go through there. If you are only interested in errors that > +would fire the debugger, breaking at `maybe_call_debugger' is useful. This is good, thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 15:49:12 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 19:49:12 +0000 Received: from localhost ([127.0.0.1]:42114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0xc8-0005Ql-83 for submit@debbugs.gnu.org; Fri, 05 Jun 2015 15:49:12 -0400 Received: from mailrelay117.isp.belgacom.be ([195.238.20.144]:46072) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0xc5-0005QU-2r for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 15:49:09 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=i+EX5EtM4g4P/CrLY+sx2nOWHsqv9AlVwqc0uudqMuE= c=1 sm=2 a=a4K5GIyuExAA:10 a=IkcTkHD0fZMA:10 a=mDV3o1hIAAAA:8 a=2ezBBItVNe95PRnNio0A:9 a=QEXdDO2ut3YA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BoEQDM/HFV/7KQsltbgxCBMoMeqUUFAYEEkQWHUgKBNTsSAQEBAQEBAYEKQQODXwEBAwEjBC8jBQsIAxoCBSECAg8BBCUkE4glDAG3faQGAQEBBwIBH4EhhHiFKoRTMweCaIFFAQSGba8uJIN5PDGBAySBIAEBAQ Received: from 178.144-178-91.adsl-dyn.isp.belgacom.be (HELO Aurora) ([91.178.144.178]) by relay.skynet.be with ESMTP; 05 Jun 2015 21:48:42 +0200 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> <867fritskw.fsf@members.fsf.org> <83bngup8ub.fsf@gnu.org> Date: Fri, 05 Jun 2015 21:48:40 +0200 In-Reply-To: <83bngup8ub.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jun 2015 16:45:32 +0300") Message-ID: <866172rl5z.fsf@members.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Yes, that's the bug. But the real problem is that we've switched > windows temporarily, and we shouldn't move point in the current buffer > at all when we do that. Ok. I think I understand now. What about adding an assertion to make sure current_buffer is shown in selected_window at that point? > I think we shouldn't call adjust_point_for_property in this case > at all. Can you see if adding > > && EQ (XWINDOW (selected_window)->contents, current_buffer) > > to the condition that guards the call to adjust_point_for_property > fixes the problem? Yes it does, but I wrapped the lhs into XBUFFER : && EQ (XBUFFER (XWINDOW (selected_window)->contents), current_buffer) otherwise it complains: --8<---------------cut here---------------start------------->8--- In file included from keyboard.c:26:0: keyboard.c: In function =E2=80=98command_loop_1=E2=80=99: lisp.h:339:34: warning: comparison between pointer and integer [enabled by = default] #define lisp_h_EQ(x, y) (XLI (x) =3D=3D XLI (y)) ^ lisp.h:388:19: note: in expansion of macro =E2=80=98lisp_h_EQ=E2=80=99 # define EQ(x, y) lisp_h_EQ (x, y) ^ keyboard.c:1621:7: note: in expansion of macro =E2=80=98EQ=E2=80=99 && EQ (XWINDOW (selected_window)->contents, current_buffer) ^ --8<---------------cut here---------------end--------------->8--- --=20 Nico. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 05 15:56:31 2015 Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 19:56:31 +0000 Received: from localhost ([127.0.0.1]:42156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0xjD-0005cO-3H for submit@debbugs.gnu.org; Fri, 05 Jun 2015 15:56:31 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:43990) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0xj7-0005bq-16 for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 15:56:25 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NPH00G00L8JGQ00@mtaout24.012.net.il> for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 22:48:00 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPH00FFELO0GZ30@mtaout24.012.net.il>; Fri, 05 Jun 2015 22:48:00 +0300 (IDT) Date: Fri, 05 Jun 2015 22:56:16 +0300 From: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t In-reply-to: <866172rl5z.fsf@members.fsf.org> X-012-Sender: halo1@inter.net.il To: Nicolas Richard Message-id: <83pp5and3z.fsf@gnu.org> References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> <867fritskw.fsf@members.fsf.org> <83bngup8ub.fsf@gnu.org> <866172rl5z.fsf@members.fsf.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Nicolas Richard > Cc: 20734@debbugs.gnu.org > Date: Fri, 05 Jun 2015 21:48:40 +0200 > > Eli Zaretskii writes: > > Yes, that's the bug. But the real problem is that we've switched > > windows temporarily, and we shouldn't move point in the current buffer > > at all when we do that. > > Ok. I think I understand now. What about adding an assertion to make > sure current_buffer is shown in selected_window at that point? That'd be fine with me. > > I think we shouldn't call adjust_point_for_property in this case > > at all. Can you see if adding > > > > && EQ (XWINDOW (selected_window)->contents, current_buffer) > > > > to the condition that guards the call to adjust_point_for_property > > fixes the problem? > > Yes it does, but I wrapped the lhs into XBUFFER : > > && EQ (XBUFFER (XWINDOW (selected_window)->contents), current_buffer) Sorry, my bad. But in that case, you don't need EQ, just use == to compare 2 C pointers. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 06 04:44:37 2015 Received: (at 20734-done) by debbugs.gnu.org; 6 Jun 2015 08:44:37 +0000 Received: from localhost ([127.0.0.1]:42537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z19iW-0006ST-Fa for submit@debbugs.gnu.org; Sat, 06 Jun 2015 04:44:37 -0400 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:38058) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z19iT-0006SC-Rc for 20734-done@debbugs.gnu.org; Sat, 06 Jun 2015 04:44:34 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=Q1Q/C1EQSVRz+P2kPc4NLwp2Y210MHxbkbuPGccmY1k= c=1 sm=2 a=a4K5GIyuExAA:10 a=nmk0J00Q2oT7sOBZjwYA:9 a=aBChNl1bNp0A:10 a=e11NVG2hIEkA:10 a=inoG4m36AAAA:8 a=gVAV3d_zucKrCcLm70kA:9 a=L5RQGbJKxCZruY3lWrAA:9 a=uNfrmFbzc7gA:10 a=BJZSS4nxfoIA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DoFwDvsXJV/7KQsltbgxCBMqxfAQEBAQEBBQEFf5hegS1NAQEBAQEBgQtBA4NeAQEBAwEnLyMFCwgDEQMBAgolDwEEJRYIBhMbiAoMAdsQAQEBAQYCAR+GGYUqhHURhDQBBJ91kk2DWSSDeTwxgkcBAQE Received: from 178.144-178-91.adsl-dyn.isp.belgacom.be (HELO Aurora) ([91.178.144.178]) by relay.skynet.be with ESMTP; 06 Jun 2015 10:44:27 +0200 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> <867fritskw.fsf@members.fsf.org> <83bngup8ub.fsf@gnu.org> <866172rl5z.fsf@members.fsf.org> <83pp5and3z.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Date: Sat, 06 Jun 2015 10:44:26 +0200 Message-ID: <866171kyz9.fsf@members.fsf.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20734-done Cc: 20734-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain >> Ok. I think I understand now. What about adding an assertion to make >> sure current_buffer is shown in selected_window at that point? > > That'd be fine with me. I can suggest : --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-assertion-in-adjust_point_for_property.patch >From 52cd3204743442fc6d8fc281ed3d9b0b0e6a88e4 Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Sat, 6 Jun 2015 10:05:07 +0200 Subject: [PATCH] Add assertion in adjust_point_for_property * src/keyboard.c (adjust_point_for_property): Add eassert for current buffer being shown in selected window. --- src/keyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index bedd10b..23f7ce7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1687,6 +1687,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified) bool check_composition = ! modified, check_display = 1, check_invisible = 1; ptrdiff_t orig_pt = PT; + eassert (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer); + /* FIXME: cycling is probably not necessary because these properties can't be usefully combined anyway. */ while (check_composition || check_display || check_invisible) -- 1.9.1 --=-=-= Content-Type: text/plain >> && EQ (XBUFFER (XWINDOW (selected_window)->contents), current_buffer) > in that case, you don't need EQ, just use == to > compare 2 C pointers. Ok, I pushed that solution as d31cd49 and I mark the bug as done. Thanks for your guidance. -- Nico. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 06 04:56:58 2015 Received: (at 20734) by debbugs.gnu.org; 6 Jun 2015 08:56:58 +0000 Received: from localhost ([127.0.0.1]:42544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z19uT-0006jY-GJ for submit@debbugs.gnu.org; Sat, 06 Jun 2015 04:56:57 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:47447) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z19uR-0006jK-9i for 20734@debbugs.gnu.org; Sat, 06 Jun 2015 04:56:55 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NPI00D00M5U6000@a-mtaout20.012.net.il> for 20734@debbugs.gnu.org; Sat, 06 Jun 2015 11:56:49 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NPI00D39M6O5E10@a-mtaout20.012.net.il>; Sat, 06 Jun 2015 11:56:49 +0300 (IDT) Date: Sat, 06 Jun 2015 11:56:47 +0300 From: Eli Zaretskii Subject: Re: bug#20734: 25.0.50; "Args out of range" with help-window-select t In-reply-to: <866171kyz9.fsf@members.fsf.org> X-012-Sender: halo1@inter.net.il To: Nicolas Richard Message-id: <838ubxnrjk.fsf@gnu.org> References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> <867fritskw.fsf@members.fsf.org> <83bngup8ub.fsf@gnu.org> <866172rl5z.fsf@members.fsf.org> <83pp5and3z.fsf@gnu.org> <866171kyz9.fsf@members.fsf.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20734 Cc: 20734@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Nicolas Richard > Cc: 20734-done@debbugs.gnu.org > Date: Sat, 06 Jun 2015 10:44:26 +0200 > > + eassert (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer); Fine with me, please push. Thanks. > Ok, I pushed that solution as d31cd49 and I mark the bug as done. Thanks > for your guidance. Great, thanks. From unknown Wed Aug 20 01:20:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Jul 2015 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator