* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal @ 2018-07-25 5:15 Derek Upham 2018-07-31 12:04 ` Noam Postavsky 0 siblings, 1 reply; 9+ messages in thread From: Derek Upham @ 2018-07-25 5:15 UTC (permalink / raw) To: 32265 Download the following Java source file to your machine. https://s3-us-west-2.amazonaws.com/f9a75236/U.java Alternatively, download JScheme-7.2 from https://sourceforge.net/projects/jscheme/files/jscheme/7.2/ and extract the file "jscheme-7.2/src/jsint/U.java". (The problem appears with other Java files, and you can try reproducing with other Java files, but this one seems to trigger the problem quickly.) Create a file "yank-test.el" on your machine with the following contents: (setq yank-excluded-properties t) (defun kill-and-yank (at size) (goto-line at) (kill-line size) (redisplay t) (yank) (redisplay t)) (defun kill-and-yank-loop () (let* ((num-lines (line-number-at-pos (point-max))) (max-start (- num-lines 20)) (max-block-size 15)) (cl-loop (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size)))))) These functions will kill random blocks of the current file, force a redisplay, yank those blocks back into their positions, and force another redisplay. Run emacs 26.1 with emacs -Q -l yank-test.el U.java Evaluate '(kill-and-yank-loop)' in U.java. Eventually Emacs will raise an error "Error in syntax_table logic for intervals <-". The bug only appears when yank-excluded-properties is set to "t". When yank-excluded-properties is left with its default value, I am unable to reproduce the bug. The error may come via any number of code paths. One example is: Debugger entered--Lisp error: (error "Error in syntax_table logic for intervals <-") parse-partial-sexp(5305 21868 -3 nil (-2 nil 5247 nil nil nil -2 nil nil nil nil)) c-remove-stale-state-cache(5174 21969 21868) c-parse-state-1() c-parse-state() c-syntactic-skip-backward("^;{}" 21387 t) c-fl-decl-start(21970) c-change-expand-fl-region(21970 22230 0) #f(compiled-function (fn) #<bytecode 0xc8c831>)(c-change-expand-fl-region) mapc(#f(compiled-function (fn) #<bytecode 0xc8c831>) (c-depropertize-new-text c-parse-quotes-after-change c-restore-<>-properties c-change-expand-fl-region)) c-after-change(21970 22230 0) insert-for-yank-1(#(" Object result = null;\n try {\n in = openInputFile(filename);\n if (in == null) E.error(\"could not find '\" + filename +\n\011\011\011 \"' as a resource URL, or File.\");\n result = proc.apply(list(in));\n } finally { if (in != null) in.close(); }\n" 0 118 (fontified nil) 118 119 (fontified nil) 119 144 (fontified nil) 144 145 (fontified nil) 145 260 (fontified nil))) insert-for-yank(#(" Object result = null;\n try {\n in = openInputFile(filename);\n if (in == null) E.error(\"could not find '\" + filename +\n\011\011\011 \"' as a resource URL, or File.\");\n result = proc.apply(list(in));\n } finally { if (in != null) in.close(); }\n" 0 118 (fontified nil) 118 119 (fontified nil) 119 144 (fontified nil) 144 145 (fontified nil) 145 260 (fontified nil))) yank() kill-and-yank(599 7) (while t (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size)))) (catch '--cl-block-nil-- (while t (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size))))) (cl--block-wrapper (catch '--cl-block-nil-- (while t (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size)))))) (cl-block nil (while t (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size))))) (cl-loop (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size)))) (let* ((num-lines (line-number-at-pos (point-max))) (max-start (- num-lines 20)) (max-block-size 15)) (cl-loop (kill-and-yank (1+ (random max-start)) (1+ (random max-block-size))))) kill-and-yank-loop() eval((kill-and-yank-loop) nil) eval-expression((kill-and-yank-loop) nil nil 127) funcall-interactively(eval-expression (kill-and-yank-loop) nil nil 127) call-interactively(eval-expression nil nil) command-execute(eval-expression) In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 2018-07-24 built on priss.frightenedpiglet.com Windowing system distributor 'The X.Org Foundation', version 11.0.12000000 System Description: Debian GNU/Linux unstable (sid) Recent messages: Mark set [2 times] Indenting region... done Mark set [2 times] Indenting region... done Mark set [2 times] Indenting region... done Mark set [2 times] Indenting region... Entering debugger... Auto-saving...done Configured using: 'configure --prefix=/home/sand/emacs-26.1 'CFLAGS=-g3 -gdwarf-2 -O0'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 THREADS LCMS2 Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Debugger Minor modes in effect: shell-dirtrack-mode: t which-function-mode: t flx-ido-mode: t icomplete-mode: t auto-image-file-mode: t minibuffer-depth-indicate-mode: t minibuffer-electric-default-mode: t show-paren-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: /usr/share/emacs/site-lisp/sawfish/sawfish hides /home/sand/.emacs.d/elpa/sawfish-1.32/sawfish /home/sand/.emacs.d/elpa/org-20180604/org-footnote hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-footnote /home/sand/.emacs.d/elpa/org-20180604/org-lint hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-lint /home/sand/.emacs.d/elpa/org-20180604/ob-lisp hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-lisp /home/sand/.emacs.d/elpa/org-20180604/ob-calc hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-calc /home/sand/.emacs.d/elpa/org-20180604/ob-R hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-R /home/sand/.emacs.d/elpa/org-20180604/ob-table hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-table /home/sand/.emacs.d/elpa/org-20180604/ob-emacs-lisp hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-emacs-lisp /home/sand/.emacs.d/elpa/org-20180604/ob-screen hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-screen /home/sand/.emacs.d/elpa/org-20180604/org-gnus hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-gnus /home/sand/.emacs.d/elpa/org-20180604/ob-hledger hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-hledger /home/sand/.emacs.d/elpa/org-20180604/ob-ditaa hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-ditaa /home/sand/.emacs.d/elpa/org-20180604/ob-clojure hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-clojure /home/sand/.emacs.d/elpa/org-20180604/ob-ebnf hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-ebnf /home/sand/.emacs.d/elpa/org-20180604/ox-icalendar hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-icalendar /home/sand/.emacs.d/elpa/org-20180604/org-capture hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-capture /home/sand/.emacs.d/elpa/org-20180604/org-inlinetask hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-inlinetask /home/sand/.emacs.d/elpa/org-20180604/ob-sqlite hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-sqlite /home/sand/.emacs.d/elpa/org-20180604/ob-ref hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-ref /home/sand/.emacs.d/elpa/org-20180604/ob-J hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-J /home/sand/.emacs.d/elpa/org-20180604/ob-forth hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-forth /home/sand/.emacs.d/elpa/org-20180604/ob-lua hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-lua /home/sand/.emacs.d/elpa/org-20180604/org-eww hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-eww /home/sand/.emacs.d/elpa/org-20180604/ob-io hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-io /home/sand/.emacs.d/elpa/org-20180604/ob-latex hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-latex /home/sand/.emacs.d/elpa/org-20180604/ob-css hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-css /home/sand/.emacs.d/elpa/org-20180604/ox-publish hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-publish /home/sand/.emacs.d/elpa/org-20180604/org-macro hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-macro /home/sand/.emacs.d/elpa/org-20180604/ob-maxima hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-maxima /home/sand/.emacs.d/elpa/org-20180604/ob-ocaml hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-ocaml /home/sand/.emacs.d/elpa/org-20180604/ob-js hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-js /home/sand/.emacs.d/elpa/org-20180604/ox-latex hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-latex /home/sand/.emacs.d/elpa/org-20180604/org-list hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-list /home/sand/.emacs.d/elpa/org-20180604/ox-beamer hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-beamer /home/sand/.emacs.d/elpa/org-20180604/org-faces hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-faces /home/sand/.emacs.d/elpa/org-20180604/ob-exp hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-exp /home/sand/.emacs.d/elpa/org-20180604/org-habit hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-habit /home/sand/.emacs.d/elpa/org-20180604/org-entities hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-entities /home/sand/.emacs.d/elpa/org-20180604/ob-perl hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-perl /home/sand/.emacs.d/elpa/org-20180604/ob-scheme hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-scheme /home/sand/.emacs.d/elpa/org-20180604/ob-C hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-C /home/sand/.emacs.d/elpa/org-20180604/org-mobile hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-mobile /home/sand/.emacs.d/elpa/org-20180604/org-element hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-element /home/sand/.emacs.d/elpa/org-20180604/ob-core hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-core /home/sand/.emacs.d/elpa/org-20180604/ox-html hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-html /home/sand/.emacs.d/elpa/org-20180604/ob-haskell hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-haskell /home/sand/.emacs.d/elpa/org-20180604/org-bibtex hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-bibtex /home/sand/.emacs.d/elpa/org-20180604/ox-odt hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-odt /home/sand/.emacs.d/elpa/org-20180604/org-crypt hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-crypt /home/sand/.emacs.d/elpa/org-20180604/org-info hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-info /home/sand/.emacs.d/elpa/org-20180604/ob-dot hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-dot /home/sand/.emacs.d/elpa/org-20180604/ob-gnuplot hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-gnuplot /home/sand/.emacs.d/elpa/org-20180604/ob-fortran hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-fortran /home/sand/.emacs.d/elpa/org-20180604/ob-shell hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-shell /home/sand/.emacs.d/elpa/org-20180604/org-macs hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-macs /home/sand/.emacs.d/elpa/org-20180604/ox-ascii hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-ascii /home/sand/.emacs.d/elpa/org-20180604/org hides /home/sand/src/emacs/emacs-26.1/lisp/org/org /home/sand/.emacs.d/elpa/org-20180604/org-w3m hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-w3m /home/sand/.emacs.d/elpa/org-20180604/ob-ledger hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-ledger /home/sand/.emacs.d/elpa/org-20180604/org-docview hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-docview /home/sand/.emacs.d/elpa/org-20180604/ob-eval hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-eval /home/sand/.emacs.d/elpa/org-20180604/ob-coq hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-coq /home/sand/.emacs.d/elpa/org-20180604/ob-awk hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-awk /home/sand/.emacs.d/elpa/org-20180604/org-table hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-table /home/sand/.emacs.d/elpa/org-20180604/org-agenda hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-agenda /home/sand/.emacs.d/elpa/org-20180604/org-id hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-id /home/sand/.emacs.d/elpa/org-20180604/ob-groovy hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-groovy /home/sand/.emacs.d/elpa/org-20180604/org-eshell hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-eshell /home/sand/.emacs.d/elpa/org-20180604/ob-lob hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-lob /home/sand/.emacs.d/elpa/org-20180604/ob-keys hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-keys /home/sand/.emacs.d/elpa/org-20180604/ob-makefile hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-makefile /home/sand/.emacs.d/elpa/org-20180604/ob-lilypond hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-lilypond /home/sand/.emacs.d/elpa/org-20180604/org-irc hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-irc /home/sand/.emacs.d/elpa/org-20180604/ob-asymptote hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-asymptote /home/sand/.emacs.d/elpa/org-20180604/ox-texinfo hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-texinfo /home/sand/.emacs.d/elpa/org-20180604/org-archive hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-archive /home/sand/.emacs.d/elpa/org-20180604/ob-mscgen hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-mscgen /home/sand/.emacs.d/elpa/org-20180604/org-rmail hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-rmail /home/sand/.emacs.d/elpa/org-20180604/org-version hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-version /home/sand/.emacs.d/elpa/org-20180604/org-compat hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-compat /home/sand/.emacs.d/elpa/org-20180604/ox-org hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-org /home/sand/.emacs.d/elpa/org-20180604/ob-java hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-java /home/sand/.emacs.d/elpa/org-20180604/ob-stan hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-stan /home/sand/.emacs.d/elpa/org-20180604/ob-processing hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-processing /home/sand/.emacs.d/elpa/org-20180604/org-mouse hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-mouse /home/sand/.emacs.d/elpa/org-20180604/ox-man hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-man /home/sand/.emacs.d/elpa/org-20180604/org-ctags hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-ctags /home/sand/.emacs.d/elpa/org-20180604/ob-octave hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-octave /home/sand/.emacs.d/elpa/org-20180604/ob-matlab hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-matlab /home/sand/.emacs.d/elpa/org-20180604/org-feed hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-feed /home/sand/.emacs.d/elpa/org-20180604/ob-org hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-org /home/sand/.emacs.d/elpa/org-20180604/ob-vala hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-vala /home/sand/.emacs.d/elpa/org-20180604/org-datetree hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-datetree /home/sand/.emacs.d/elpa/org-20180604/ob-sass hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-sass /home/sand/.emacs.d/elpa/org-20180604/org-protocol hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-protocol /home/sand/.emacs.d/elpa/org-20180604/org-pcomplete hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-pcomplete /home/sand/.emacs.d/elpa/org-20180604/org-duration hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-duration /home/sand/.emacs.d/elpa/org-20180604/org-bbdb hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-bbdb /home/sand/.emacs.d/elpa/org-20180604/ob-ruby hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-ruby /home/sand/.emacs.d/elpa/org-20180604/org-indent hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-indent /home/sand/.emacs.d/elpa/org-20180604/org-mhe hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-mhe /home/sand/.emacs.d/elpa/org-20180604/ob-sed hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-sed /home/sand/.emacs.d/elpa/org-20180604/ob-picolisp hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-picolisp /home/sand/.emacs.d/elpa/org-20180604/ob-sql hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-sql /home/sand/.emacs.d/elpa/org-20180604/ob-plantuml hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-plantuml /home/sand/.emacs.d/elpa/org-20180604/org-src hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-src /home/sand/.emacs.d/elpa/org-20180604/ob-shen hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-shen /home/sand/.emacs.d/elpa/org-20180604/ob-abc hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-abc /home/sand/.emacs.d/elpa/org-20180604/org-attach hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-attach /home/sand/.emacs.d/elpa/org-20180604/org-install hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-install /home/sand/.emacs.d/elpa/org-20180604/org-timer hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-timer /home/sand/.emacs.d/elpa/org-20180604/ob-comint hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-comint /home/sand/.emacs.d/elpa/org-20180604/ox hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox /home/sand/.emacs.d/elpa/org-20180604/ox-md hides /home/sand/src/emacs/emacs-26.1/lisp/org/ox-md /home/sand/.emacs.d/elpa/org-20180604/org-clock hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-clock /home/sand/.emacs.d/elpa/org-20180604/org-colview hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-colview /home/sand/.emacs.d/elpa/org-20180604/ob-python hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-python /home/sand/.emacs.d/elpa/org-20180604/ob-tangle hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob-tangle /home/sand/.emacs.d/elpa/org-20180604/ob hides /home/sand/src/emacs/emacs-26.1/lisp/org/ob /home/sand/.emacs.d/elpa/org-20180604/org-plot hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-plot /home/sand/.emacs.d/elpa/org-20180604/org-loaddefs hides /home/sand/src/emacs/emacs-26.1/lisp/org/org-loaddefs Features: (dabbrev magit-utils crm misearch multi-isearch shadow sort rfc1345 quail mail-extr emacsbug sendmail cl-print debug apropos pp eieio-opt speedbar sb-image ezimage dframe find-func help-fns radix-tree executable emacs-lock thingatpt aggressive-indent easy-mmode paredit-menu paredit edmacro kmacro elec-pair smex add-log cl-extra help-mode parse-time vc-cvs margin cap-words superword subword cedet cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs shell pcomplete comint ring find-dired dired-aux org-install mu4e-dbus mu4e-server mu4e-utils doc-view jka-compr image-mode mu4e-lists mu4e-vars message rmc puny dired-x dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader mu4e-meta cl dbus xml bbdb-autoloads org-loaddefs mm-util mail-prsvr which-func imenu ansi-color flx-ido flx ido icomplete image-file mb-depth advice minibuf-eldef paren solarized-dark-theme solarized-light-theme solarized color dash subr-x finder-inf uuid-autoloads vline-autoloads info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 523313 86675) (symbols 48 36798 42) (miscs 40 461 3110) (strings 32 91801 11336) (string-bytes 1 2755477) (vectors 16 58471) (vector-slots 8 1668451 92326) (floats 8 352 729) (intervals 56 18179 882) (buffers 992 21)) ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-07-25 5:15 bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal Derek Upham @ 2018-07-31 12:04 ` Noam Postavsky 2018-07-31 16:15 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Noam Postavsky @ 2018-07-31 12:04 UTC (permalink / raw) To: Derek Upham; +Cc: 32265 tags 32265 + confirmed quit Derek Upham <sand@blarg.net> writes: > Evaluate '(kill-and-yank-loop)' in U.java. Eventually Emacs will raise > an error "Error in syntax_table logic for intervals <-". The bug only > appears when yank-excluded-properties is set to "t". I get an assertion failure when running this, I assume the problem occurs even earlier though, not sure how to catch it: ../../src/intervals.c:371: Emacs fatal error: assertion failed: LENGTH (i) > 0 #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../src/emacs.c:364 #1 0x00000000006161d3 in die (msg=0x7795cd "LENGTH (i) > 0", file=0x7794f0 "../../src/intervals.c", line=371) at ../../src/alloc.c:7410 #2 0x00000000006b51c4 in balance_an_interval (i=0x32e9d78) at ../../src/intervals.c:371 #3 0x00000000006b54a4 in balance_possible_root_interval (interval=0x32e9d78) at ../../src/intervals.c:420 #4 0x00000000006b579e in split_interval_right (interval=0x32e9d78, offset=-1) at ../../src/intervals.c:507 #5 0x00000000006bfe11 in set_text_properties_1 (start=make_number(8232), end=make_number(8474), properties=XIL(0), object=XIL(0x2ff57f5), i=0x32e9d78) at ../../src/textprop.c:1436 #6 0x00000000006bfcad in set_text_properties (start=make_number(8232), end=make_number(8474), properties=XIL(0), object=XIL(0x2ff57f5), coherent_change_p=XIL(0xc090)) at ../../src/textprop.c:1397 #7 0x00000000006bf9d6 in Fset_text_properties (start=make_number(8232), end=make_number(8474), properties=XIL(0), object=XIL(0)) at ../../src/textprop.c:1304 #8 0x000000000063e4a6 in funcall_subr (subr=0xd81680 <Sset_text_properties>, numargs=3, args=0x7fffffff9f80) at ../../src/eval.c:2856 (More stack frames follow...) Lisp Backtrace: "set-text-properties" (0xffff9f80) "remove-yank-excluded-properties" (0xffffa4c8) "insert-for-yank-1" (0xffffa9d8) "insert-for-yank" (0xffffaea8) "yank" (0xffffb310) "kill-and-yank" (0xffffb590) "while" (0xffffb880) "let*" (0xffffba40) "kill-and-yank-loop" (0xffffbb90) "eval-buffer" (0xffffbfb0) "load-with-code-conversion" (0xffffc538) "load" (0xffffc918) "command-line-1" (0xffffd270) "command-line" (0xffffde88) "normal-top-level" (0xffffe4b0) ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-07-31 12:04 ` Noam Postavsky @ 2018-07-31 16:15 ` Eli Zaretskii 2018-08-01 1:06 ` Noam Postavsky 0 siblings, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2018-07-31 16:15 UTC (permalink / raw) To: Noam Postavsky; +Cc: sand, 32265 > From: Noam Postavsky <npostavs@gmail.com> > Date: Tue, 31 Jul 2018 08:04:18 -0400 > Cc: 32265@debbugs.gnu.org > > ../../src/intervals.c:371: Emacs fatal error: assertion failed: LENGTH (i) > 0 > > #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../src/emacs.c:364 > #1 0x00000000006161d3 in die (msg=0x7795cd "LENGTH (i) > 0", file=0x7794f0 "../../src/intervals.c", > line=371) at ../../src/alloc.c:7410 > #2 0x00000000006b51c4 in balance_an_interval (i=0x32e9d78) at ../../src/intervals.c:371 > #3 0x00000000006b54a4 in balance_possible_root_interval (interval=0x32e9d78) > at ../../src/intervals.c:420 > #4 0x00000000006b579e in split_interval_right (interval=0x32e9d78, offset=-1) > at ../../src/intervals.c:507 That offset=-1 there is already bogus, AFAIU. > #5 0x00000000006bfe11 in set_text_properties_1 (start=make_number(8232), end=make_number(8474), > properties=XIL(0), object=XIL(0x2ff57f5), i=0x32e9d78) at ../../src/textprop.c:1436 > #6 0x00000000006bfcad in set_text_properties (start=make_number(8232), end=make_number(8474), > properties=XIL(0), object=XIL(0x2ff57f5), coherent_change_p=XIL(0xc090)) > at ../../src/textprop.c:1397 > #7 0x00000000006bf9d6 in Fset_text_properties (start=make_number(8232), end=make_number(8474), > properties=XIL(0), object=XIL(0)) at ../../src/textprop.c:1304 > #8 0x000000000063e4a6 in funcall_subr (subr=0xd81680 <Sset_text_properties>, numargs=3, > args=0x7fffffff9f80) at ../../src/eval.c:2856 > (More stack frames follow...) > > Lisp Backtrace: > "set-text-properties" (0xffff9f80) > "remove-yank-excluded-properties" (0xffffa4c8) > "insert-for-yank-1" (0xffffa9d8) > "insert-for-yank" (0xffffaea8) I presume just calling set-text-properties with the same arguments there doesn't trigger the problem? If so, I think we need to understand how come we got offset=-1 in frame #4. Thanks. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-07-31 16:15 ` Eli Zaretskii @ 2018-08-01 1:06 ` Noam Postavsky 2018-08-01 10:15 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Noam Postavsky @ 2018-08-01 1:06 UTC (permalink / raw) To: Eli Zaretskii; +Cc: sand, 32265 Eli Zaretskii <eliz@gnu.org> writes: > I presume just calling set-text-properties with the same arguments > there doesn't trigger the problem? If so, I think we need to > understand how come we got offset=-1 in frame #4. Actually, it looks like it can be triggered with just set-text-properties, but there is some interaction with c-before-change. I've reduced the testcase to this: (defconst dir (file-name-directory (or load-file-name buffer-file-name))) (pop-to-buffer-same-window (get-buffer-create "*test*")) (erase-buffer) (insert-file-contents (expand-file-name "U.java" dir)) (java-mode) (set-text-properties 10467 10542 nil) The the after and before change functions can be reduced and still trigger the assertion except for c-before-change which is needed to reproduce: (let ((before-change-functions '(c-before-change ;t syntax-ppss-flush-cache )) (after-change-functions nil)) (set-text-properties 10467 10542 nil)) The backtrace no longer has a negative offset to blame: ../../src/intervals.c:371: Emacs fatal error: assertion failed: LENGTH (i) > 0 (gdb) bt 8 #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../src/emacs.c:364 #1 0x00000000006161d3 in die (msg=0x7795cd "LENGTH (i) > 0", file=0x7794f0 "../../src/intervals.c", line=371) at ../../src/alloc.c:7410 #2 0x00000000006b51c4 in balance_an_interval (i=0x324b0b0) at ../../src/intervals.c:371 #3 0x00000000006b5792 in split_interval_right (interval=0x181f380 <bss_sbrk_buffer+10524736>, offset=4048) at ../../src/intervals.c:504 #4 0x00000000006bfe11 in set_text_properties_1 (start=make_number(10467), end=make_number(10542), properties=XIL(0), object=XIL(0x2f64925), i=0x181f380 <bss_sbrk_buffer+10524736>) at ../../src/textprop.c:1436 #5 0x00000000006bfcad in set_text_properties (start=make_number(10467), end=make_number(10542), properties=XIL(0), object=XIL(0x2f64925), coherent_change_p=XIL(0xc090)) at ../../src/textprop.c:1397 #6 0x00000000006bf9d6 in Fset_text_properties (start=make_number(10467), end=make_number(10542), properties=XIL(0), object=XIL(0)) at ../../src/textprop.c:1304 #7 0x000000000063c85d in eval_sub (form=XIL(0x1546ae3)) at ../../src/eval.c:2248 (More stack frames follow...) Lisp Backtrace: "set-text-properties" (0xffffbc70) "eval-buffer" (0xffffbfb0) "load-with-code-conversion" (0xffffc538) "load" (0xffffc918) "command-line-1" (0xffffd270) "command-line" (0xffffde88) "normal-top-level" (0xffffe4b0) ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-08-01 1:06 ` Noam Postavsky @ 2018-08-01 10:15 ` Eli Zaretskii 2018-08-01 13:54 ` Derek Upham 0 siblings, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2018-08-01 10:15 UTC (permalink / raw) To: Noam Postavsky; +Cc: sand, 32265 > From: Noam Postavsky <npostavs@gmail.com> > Cc: sand@blarg.net, 32265@debbugs.gnu.org > Date: Tue, 31 Jul 2018 21:06:08 -0400 > > Eli Zaretskii <eliz@gnu.org> writes: > > > I presume just calling set-text-properties with the same arguments > > there doesn't trigger the problem? If so, I think we need to > > understand how come we got offset=-1 in frame #4. > > Actually, it looks like it can be triggered with just > set-text-properties, but there is some interaction with > c-before-change. I've reduced the testcase to this: > > (defconst dir (file-name-directory > (or load-file-name buffer-file-name))) > > (pop-to-buffer-same-window (get-buffer-create "*test*")) > (erase-buffer) > (insert-file-contents (expand-file-name "U.java" dir)) > (java-mode) > (set-text-properties 10467 10542 nil) Thanks for an easy test case. This is bug #13743 striking again in a slightly different incarnation: removing the text properties calls before-change-functions, which modify the buffer's interval tree, but we continue using the interval calculated from the unmodified tree. So the solution should be similar to what we used in that bug. If the patch below fixes the original problem (Derek, can you confirm?), I will install it on the emacs-26 branch. > The backtrace no longer has a negative offset to blame: > > ../../src/intervals.c:371: Emacs fatal error: assertion failed: LENGTH (i) > 0 > > (gdb) bt 8 > #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../src/emacs.c:364 > #1 0x00000000006161d3 in die (msg=0x7795cd "LENGTH (i) > 0", file=0x7794f0 "../../src/intervals.c", > line=371) at ../../src/alloc.c:7410 > #2 0x00000000006b51c4 in balance_an_interval (i=0x324b0b0) at ../../src/intervals.c:371 > #3 0x00000000006b5792 in split_interval_right (interval=0x181f380 <bss_sbrk_buffer+10524736>, > offset=4048) at ../../src/intervals.c:504 But the offset is still bogus, because: #3 0x012d2f46 in split_interval_right (interval=0xfa9c10, offset=4048) at intervals.c:504 504 balance_an_interval (new); (gdb) p new_length $8 = -107 IOW, OFFSET is greater than LENGTH(interval) in split_interval_right, which must not happen. Here's the proposed patch: diff --git a/src/textprop.c b/src/textprop.c index 984f2e6..904e226 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1350,6 +1350,7 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, { register INTERVAL i; Lisp_Object ostart, oend; + bool first_time = true; ostart = start; oend = end; @@ -1372,6 +1373,7 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, return Qt; } + retry: i = validate_interval_range (object, &start, &end, soft); if (!i) @@ -1391,8 +1393,22 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, return Qnil; } - if (BUFFERP (object) && !NILP (coherent_change_p)) - modify_text_properties (object, start, end); + if (BUFFERP (object) && !NILP (coherent_change_p) && first_time) + { + ptrdiff_t prev_length = LENGTH (i); + ptrdiff_t prev_pos = i->position; + + modify_text_properties (object, start, end); + /* If someone called us recursively as a side effect of + modify_text_properties, and changed the intervals behind our + back, we cannot continue with I, because its data changed. + So we restart the interval analysis anew. */ + if (LENGTH (i) != prev_length || i->position != prev_pos) + { + first_time = false; + goto retry; + } + } set_text_properties_1 (start, end, properties, object, i); ^ permalink raw reply related [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-08-01 10:15 ` Eli Zaretskii @ 2018-08-01 13:54 ` Derek Upham 2018-08-01 15:38 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Derek Upham @ 2018-08-01 13:54 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Noam Postavsky, 32265 > If the patch below fixes the original problem (Derek, can you > confirm?), I will install it on the emacs-26 branch. Will do. Is the patch against the stock 26.1 sources, or against some other commit? Eli Zaretskii <eliz@gnu.org> writes: >> From: Noam Postavsky <npostavs@gmail.com> >> Cc: sand@blarg.net, 32265@debbugs.gnu.org >> Date: Tue, 31 Jul 2018 21:06:08 -0400 >> >> Eli Zaretskii <eliz@gnu.org> writes: >> >> > I presume just calling set-text-properties with the same arguments >> > there doesn't trigger the problem? If so, I think we need to >> > understand how come we got offset=-1 in frame #4. >> >> Actually, it looks like it can be triggered with just >> set-text-properties, but there is some interaction with >> c-before-change. I've reduced the testcase to this: >> >> (defconst dir (file-name-directory >> (or load-file-name buffer-file-name))) >> >> (pop-to-buffer-same-window (get-buffer-create "*test*")) >> (erase-buffer) >> (insert-file-contents (expand-file-name "U.java" dir)) >> (java-mode) >> (set-text-properties 10467 10542 nil) > > Thanks for an easy test case. This is bug #13743 striking again in a > slightly different incarnation: removing the text properties calls > before-change-functions, which modify the buffer's interval tree, but > we continue using the interval calculated from the unmodified tree. > So the solution should be similar to what we used in that bug. > > If the patch below fixes the original problem (Derek, can you > confirm?), I will install it on the emacs-26 branch. > >> The backtrace no longer has a negative offset to blame: >> >> ../../src/intervals.c:371: Emacs fatal error: assertion failed: LENGTH (i) > 0 >> >> (gdb) bt 8 >> #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../src/emacs.c:364 >> #1 0x00000000006161d3 in die (msg=0x7795cd "LENGTH (i) > 0", file=0x7794f0 "../../src/intervals.c", >> line=371) at ../../src/alloc.c:7410 >> #2 0x00000000006b51c4 in balance_an_interval (i=0x324b0b0) at ../../src/intervals.c:371 >> #3 0x00000000006b5792 in split_interval_right (interval=0x181f380 <bss_sbrk_buffer+10524736>, >> offset=4048) at ../../src/intervals.c:504 > > But the offset is still bogus, because: > > #3 0x012d2f46 in split_interval_right (interval=0xfa9c10, offset=4048) > at intervals.c:504 > 504 balance_an_interval (new); > (gdb) p new_length > $8 = -107 > > IOW, OFFSET is greater than LENGTH(interval) in split_interval_right, > which must not happen. > > Here's the proposed patch: > > diff --git a/src/textprop.c b/src/textprop.c > index 984f2e6..904e226 100644 > --- a/src/textprop.c > +++ b/src/textprop.c > @@ -1350,6 +1350,7 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, > { > register INTERVAL i; > Lisp_Object ostart, oend; > + bool first_time = true; > > ostart = start; > oend = end; > @@ -1372,6 +1373,7 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, > return Qt; > } > > + retry: > i = validate_interval_range (object, &start, &end, soft); > > if (!i) > @@ -1391,8 +1393,22 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, > return Qnil; > } > > - if (BUFFERP (object) && !NILP (coherent_change_p)) > - modify_text_properties (object, start, end); > + if (BUFFERP (object) && !NILP (coherent_change_p) && first_time) > + { > + ptrdiff_t prev_length = LENGTH (i); > + ptrdiff_t prev_pos = i->position; > + > + modify_text_properties (object, start, end); > + /* If someone called us recursively as a side effect of > + modify_text_properties, and changed the intervals behind our > + back, we cannot continue with I, because its data changed. > + So we restart the interval analysis anew. */ > + if (LENGTH (i) != prev_length || i->position != prev_pos) > + { > + first_time = false; > + goto retry; > + } > + } > > set_text_properties_1 (start, end, properties, object, i); > ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-08-01 13:54 ` Derek Upham @ 2018-08-01 15:38 ` Eli Zaretskii 2018-08-02 4:44 ` Derek Upham 0 siblings, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2018-08-01 15:38 UTC (permalink / raw) To: Derek Upham; +Cc: npostavs, 32265 > From: Derek Upham <sand@blarg.net> > Cc: Noam Postavsky <npostavs@gmail.com>, 32265@debbugs.gnu.org > Date: Wed, 01 Aug 2018 06:54:03 -0700 > > > If the patch below fixes the original problem (Derek, can you > > confirm?), I will install it on the emacs-26 branch. > > Will do. Is the patch against the stock 26.1 sources, or against some other commit? The patch should apply both to stock Emacs 26.1 and the current emacs-26 branch of the Emacs repository. The file where I made the changes didn't change since the release of Emacs 26.1. Thanks. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-08-01 15:38 ` Eli Zaretskii @ 2018-08-02 4:44 ` Derek Upham 2018-08-02 13:31 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Derek Upham @ 2018-08-02 4:44 UTC (permalink / raw) To: Eli Zaretskii; +Cc: npostavs, 32265 Eli Zaretskii <eliz@gnu.org> writes: > >> From: Derek Upham <sand@blarg.net> >> Cc: Noam Postavsky <npostavs@gmail.com>, 32265@debbugs.gnu.org >> Date: Wed, 01 Aug 2018 06:54:03 -0700 >> >> > If the patch below fixes the original problem (Derek, can you >> > confirm?), I will install it on the emacs-26 branch. >> >> Will do. Is the patch against the stock 26.1 sources, or against some other commit? > > The patch should apply both to stock Emacs 26.1 and the current > emacs-26 branch of the Emacs repository. The file where I made the > changes didn't change since the release of Emacs 26.1. > > Thanks. After applying the patch to stock 26.1 sources, I’m not able to reproduce the bug. I think you can push the fix to master. Thanks for looking into this. Derek ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal 2018-08-02 4:44 ` Derek Upham @ 2018-08-02 13:31 ` Eli Zaretskii 0 siblings, 0 replies; 9+ messages in thread From: Eli Zaretskii @ 2018-08-02 13:31 UTC (permalink / raw) To: Derek Upham; +Cc: 32265-done, npostavs > From: Derek Upham <sand@blarg.net> > Cc: npostavs@gmail.com, 32265@debbugs.gnu.org > Date: Wed, 01 Aug 2018 21:44:09 -0700 > > After applying the patch to stock 26.1 sources, I’m not able to reproduce the bug. I think you can push the fix to master. Thanks for looking into this. Thanks, I pushed the change to the emacs-26 branch, and I'm closing the bug. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-08-02 13:31 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-07-25 5:15 bug#32265: 26.1; yank-excluded-properties set to t triggers "Error in syntax_table logic for intervals <-" signal Derek Upham 2018-07-31 12:04 ` Noam Postavsky 2018-07-31 16:15 ` Eli Zaretskii 2018-08-01 1:06 ` Noam Postavsky 2018-08-01 10:15 ` Eli Zaretskii 2018-08-01 13:54 ` Derek Upham 2018-08-01 15:38 ` Eli Zaretskii 2018-08-02 4:44 ` Derek Upham 2018-08-02 13:31 ` Eli Zaretskii
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.