emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Possible bug in the org-element cache code?
@ 2014-01-08  4:57 Nick Dokos
  2014-01-08  5:05 ` Nick Dokos
  2014-01-08  7:52 ` Nicolas Goaziou
  0 siblings, 2 replies; 4+ messages in thread
From: Nick Dokos @ 2014-01-08  4:57 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

I've gotten the attached backtrace a couple of times in the past few
days. Also same error with org-cache-sync. I'm not sure how reproducible
it is and I have to admit that I've been running with a possibly tainted
emacs/org for the last few days. I'll restart emacs and try to keep it
pristine and see if it happens again, but I thought I'd post the
backtrace just in case it is real.


[-- Attachment #2: Backtrace --]
[-- Type: text/plain, Size: 9555 bytes --]

Debugger entered--Lisp error: (wrong-type-argument arrayp #s(hash-table size 5003 test eq rehash-size 1.5 rehash-threshold 0.8 data (1 ((paragraph (:begin 1 :end 3 :contents-begin 1 :contents-end 2 :post-blank 2 :post-affiliated 1 :parent nil))) 3 ((paragraph (:begin 3 :end 164 :contents-begin 3 :contents-end 162 :post-blank 2 :post-affiliated 3 :parent nil))) 164 ((paragraph (:begin 164 :end 282 :contents-begin 164 :contents-end 282 :post-blank 0 :post-affiliated 164 :parent nil)) (233 nil) (164 ((link . 164)) (link (:type "gnus" :path "gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :raw-link "gnus:gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :application nil :search-option nil :begin 164 :end 282 :contents-begin 233 :contents-end 280 :post-blank 0 :parent (paragraph (:begin 164 :end 282 :contents-begin 164 :contents-end 282 :post-blank 0 :post-affiliated 164 :parent nil)))) (link (:type "gnus" :path "gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :raw-link "gnus:gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :application nil :search-option nil :begin 164 :end 282 :contents-begin 233 :contents-end 280 :post-blank 0 :parent (paragraph (:begin 164 :end 282 :contents-begin 164 :contents-end 282 :post-blank 0 :post-affiliated 164 :parent nil)))))))))
  aref(#s(hash-table size 5003 test eq rehash-size 1.5 rehash-threshold 0.8 data (1 ((paragraph (:begin 1 :end 3 :contents-begin 1 :contents-end 2 :post-blank 2 :post-affiliated 1 :parent nil))) 3 ((paragraph (:begin 3 :end 164 :contents-begin 3 :contents-end 162 :post-blank 2 :post-affiliated 3 :parent nil))) 164 ((paragraph (:begin 164 :end 282 :contents-begin 164 :contents-end 282 :post-blank 0 :post-affiliated 164 :parent nil)) (233 nil) (164 ((link . 164)) (link (:type "gnus" :path "gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :raw-link "gnus:gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :application nil :search-option nil :begin 164 :end 282 :contents-begin 233 :contents-end 280 :post-blank 0 :parent (paragraph (:begin 164 :end 282 :contents-begin 164 :contents-end 282 :post-blank 0 :post-affiliated 164 :parent nil)))) (link (:type "gnus" :path "gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :raw-link "gnus:gmane.emacs.orgmode#87k3edcbe5.fsf@alphaville.bos.redhat.com" :application nil :search-option nil :begin 164 :end 282 :contents-begin 233 :contents-end 280 :post-blank 0 :parent (paragraph (:begin 164 :end 282 :contents-begin 164 :contents-end 282 :post-blank 0 :post-affiliated 164 :parent nil)))))) ...)) 0)
  (memq (aref org-element--cache 0) cl-struct-avl-tree--tags)
  (and (memq (aref org-element--cache 0) cl-struct-avl-tree--tags))
  (or (and (memq (aref org-element--cache 0) cl-struct-avl-tree--tags)) (error "%s accessing a non-%s" (quote avl-tree--dummyroot) (quote avl-tree-)))
  (progn (or (and (memq (aref org-element--cache 0) cl-struct-avl-tree--tags)) (error "%s accessing a non-%s" (quote avl-tree--dummyroot) (quote avl-tree-))) (aref org-element--cache 1))
  (aref (progn (or (and (memq (aref org-element--cache 0) cl-struct-avl-tree--tags)) (error "%s accessing a non-%s" (quote avl-tree--dummyroot) (quote avl-tree-))) (aref org-element--cache 1)) 0)
  (progn (aref (progn (or (and (memq (aref org-element--cache 0) cl-struct-avl-tree--tags)) (error "%s accessing a non-%s" (quote avl-tree--dummyroot) (quote avl-tree-))) (aref org-element--cache 1)) 0))
  (let ((node (progn (aref (progn (or (and ...) (error "%s accessing a non-%s" ... ...)) (aref org-element--cache 1)) 0))) last) (catch (quote found) (while node (let* ((element (progn (aref node 2))) (beg (org-element-property :begin element))) (cond ((< key beg) (setq node (progn ...))) ((= key beg) (if (memq ... ...) (setq last ... node ...) (throw ... ...))) (t (setq last (progn ...) node (progn ...)))))) last))
  (if (not (wholenump key)) (gethash key org-element--cache-objects) (let ((node (progn (aref (progn (or ... ...) (aref org-element--cache 1)) 0))) last) (catch (quote found) (while node (let* ((element (progn ...)) (beg (org-element-property :begin element))) (cond ((< key beg) (setq node ...)) ((= key beg) (if ... ... ...)) (t (setq last ... node ...))))) last)))
  (progn (if (and (not ignore-changes) (org-element--cache-pending-changes-p)) (progn (org-element--cache-sync (current-buffer)))) (if (not (wholenump key)) (gethash key org-element--cache-objects) (let ((node (progn (aref (progn ... ...) 0))) last) (catch (quote found) (while node (let* ((element ...) (beg ...)) (cond (... ...) (... ...) (t ...)))) last))))
  (if (and org-element-use-cache org-element--cache) (progn (if (and (not ignore-changes) (org-element--cache-pending-changes-p)) (progn (org-element--cache-sync (current-buffer)))) (if (not (wholenump key)) (gethash key org-element--cache-objects) (let ((node (progn (aref ... 0))) last) (catch (quote found) (while node (let* (... ...) (cond ... ... ...))) last)))))
  org-element-cache-get(0 t)
  (let* ((beg (aref org-element--cache-status 1)) (element (org-element-cache-get (1- beg) t))) (if (not element) beg (catch (quote exit) (let ((up element)) (while (setq up (org-element-property :parent up)) (if (and (memq ... ...) (<= ... beg) (> ... end)) (throw (quote exit) (progn ... ...))) (setq element up)) (if (< (org-element-property :end element) beg) (org-element-property :end element) (org-element-property :begin element))))))
  (let ((beg (let* ((beg (aref org-element--cache-status 1)) (element (org-element-cache-get (1- beg) t))) (if (not element) beg (catch (quote exit) (let (...) (while ... ... ...) (if ... ... ...))))))) (while (let ((node (progn (aref (progn ... ...) 0))) data) (while node (let* ((element (progn ...)) (pos (org-element-property :begin element))) (cond ((< pos beg) (setq node ...)) ((> pos beg) (setq data ... node ...)) (t (setq data ... node nil))))) (cond ((not data) (throw (quote escape) t)) ((> (org-element-property :begin data) end) nil) (t (setq end (max (1- ...) end)) (avl-tree-delete org-element--cache data nil t))))))
  (let ((inhibit-quit t) (offset (aref org-element--cache-status 3)) (end (aref org-element--cache-status 2))) (let ((beg (let* ((beg (aref org-element--cache-status 1)) (element (org-element-cache-get ... t))) (if (not element) beg (catch (quote exit) (let ... ... ...)))))) (while (let ((node (progn (aref ... 0))) data) (while node (let* ((element ...) (pos ...)) (cond (... ...) (... ...) (t ...)))) (cond ((not data) (throw (quote escape) t)) ((> (org-element-property :begin data) end) nil) (t (setq end (max ... end)) (avl-tree-delete org-element--cache data nil t)))))) (if (zerop offset) nil (catch (quote exit) (avl-tree-mapc (function (lambda (data) (if (<= ... end) (throw ... t) (org-element--cache-shift-positions data offset) (progn ...)))) org-element--cache (quote reverse)))))
  (catch (quote escape) (let ((inhibit-quit t) (offset (aref org-element--cache-status 3)) (end (aref org-element--cache-status 2))) (let ((beg (let* ((beg ...) (element ...)) (if (not element) beg (catch ... ...))))) (while (let ((node (progn ...)) data) (while node (let* (... ...) (cond ... ... ...))) (cond ((not data) (throw ... t)) ((> ... end) nil) (t (setq end ...) (avl-tree-delete org-element--cache data nil t)))))) (if (zerop offset) nil (catch (quote exit) (avl-tree-mapc (function (lambda (data) (if ... ... ... ...))) org-element--cache (quote reverse))))))
  (progn (catch (quote escape) (let ((inhibit-quit t) (offset (aref org-element--cache-status 3)) (end (aref org-element--cache-status 2))) (let ((beg (let* (... ...) (if ... beg ...)))) (while (let ((node ...) data) (while node (let* ... ...)) (cond (... ...) (... nil) (t ... ...))))) (if (zerop offset) nil (catch (quote exit) (avl-tree-mapc (function (lambda ... ...)) org-element--cache (quote reverse)))))) (org-element--cache-cancel-changes))
  (if (org-element--cache-pending-changes-p) (progn (catch (quote escape) (let ((inhibit-quit t) (offset (aref org-element--cache-status 3)) (end (aref org-element--cache-status 2))) (let ((beg (let* ... ...))) (while (let (... data) (while node ...) (cond ... ... ...)))) (if (zerop offset) nil (catch (quote exit) (avl-tree-mapc (function ...) org-element--cache (quote reverse)))))) (org-element--cache-cancel-changes)))
  (save-current-buffer (set-buffer buffer) (if (org-element--cache-pending-changes-p) (progn (catch (quote escape) (let ((inhibit-quit t) (offset (aref org-element--cache-status 3)) (end (aref org-element--cache-status 2))) (let ((beg ...)) (while (let ... ... ...))) (if (zerop offset) nil (catch (quote exit) (avl-tree-mapc ... org-element--cache ...))))) (org-element--cache-cancel-changes))))
  (progn (save-current-buffer (set-buffer buffer) (if (org-element--cache-pending-changes-p) (progn (catch (quote escape) (let ((inhibit-quit t) (offset ...) (end ...)) (let (...) (while ...)) (if (zerop offset) nil (catch ... ...)))) (org-element--cache-cancel-changes)))))
  (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer) (if (org-element--cache-pending-changes-p) (progn (catch (quote escape) (let (... ... ...) (let ... ...) (if ... nil ...))) (org-element--cache-cancel-changes))))))
  org-element--cache-sync(#<buffer foo.org<3>>)
  apply(org-element--cache-sync #<buffer foo.org<3>>)
  byte-code("r\301\b\302H\b\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 0 500000 nil org-element--cache-sync (#<buffer foo.org<3>>) idle 0])

[-- Attachment #3: Type: text/plain, Size: 12 bytes --]


-- 
Nick



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Possible bug in the org-element cache code?
  2014-01-08  4:57 Possible bug in the org-element cache code? Nick Dokos
@ 2014-01-08  5:05 ` Nick Dokos
  2014-01-08  7:52 ` Nicolas Goaziou
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2014-01-08  5:05 UTC (permalink / raw)
  To: emacs-orgmode

Forgot to mention:

Org-mode version 8.2.5c (release_8.2.5c-430-gf8e174)
-- 
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Possible bug in the org-element cache code?
  2014-01-08  4:57 Possible bug in the org-element cache code? Nick Dokos
  2014-01-08  5:05 ` Nick Dokos
@ 2014-01-08  7:52 ` Nicolas Goaziou
  2014-01-08 12:14   ` Nick Dokos
  1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2014-01-08  7:52 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> I've gotten the attached backtrace a couple of times in the past few
> days. Also same error with org-cache-sync. I'm not sure how reproducible
> it is and I have to admit that I've been running with a possibly tainted
> emacs/org for the last few days. I'll restart emacs and try to keep it
> pristine and see if it happens again, but I thought I'd post the
> backtrace just in case it is real.

It is because I changed cache structure from a hash table to an AVL tree
(basically a vector). If you restart Emacs, or (setq org-element--cache
nil) in all Org buffers, the error should go away.

Thank you for the report anyway.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Possible bug in the org-element cache code?
  2014-01-08  7:52 ` Nicolas Goaziou
@ 2014-01-08 12:14   ` Nick Dokos
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2014-01-08 12:14 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> I've gotten the attached backtrace a couple of times in the past few
>> days. Also same error with org-cache-sync. I'm not sure how reproducible
>> it is and I have to admit that I've been running with a possibly tainted
>> emacs/org for the last few days. I'll restart emacs and try to keep it
>> pristine and see if it happens again, but I thought I'd post the
>> backtrace just in case it is real.
>
> It is because I changed cache structure from a hash table to an AVL tree
> (basically a vector). If you restart Emacs, or (setq org-element--cache
> nil) in all Org buffers, the error should go away.
>

OK - thanks.

-- 
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-08 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  4:57 Possible bug in the org-element cache code? Nick Dokos
2014-01-08  5:05 ` Nick Dokos
2014-01-08  7:52 ` Nicolas Goaziou
2014-01-08 12:14   ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).