From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28850: 26.0.90; Error running timer 'jit-lock-stealth-fontify': (error "Invalid search bound (wrong side of point)") Date: Wed, 01 May 2019 21:49:07 +0300 Message-ID: <83y33qovrw.fsf@gnu.org> References: <83lgkcgzs9.fsf@gnu.org> <20171022201340.GA16074@ACM> <834lqoa9jj.fsf@gnu.org> <20171024203312.GA5875@ACM> <20171025191137.GA16060@ACM> <83wp3h7tar.fsf@gnu.org> <87o94oz210.fsf@tcd.ie> <20190430113302.GB4142@ACM> <8736lzirbn.fsf@tcd.ie> <83h8afsee5.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128106"; mail-complaints-to="usenet@blaine.gmane.org" Cc: contovob@tcd.ie, 28850@debbugs.gnu.org To: acm@muc.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 01 20:50:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLuJ8-000XCG-Li for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2019 20:50:18 +0200 Original-Received: from localhost ([127.0.0.1]:38435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLuJ7-0000Dx-Kg for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 May 2019 14:50:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLuIw-0000Cy-Fr for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:50:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLuIu-00068h-Ea for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:50:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59595) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLuIu-00068Q-Ap for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:50:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hLuIs-0004Jw-3Y for bug-gnu-emacs@gnu.org; Wed, 01 May 2019 14:50:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 May 2019 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28850 X-GNU-PR-Package: emacs Original-Received: via spool by 28850-submit@debbugs.gnu.org id=B28850.155673656316557 (code B ref 28850); Wed, 01 May 2019 18:50:02 +0000 Original-Received: (at 28850) by debbugs.gnu.org; 1 May 2019 18:49:23 +0000 Original-Received: from localhost ([127.0.0.1]:44906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLuIE-0004Iz-NS for submit@debbugs.gnu.org; Wed, 01 May 2019 14:49:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLuIC-0004Il-Qi for 28850@debbugs.gnu.org; Wed, 01 May 2019 14:49:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLuI6-0005pR-Pb; Wed, 01 May 2019 14:49:14 -0400 Original-Received: from [176.228.60.248] (port=1935 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hLuI5-00046R-TZ; Wed, 01 May 2019 14:49:14 -0400 In-reply-to: <83h8afsee5.fsf@gnu.org> (message from Eli Zaretskii on Tue, 30 Apr 2019 18:26:26 +0300) 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: 209.51.188.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:158596 Archived-At: > Date: Tue, 30 Apr 2019 18:26:26 +0300 > From: Eli Zaretskii > Cc: acm@muc.de, 28850@debbugs.gnu.org > > FWIW, I think I see something similar in Emacs 26.2, I will try to > catch it one of these days. Done. The error messages are slightly different: wrong-type-argument number-or-marker-p nil. It was very hard to debug, but eventually I succeeded to catch a backtrace: Thread 1 hit Breakpoint 5, wrong_type_argument (predicate=XIL(0x9f90), value=XIL(0)) at data.c:146 146 { #0 wrong_type_argument (predicate=XIL(0x9f90), value=XIL(0)) at data.c:146 #1 0x01127519 in CHECK_TYPE (x=XIL(0), predicate=, ok=0) at lisp.h:625 #2 Fadd1 (number=XIL(0)) at data.c:3125 #3 0x011429ba in eval_sub (form=XIL(0xc000000018bb6b60)) at eval.c:2241 #4 0x01142768 in eval_sub (form=XIL(0xc000000018bb6b40)) at eval.c:2229 #5 0x01142ee0 in Fprogn (body=) at eval.c:459 #6 0x0113af02 in Fsave_excursion (args=XIL(0xc000000018bb6af0)) at editfns.c:1050 #7 0x01142a9a in eval_sub (form=XIL(0xc000000018bb6b20)) at eval.c:2193 #8 0x0114300b in Fprogn (body=) at eval.c:459 #9 Fcond (args=) at eval.c:439 #10 0x01142a9a in eval_sub (form=XIL(0xc000000018bb6950)) at eval.c:2193 #11 0x01146b24 in Fsetq (args=XIL(0xc000000018bb6930)) at eval.c:517 #12 0x01142a9a in eval_sub (form=XIL(0xc000000018bb6940)) at eval.c:2193 #13 0x01147612 in Fprogn (body=) at eval.c:459 #14 Flet (args=) at eval.c:973 #15 0x01142a9a in eval_sub (form=XIL(0xc000000018bb66d0)) at eval.c:2193 #16 0x01142f53 in Fprogn (body=) at eval.c:459 #17 Fif (args=XIL(0xc000000018b9ff50)) at eval.c:415 #18 0x01142a9a in eval_sub (form=XIL(0xc000000018b9ffa0)) at eval.c:2193 #19 0x01142ee0 in Fprogn (body=) at eval.c:459 #20 0x01141574 in internal_catch (tag=XIL(0x809f040), func=func@entry=0x1142eb2 , arg=XIL(0xc000000018ba0490)) at eval.c:1101 #21 0x0114782a in Fcatch (args=XIL(0xc000000018ba04e0)) at eval.c:1078 #22 0x01142a9a in eval_sub (form=XIL(0xc000000018ba04f0)) at eval.c:2193 #23 0x011477e1 in Fwhile (args=XIL(0xc000000018b1c810)) at eval.c:989 #24 0x01142a9a in eval_sub (form=XIL(0xc000000018b1c840)) at eval.c:2193 #25 0x01142f53 in Fprogn (body=) at eval.c:459 #26 Fif (args=XIL(0xc000000018b7a4b0)) at eval.c:415 #27 0x01142a9a in eval_sub (form=XIL(0xc000000018b7a4c0)) at eval.c:2193 #28 0x01142ee0 in Fprogn (body=) at eval.c:459 #29 0x0113dc1a in Fsave_restriction (body=XIL(0xc000000018bb5160)) at editfns.c:3990 #30 0x01142a9a in eval_sub (form=XIL(0xc000000018bb5170)) at eval.c:2193 #31 0x01147612 in Fprogn (body=) at eval.c:459 #32 Flet (args=) at eval.c:973 #33 0x01142a9a in eval_sub (form=XIL(0xc000000018625d50)) at eval.c:2193 #34 0x0114345d in Fprogn (body=) at eval.c:459 #35 funcall_lambda (fun=XIL(0xc000000018625d40), nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x88bbf0) at eval.c:3052 #36 0x0114215a in apply_lambda (fun=, args=, count=, count@entry=84) at eval.c:2913 #37 0x0114263a in eval_sub (form=XIL(0xc00000001c7bd2b0)) at eval.c:2316 #38 0x01146b24 in Fsetq (args=XIL(0xc00000001c7bd2c0)) at eval.c:517 #39 0x01142a9a in eval_sub (form=XIL(0xc00000001c7bd2d0)) at eval.c:2193 #40 0x01142768 in eval_sub (form=XIL(0xc00000001c7bd2e0)) at eval.c:2229 #41 0x01142768 in eval_sub (form=XIL(0xc00000001c7bd2f0)) at eval.c:2229 #42 0x01142e9e in Fand (args=) at eval.c:393 #43 0x01142a9a in eval_sub (form=XIL(0xc00000001c7c5550)) at eval.c:2193 #44 0x011477e1 in Fwhile (args=XIL(0xc00000001c7c5380)) at eval.c:989 #45 0x01142a9a in eval_sub (form=XIL(0xc00000001c7c5390)) at eval.c:2193 #46 0x01147612 in Fprogn (body=) at eval.c:459 #47 Flet (args=) at eval.c:973 #48 0x01142a9a in eval_sub (form=XIL(0xc00000001c7c52c0)) at eval.c:2193 #49 0x01147233 in Fprogn (body=) at eval.c:459 #50 FletX (args=XIL(0xc00000001c7c3ed0)) at eval.c:904 #51 0x01142a9a in eval_sub (form=XIL(0xc00000001c7c3ec0)) at eval.c:2193 #52 0x01142ee0 in Fprogn (body=) at eval.c:459 #53 0x01141574 in internal_catch (tag=XIL(0xfeb19468), func=func@entry=0x1142eb2 , arg=XIL(0xc00000001c7c3e90)) at eval.c:1101 #54 0x0114782a in Fcatch (args=XIL(0xc00000001c7c3ea0)) at eval.c:1078 #55 0x01142a9a in eval_sub (form=XIL(0xc00000001c7c3eb0)) at eval.c:2193 #56 0x0114345d in Fprogn (body=) at eval.c:459 #57 funcall_lambda (fun=XIL(0xc00000001c7c3e80), nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x88c810) at eval.c:3052 #58 0x011437c9 in Ffuncall (nargs=2, args=args@entry=0x88c808) at eval.c:2790 #59 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=0, args=, args@entry=0x0) at bytecode.c:630 #60 0x01143291 in funcall_lambda (fun=XIL(0xa00000000adfab48), nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x88cb00) at eval.c:3059 #61 0x011437c9 in Ffuncall (nargs=2, args=args@entry=0x88caf8) at eval.c:2790 #62 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=0, args=, args@entry=0x0) at bytecode.c:630 #63 0x01143291 in funcall_lambda (fun=XIL(0xa000000001324700), nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x88d0c0) at eval.c:3059 #64 0x011437c9 in Ffuncall (nargs=4, args=args@entry=0x88d0b8) at eval.c:2790 #65 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=0, args=, args@entry=0x0) at bytecode.c:630 #66 0x01143291 in funcall_lambda (fun=XIL(0xa000000001323638), nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x88d410) at eval.c:3059 #67 0x011437c9 in Ffuncall (nargs=4, args=args@entry=0x88d408) at eval.c:2790 #68 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=0, args=, args@entry=0x0) at bytecode.c:630 #69 0x01143291 in funcall_lambda (fun=XIL(0xa00000000ae74d20), nargs=nargs@entry=3, arg_vector=arg_vector@entry=0x88d740) at eval.c:3059 #70 0x011437c9 in Ffuncall (nargs=4, args=args@entry=0x88d738) at eval.c:2790 #71 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=0, args=, args@entry=0x0) at bytecode.c:630 #72 0x01143291 in funcall_lambda (fun=XIL(0xa000000001323038), nargs=nargs@entry=2, arg_vector=arg_vector@entry=0x88d9e8) at eval.c:3059 #73 0x011437c9 in Ffuncall (nargs=3, args=args@entry=0x88d9e0) at eval.c:2790 #74 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=1, args=, args@entry=0x88de08) at bytecode.c:630 #75 0x011433ec in funcall_lambda (fun=, nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x88de08) at eval.c:2977 #76 0x011437c9 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x88de00) at eval.c:2790 #77 0x0114393e in run_hook_wrapped_funcall (nargs=nargs@entry=2, args=args@entry=0x88de00) at eval.c:2503 #78 0x01141a36 in run_hook_with_args (nargs=2, args=0x88de00, funcall=0x114390e ) at eval.c:2584 #79 0x0114389b in Ffuncall (nargs=3, args=args@entry=0x88ddf8) at eval.c:2776 #80 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=2, args=, args@entry=0x88e150) at bytecode.c:630 #81 0x011433ec in funcall_lambda (fun=, nargs=nargs@entry=2, arg_vector=arg_vector@entry=0x88e150) at eval.c:2977 #82 0x011437c9 in Ffuncall (nargs=3, args=args@entry=0x88e148) at eval.c:2790 #83 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=2, args=, args@entry=0x88e5b0) at bytecode.c:630 #84 0x011433ec in funcall_lambda (fun=, nargs=nargs@entry=2, arg_vector=arg_vector@entry=0x88e5b0) at eval.c:2977 #85 0x011437c9 in Ffuncall (nargs=3, args=args@entry=0x88e5a8) at eval.c:2790 #86 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=1, args=, args@entry=0x88ea60) at bytecode.c:630 #87 0x011433ec in funcall_lambda (fun=, nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x88ea60) at eval.c:2977 #88 0x011437c9 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x88ea58) at eval.c:2790 #89 0x01145d67 in Fapply (nargs=2, args=0x88ea58) at eval.c:2353 #90 0x0114389b in Ffuncall (nargs=3, args=args@entry=0x88ea50) at eval.c:2776 #91 0x01189680 in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=, nargs=, nargs@entry=1, args=, args@entry=0x88eda8) at bytecode.c:630 #92 0x011433ec in funcall_lambda (fun=, nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x88eda8) at eval.c:2977 #93 0x011437c9 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x88eda0) at eval.c:2790 #94 0x011439c7 in call1 (fn=XIL(0xcfc0), arg1=XIL(0xa00000000ae3af70)) at eval.c:2627 #95 0x010bfe7c in timer_check_2 (idle_timers=, timers=) at keyboard.c:4472 #96 timer_check () at keyboard.c:4534 #97 0x010c04a1 in readable_events (flags=flags@entry=1) at keyboard.c:3349 #98 0x010c0e98 in get_input_pending (flags=flags@entry=1) at keyboard.c:6841 #99 0x010c3a53 in detect_input_pending_run_timers ( do_display=do_display@entry=true) at keyboard.c:9961 #100 0x01195175 in wait_reading_process_output (time_limit=, nsecs=nsecs@entry=0, read_kbd=-1, do_display=do_display@entry=true, wait_for_cell=XIL(0), wait_proc=wait_proc@entry=0x0, just_wait_proc=just_wait_proc@entry=0) at process.c:5531 #101 0x0100a69e in sit_for (timeout=make_number(22), reading=reading@entry=true, display_option=display_option@entry=1) at dispnew.c:5805 #102 0x010c6c8c in read_char (commandflag=, commandflag@entry=1, map=, prev_event=, used_mouse_menu=, used_mouse_menu@entry=0x88f743, end_time=, end_time@entry=0x0) at keyboard.c:2723 #103 0x010c8303 in read_key_sequence (keybuf=keybuf@entry=0x88f850, prompt=, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false, bufsize=30) at keyboard.c:9157 #104 0x010ca3e4 in command_loop_1 () at keyboard.c:1368 #105 0x011415d2 in internal_condition_case ( bfun=bfun@entry=0x10ca155 , handlers=XIL(0x4e90), hfun=hfun@entry=0x10bf040 ) at eval.c:1336 #106 0x010b82a3 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1110 #107 0x01141574 in internal_catch (tag=XIL(0xd290), func=func@entry=0x10b827c , arg=XIL(0)) at eval.c:1101 #108 0x010b824b in command_loop () at keyboard.c:1089 #109 0x010bec14 in recursive_edit_1 () at keyboard.c:695 #110 0x010bef02 in Frecursive_edit () at keyboard.c:766 #111 0x01233073 in main (argc=, argv=) at emacs.c:1722 Lisp Backtrace: "1+" (0x88acd0) "goto-char" (0x88adb8) "save-excursion" (0x88aee8) "cond" (0x88aff8) "setq" (0x88b138) "let" (0x88b2b8) "if" (0x88b3d8) "catch" (0x88b548) "while" (0x88b668) "if" (0x88b788) "save-restriction" (0x88b8b8) "let" (0x88baf8) "c-beginning-of-statement-1" (0x88bbf0) "setq" (0x88be48) "eq" (0x88bf38) "not" (0x88c028) "and" (0x88c138) "while" (0x88c258) "let" (0x88c3d8) "let*" (0x88c528) "catch" (0x88c698) "c-beginning-of-decl-1" (0x88c810) 0xadfab48 PVEC_COMPILED "font-lock-fontify-keywords-region" (0x88d0c0) "font-lock-default-fontify-region" (0x88d410) "c-font-lock-fontify-region" (0x88d740) "font-lock-fontify-region" (0x88d9e8) 0x18b47060 PVEC_COMPILED "run-hook-wrapped" (0x88de00) "jit-lock--run-functions" (0x88e150) "jit-lock-fontify-now" (0x88e5b0) "jit-lock-stealth-fontify" (0x88ea60) "apply" (0x88ea58) "timer-event-handler" (0x88eda8) This comes from the following code fragment: (defun c-beginning-of-statement-1 (&optional lim ignore-labels noerror comma-delim) [...] ;; Just gone back over some paren block? ((looking-at "\\s(") (save-excursion (goto-char (1+ (c-down-list-backward before-sws-pos))) (c-crosses-statement-barrier-p (point) maybe-after-boundary-pos))) c-down-list-backward is documented to be able to return nil, so passing the result to 1+ is unsafe. I cannot claim a good understanding of the code, but the following ad-hoc patch fixes the problem for me: --- lisp/progmodes/cc-engine.el~0 2019-01-07 16:26:06.000000000 +0200 +++ lisp/progmodes/cc-engine.el 2019-05-01 14:43:35.823456200 +0300 @@ -1130,10 +1130,12 @@ ;; Just gone back over some paren block? ((looking-at "\\s(") (save-excursion - (goto-char (1+ (c-down-list-backward - before-sws-pos))) - (c-crosses-statement-barrier-p - (point) maybe-after-boundary-pos))) + (let ((pos1 (c-down-list-backward + before-sws-pos))) + (when (number-or-marker-p pos1) + (goto-char (1+ pos1)) + (c-crosses-statement-barrier-p + (point) maybe-after-boundary-pos))))) ;; Just gone back over an ordinary symbol of some sort? (t (c-crosses-statement-barrier-p (point) maybe-after-boundary-pos))))