From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YDubLcW78WE+fgEAgWs5BA (envelope-from ) for ; Wed, 26 Jan 2022 22:23:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6J6aJMW78WHdUAAAG6o9tA (envelope-from ) for ; Wed, 26 Jan 2022 22:23:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0B14115315 for ; Wed, 26 Jan 2022 22:23:17 +0100 (CET) Received: from localhost ([::1]:40392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCpl6-0008OZ-6V for larch@yhetil.org; Wed, 26 Jan 2022 16:23:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCpj8-0007JJ-NK for emacs-orgmode@gnu.org; Wed, 26 Jan 2022 16:21:15 -0500 Received: from [2a00:1450:4864:20::335] (port=43906 helo=mail-wm1-x335.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCpj7-0007AL-1j for emacs-orgmode@gnu.org; Wed, 26 Jan 2022 16:21:14 -0500 Received: by mail-wm1-x335.google.com with SMTP id r2-20020a1c2b02000000b0034f7b261169so642328wmr.2 for ; Wed, 26 Jan 2022 13:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=oz+jD4Az0jA+/r61EDOz4uG0oWQZFwFztLSzJPD1U1A=; b=gEjV7eDypzJPo430ipmstmbDHOvdDXKQNYFek6hXYX0nLDPbIaZPSK+9IDFNG1me5E 3JN81o5QMAJ/ivGOXScn+c1/rZmSPyWJPwjgo9qqJQlPZUFt82UWKj4F3FVY4W31XyiJ np2Bw3sKjvR55rl61HWq7mEz4pubybVTBRmJOQYIArcjwQkLk/TZ73UI35/4MCdo1csk rDmcVSwCd7mtRfYfQBFS3fUdmN7hZaakrzWotPHVFaM8m+/CQBXHZfjhqkU1PJ1zRo1j WickNmTlFYnHbs1DeVLBRwqA4pL4SfNlHL1QR3oqMOH9FbHTLmBBccjdAGQhvqET3ZNH nKbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=oz+jD4Az0jA+/r61EDOz4uG0oWQZFwFztLSzJPD1U1A=; b=Hmz0eN444FpT2aA2ghPC0L2MbPO35+Ty2f1w+8IQbB59m/pcLIuJ2lK65rYL6QDRuC /UBBarl6/auCJwh3Hp70n5aW1iAfiS2AIPySGM8H298jiT21BniPj8wLo8hHXMU0MAhx HL6INucufXu1VPAD4ha5aayz0DKpGuA+IlKgXpkVoGn2ANE3mboSuOz5sF7m7pH5Ewsc XmYFzU+NJHZUbc9pTz7Iw58eV0SuD3/hxe0TptvL1cJQYyaFkj2cL2+C54mL9iPpMpkd +/k/uhn3pAgiLPRvu+PaF+QptUQR6e9/ECaDl58QIMfJfZU5/A22gRhbHoVbTL/yNHnF IUog== X-Gm-Message-State: AOAM532xcxesljf7/PyoGLs0mWTxZceY70K+ReL3JfgSCBIoYLGTXu92 nq+XgLxrOYJpXBV2SbcK+inqvo7+Y5xENbFmSymb6zusEMM= X-Google-Smtp-Source: ABdhPJyKN/NQxF5Mia7Zd+Buii3TKyPAlZKVQfkX1y+LBMBXI+u2GkF8fhCcJchULQu3c7V6Yt3OGv2s3DzmpDd/UPc= X-Received: by 2002:a1c:f210:: with SMTP id s16mr9002657wmc.121.1643232069959; Wed, 26 Jan 2022 13:21:09 -0800 (PST) MIME-Version: 1.0 From: Kaushal Modi Date: Wed, 26 Jan 2022 16:20:21 -0500 Message-ID: Subject: org-element persist logic hangs when quitting emacs To: emacs-org list Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::335 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=kaushal.modi@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643232197; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=oz+jD4Az0jA+/r61EDOz4uG0oWQZFwFztLSzJPD1U1A=; b=oi4zKnFNMQEsEvHhUKts+V3EFeOYnnzLKUgDPtVRHcMZwehkrPN1mpFuUienxHNBOOYRmv 4bz5/+ESGuHIvTRM5ANU8zzeFKY2w/yMX04duRuiWAf+2klLYOXHi1RctDTZDe9dte0vzd 81caktwtVQhboeCKHkogndBD6/NC9UFY+G3qJrD8l/+PhzM6SJIBswg/eNdLhAcPBamYAJ BHztgCVZKbh3TCdNO9J82UAvasydmtCrsVPDk+Xilb4JFilJu0CH/mT1jMqoP2APAOLeur tqIzG9gwrF597JcJ8HQg48Q3p20qiEi3hqSlNuj5ixC4JPAmqxDpt7kDgMgfvQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643232197; a=rsa-sha256; cv=none; b=JLVqltm23cByShVQFYHghFFeUo/ueXyh9wyA0l5LP78y0gNG41wuGQVZAI4XldUrp/s99d ZoThIM3SVcqp36k3hKIF1xbPDRv6Pk3hU61CV/txzJrmIFFKRwBSuZZTc5w5iXig/MlOtX b09t59mOo5yBUTnEocPYL5v1Zx2XHbpwXjhc7PA+UMWU93KBM/ggJpVSeJvrUIwQFOGPab cLrRF4O524RvEjhljCwjLGUgWdU4MnFyxdp18Lka3P9DioyZzWLgGloA6nQcIl/dHFKaaW ky8dnB67cukYcXmKsrA2qatckndcn+7LheMBc3wyf8jxu68QTlEClHa/eq2lRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gEjV7eDy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gEjV7eDy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0B14115315 X-Spam-Score: -5.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5QNGebLlb3AD Hello, Lately (at least as of last 3 days), I have seen that when I try to quit emacs, it gets stuck on one of my Org files; it's a personal journal.org that I frequently update using org-capture. So that file is usually open in one of the buffers. Today I did M-x toggle-debug-on-quit and tried to quit emacs. When it got stuck, I hit C-g and I saw this backtrace: ===== Debugger entered--Lisp error: (quit) org-get-limited-outline-regexp() org-element--current-element(567757 element nil nil) org-element--parse-to(567811) org-element-at-point(567811) org-element--cache-persist-before-write(org-element--cache #) run-hook-with-args-until-success(org-element--cache-persist-before-write org-element--cache #) #f(compiled-function (v) #)(org-element--cache) #f(compiled-function (elt) #)(org-element--cache) mapc(#f(compiled-function (elt) #) (org-element--headline-cache org-element--cache)) seq-do(#f(compiled-function (elt) #) (org-element--headline-cache org-element--cache)) seq-find(#f(compiled-function (v) #) (org-element--headline-cache org-element--cache)) org-persist-write((org-element--headline-cache org-element--cache) #) org-persist-write-all() #f(compiled-function (fun) #)(org-persist-write-all) run-hook-wrapped(#f(compiled-function (fun) #) org-persist-write-all) run-hook-query-error-with-timeout(kill-emacs-hook) kill-emacs() save-buffers-kill-emacs() (if (daemonp) (save-buffers-kill-emacs) (save-buffers-kill-terminal)) modi/quit-emacs(nil) funcall-interactively(modi/quit-emacs nil) call-interactively(modi/quit-emacs nil nil) command-execute(modi/quit-emacs) ===== I had also enabled the profiler. The profiler report showed this: ===== 14247 92% - command-execute 14247 92% - call-interactively 14247 92% - funcall-interactively 13973 91% - modi/quit-emacs 13973 91% - if 13939 90% - save-buffers-kill-emacs 13834 90% - kill-emacs 13834 90% - run-hook-query-error-with-timeout 13834 90% - run-hook-wrapped 13834 90% - # 13724 89% - org-persist-write-all 13715 89% - org-persist-write 13698 89% - seq-find 13698 89% - seq-do 13698 89% - mapc 13698 89% - # 13698 89% - # 13698 89% - run-hook-with-args-until-success 13698 89% - org-element--cache-persist-before-write 13698 89% - org-element-at-point 13244 86% - org-element--parse-to 6568 42% + org-element--current-element 2649 17% + org-element--cache-put ===== I was able to quit emacs once I disabled the cache feature by setting org-element-use-cache to nil. --- - Org mode version 9.5 (release_9.5-428-g26dece) - Emacs version: GNU Emacs 28.0.91 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.12) of 2022-01-25, built using commit 7eca80b20444f7bd7bcb6a66a9054e029f0e7013. -- Kaushal Modi