From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: Re: Emacs hangs sometimes for no reason Date: Sun, 15 Jan 2017 13:55:00 +0000 Message-ID: References: <375517626d9045a99b6c008b5aaf62dd@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87pojobni4.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSlH3-0000Cd-9W for emacs-orgmode@gnu.org; Sun, 15 Jan 2017 08:55:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSlH0-0000mc-3p for emacs-orgmode@gnu.org; Sun, 15 Jan 2017 08:55:09 -0500 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:48887) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cSlGz-0000ll-R3 for emacs-orgmode@gnu.org; Sun, 15 Jan 2017 08:55:06 -0500 Received: from mfilter5-d.gandi.net (mfilter5-d.gandi.net [217.70.178.132]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 2AABCFB87E for ; Sun, 15 Jan 2017 14:55:03 +0100 (CET) Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter5-d.gandi.net (mfilter5-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id DNisSVnEEPBZ for ; Sun, 15 Jan 2017 14:55:01 +0100 (CET) Received: from localhost (host86-154-108-191.range86-154.btcentralplus.com [86.154.108.191]) (Authenticated sender: mailbox@brautaset.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 26291FB8A0 for ; Sun, 15 Jan 2017 14:55:00 +0100 (CET) In-reply-to: <87pojobni4.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Eric S Fraga writes: > On Saturday, 14 Jan 2017 at 18:33, Sebastian Christ wrote: >> in the last couple weeks (perhaps months?) Emacs hangs for no specific >> reason for me. The single constant is, that when it hangs, it hangs >> while I'm in org-mode. This occurs on multiple circumstance as > > Just to say that I experience the same. However, I track emacs as well > as org so I never know if the problem is emacs or org. In my case, all > hangs are when in org mode but that could be because I'm in org mode > 90% of the time... :-) Just to say that I too experience the same. I'm convinced it started happening since I upgraded to Org 9 (but I also started using Org's Agenda more around the same time, I think). My versions: - GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2016-09-21 - Org mode version 9.0.3 (9.0.3-elpaplus @ - /Users/stig/.emacs.d/elpa/org-plus-contrib-20161224/) I can go a few days without encountering it, but then it will suddenly hit. I have a feeling that it's triggered by refiling, or closing TODOs towards the end of the file. My agenda file is big, but not monstrous. (I think.) C-= reports: "Region has 2025 lines, 9592 words, and 67513 characters." There are 333 headings, most of them TODO/NEXT/PROJECT, and I use lots of tags. I also use a few categories on top-level headings. I've set the following to try to speed up agenda, but it hasn't made any discernible difference as far as I can tell: : (setq org-agenda-use-tag-inheritance '(todo)) I've tried to turn on debug on quit, and sent a few stack traces here in the past but to no avail. I cannot reproduce it with =emacs -q=, but that uses Org 8 anyway, so I would not expect it to. Nor do I have a sure-fire way to reproduce the issue, and I am not keen on being without my regular config for days while hoping to reproduce the hang. I do think it's related to Emacs having run for a while, because once the hang manifests I can just quit Emacs and restart what I was doing and no hang will manifest (for a while). When last I managed to capture a stack trace during one of these the stack trace started with: : Debugger entered--Lisp error: (quit) : avl-tree--do-delete(org-element--cache-compare [[[[[[nil nil : (property-drawer (:begin 18463 :end 18529 :contents-begin 18479 : :contents-end 18519 :post-blank 1 :post-affiliated 18463 :parent nil)) : 0] [nil nil (plain-list (:type unordered :begin 18547 :end 18749 : :contents-begin 18574 :contents-end 18748 :structure ... :post-blank 1 : :post-affiliated 18574 :name "candidate-names" :parent nil)) 0] : (paragraph (:begin 18529 :end 18547 :contents-begin 18529 : :contents-end 18546 :post-blank 1 :post-affiliated 18529 :parent nil)) : 0] [[nil nil (keyword (:key "RESULTS" :value "" :begin 18905 :end : 18920 :post-blank 1 :post-affiliated 18905 :parent nil)) 0] [nil nil : (paragraph (:begin 19570 :end 19586 :contents-begin 19570 : :contents-end 19585 :post-blank 1 :post-affiliated 19570 :parent nil)) : 0] (table (:begin 18920 :end 19570 :type org :tblfm nil : :contents-begin 18920 :contents-end 19568 :value nil :post-blank 2 : :post-affiliated 18920 :parent nil)) 0] (src-block (:language "sh" : :switches nil :parameters ":var names=candidate-names :results table" : :begin 18749 :end 18905 :number-lines nil :preserve-indent nil : :retain-labels t :use-labels t :label-fmt nil :value " echo $names | : xargs -n1 | perl -MList::Util -e : 'print List::Util::shuffle <>'\n" :post-blank 1 :post-affiliated : 18749 :parent nil)) 0 Further, I do notice this stack trace is full of `:drawer-name "LOGBOOK"' entries too, like this: : (:begin 9624 :end 9714 :drawer-name "LOGBOOK" :contents-begin 9638 : :contents-end 9704 :post-blank 0 :post-affiliated 9624 :parent nil)) : 0] [[[[nil nil ... 0] [nil nil ... 0] ... 0] [[nil nil ... 0] [nil nil : ... 0] ... 0] (drawer ...) 0] [[[nil nil ... 0] [nil nil ... 0] ... 0] : [[[nil nil ... 0] nil ... -1] [[nil nil ... 0] [nil nil ... 0] ... 0] : ... 0] (item ...) 1] (drawer (:begin 15202 :end 15582 :drawer-name : "LOGBOOK" :contents-begin 15216 :contents-end 15572 :post-blank 0 : :post-affiliated 15202 :parent nil)) 1] (drawer (:begin 11498 :end : 11629 :drawer-name "LOGBOOK" :contents-begin 11512 :contents-end 11619 : :post-blank 0 :post-affiliated 11498 :parent nil)) 1] (property-drawer : (:begin 7832 :end 7900 :contents-begin 7849 :contents-end 7890 : :post-blank 0 :post-affiliated 7832 :parent nil)) 1] [[[[[[nil nil ... : 0] [nil nil ... 0] ... 0] [[nil nil ... 0] [nil nil ... 0] ... 0] : (src-block ...) 0] [[[nil nil ... 0] [nil nil ... 0] ... 0] [[nil nil : ... 0] [nil nil ... 0] ... 0] (drawer ...) 0] (paragraph (:begin 19586 : :end 19669 :contents-begin 19586 :contents-end 19668 :post-blank 1 : :post-affiliated 19586 :parent nil)) 0] [[[[nil nil ... 0] [nil nil : ... 0] ... 0] [[nil nil ... 0] [nil nil ... 0] ... 0] (drawer ...) 0] : [[[nil nil ... 0] [nil nil ... 0] ... 0] [[nil nil ... 0] [[nil nil : ... 0] nil ... -1] ... 1] (planning ...) 1] (drawer (:begin 25456 :end : 25514 :drawer-name "LOGBOOK" :contents-begin 25469 :contents-end 25504 : :post-blank 1 :post-affiliated 25456 :parent nil)) 1] (planning : (:closed nil :deadline nil :scheduled (timestamp ...) :begin 23148 : :end 23180 :post-blank 0 :post-affiliated 23148 :parent nil)) 1] The end of the stack trace was: : 0] nil 28373 nil nil) : org-element--cache-sync(# 28373) : org-element-at-point() : org-eldoc-get-src-lang() : org-eldoc-documentation-function() : eldoc-print-current-symbol-info() : #[0 "\204. I must admit, I haven't tried to simply "wait it out" and see if it eventually finishes what it's doing and returning control to me. Perhaps I'll try that next, but usually when these hangs occur it's when I'm in the middle of doing something that I'd rather want to finish :-( If anybody has tips for how I can produce a better bug report, I'd be very happy to hear them. Stig