From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#23917: 25.0.95; commit 3a9d6296b35e5317c497674d5725eb52699bd3b8 causing org-capture to error out Date: Fri, 08 Jul 2016 17:40:42 +0200 Message-ID: <87poqo6sud.fsf@gmail.com> References: <8760sgnvxh.fsf@gmail.com> <83lh1ci5x5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467992532 27041 80.91.229.3 (8 Jul 2016 15:42:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jul 2016 15:42:12 +0000 (UTC) Cc: 23917@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 08 17:42:01 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLXuf-0005b8-Uo for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jul 2016 17:41:58 +0200 Original-Received: from localhost ([::1]:46333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLXuf-0007GX-8y for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jul 2016 11:41:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLXtr-0006uH-KK for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 11:41:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLXtm-0002bC-MM for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 11:41:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLXtm-0002b2-Ie for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 11:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bLXtm-0004qZ-D1 for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2016 11:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jul 2016 15:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23917 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23917-submit@debbugs.gnu.org id=B23917.146799245218608 (code B ref 23917); Fri, 08 Jul 2016 15:41:02 +0000 Original-Received: (at 23917) by debbugs.gnu.org; 8 Jul 2016 15:40:52 +0000 Original-Received: from localhost ([127.0.0.1]:42827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLXtc-0004q4-91 for submit@debbugs.gnu.org; Fri, 08 Jul 2016 11:40:52 -0400 Original-Received: from mail-wm0-f67.google.com ([74.125.82.67]:35692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLXta-0004ps-CH for 23917@debbugs.gnu.org; Fri, 08 Jul 2016 11:40:50 -0400 Original-Received: by mail-wm0-f67.google.com with SMTP id k123so8611203wme.2 for <23917@debbugs.gnu.org>; Fri, 08 Jul 2016 08:40:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version; bh=DfYWsL+Y9XnCvbgRfZrFfw37AK69Yob38cv7Yw7nSR8=; b=yZxsLk2e6qyDJ8vLjQFfs+KbrNQWcIuzmyqp7Tlp7PcXPBu37LzKV/5BTrLqepIr/v hOLhIwlzLHe9sY/1ZO5NJsHazRK07Hur3WjbffWMPC1gSkae2fWsyJgd8RYv6niWWltJ ZJYaREWO0WapzkXhp+klwyS5ULdwSbX9udGilZC5CCOjdOG+ecKvsXvQP3aDN7swo0Is cfa4tcnOV7LPYgao4SSukIjahxrRO+dqv2BKxeJqE3XyMZZp12qrNXRC+OsxXd+hNx67 7giGDcEg+qlM7ghXIuLe2LOm2K6nHNno2Fv7iYiY90xV4t1HgIfnd/2YdNxIwLVSmj/R JhDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=DfYWsL+Y9XnCvbgRfZrFfw37AK69Yob38cv7Yw7nSR8=; b=JM72rE2tAG2tVmof9l6AOp9KaiGSrKvc+r7SmMDBc2XZdhQU7CBfjoQxSkNOwDvV6r qjxrVi7G7I/3rj/9djmCOXAzVxma3gdMMIGYPXw7KnXpwVBOEv6fvXWgWEAeh9eNPY38 pMBY78lEINvkV4geBEiEqaRJEE1hVDPAcy0N00kBDZljRuDnutVhJJwYFaVK+P1X94VQ t1LeM9B51dhVsNiKmDiYYAi33nLiPrntmqRwIkJa8DbSpyRux2HVEzwJ3D4fLA+tkk+k pndpYsbPz55LAdegdZ/SIgDQreNWGU/ZM1SJuaK34ZPXJwUJ6Iru/ZazwSZYQey0VSmw xYHw== X-Gm-Message-State: ALyK8tKbBnkFYtGiFUjsCyjArL4Ug3uP/8Hj2TokXkfHer/OAZK5L6Qg6xkrakTdln/h8A== X-Received: by 10.28.158.206 with SMTP id h197mr4274041wme.50.1467992443684; Fri, 08 Jul 2016 08:40:43 -0700 (PDT) Original-Received: from rpluim-XPS-15-9530 ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id q63sm3618793wma.0.2016.07.08.08.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jul 2016 08:40:42 -0700 (PDT) Gmane-Reply-To-List: yes In-Reply-To: <83lh1ci5x5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 08 Jul 2016 17:02:46 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120633 Archived-At: Eli Zaretskii writes: > Run Emacs under a debugger, and set a breakpoint before the call to > replace_range in Freplace_match. When the breakpoint breaks, make > sure it's indeed being called from org-capture-empty-lines-after, and > if so, do this: > > (gdb) watch -l search_regs.start[sub] > (gdb) watch -l search_regs.end[sub] > (gdb) watch -l search_regs.num_regs > (gdb) continue > > Then GDB will kick in as soon as one of these 3 is clobbered, and the > backtrace will show you whodunit. So that gives me (after recompiling with -O0 -g3 :-) ) Hardware watchpoint 6: -location search_regs.end[sub] Old value = 77 New value = 76 Fset_match_data (list=33497827, reseat=19440) at search.c:3010 3010 if (!NILP (reseat) && MARKERP (m)) Lisp Backtrace: "set-match-data" (0xffff9ad0) 0x1f6e8b0 PVEC_COMPILED "org-element--cache-after-change" (0xffffa6c8) "replace-match" (0xffffaa20) "org-capture-empty-lines-after" (0xffffaf60) "org-capture-place-entry" (0xffffb4b0) "org-capture-place-template" (0xffffba00) "org-capture" (0xffffc0b0) "funcall-interactively" (0xffffc0a8) "call-interactively" (0xffffc3e0) "command-execute" (0xffffc968) "execute-extended-command" (0xffffcfd0) "funcall-interactively" (0xffffcfc8) "call-interactively" (0xffffd360) "command-execute" (0xffffd8c8) (gdb) c Continuing. Breakpoint 4, Freplace_match (newtext=9563044, fixedcase=0, literal=0, string=0, subexp=0) at search.c:2710 2710 error ("Match data clobbered by buffer modification hooks"); org-element--cache-after-change is: (defun org-element--cache-after-change (beg end pre) "Update buffer modifications for current buffer. BEG and END are the beginning and end of the range of changed text, and the length in bytes of the pre-change text replaced by that range. See `after-change-functions' for more information." (when (org-element--cache-active-p) (org-with-wide-buffer (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) ;; Determine if modified area needs to be extended, according ;; to both previous and current state. We make a special ;; case for headline editing: if a headline is modified but ;; not removed, do not extend. (when (case org-element--cache-change-warning ((t) t) (headline (not (and (org-with-limited-levels (org-at-heading-p)) (= (line-end-position) bottom)))) (otherwise (let ((case-fold-search t)) (re-search-forward org-element--cache-sensitive-re bottom t)))) ;; Effectively extend modified area. (org-with-limited-levels (setq top (progn (goto-char top) (when (outline-previous-heading) (forward-line)) (point))) (setq bottom (progn (goto-char bottom) (if (outline-next-heading) (1- (point)) (point)))))) ;; Store synchronization request. (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))) ;; Activate a timer to process the request during idle time. (org-element--cache-set-timer (current-buffer)))) which already does save-match-data. If I globally disable the org element cache by (setq org-element-use-cache nil) the issue disappears, so now I'm confused as to what's going on.