From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cAW6IFj2cGdLPQAAqHPOHw:P1 (envelope-from ) for ; Sun, 29 Dec 2024 07:12:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id cAW6IFj2cGdLPQAAqHPOHw (envelope-from ) for ; Sun, 29 Dec 2024 08:12:24 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EN1YpzHb; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735456344; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XBl0ie9W/Ty6cRznp+evRqfP0fW9FJ5ehw68PKHMXzI=; b=usyBS8EqWEsY7alUYY3Drt3WJsnGufmyw/yvl2hQI5tCLBJc/jcZ1ZtAW/7ib90vx/RSyR 3+EUqMIpERW4ZvbyOaLm7bDYkNmFN6Rn9B1Cg3jo9EipjGMlSdsWaClpRFWmn7giocP1uS ftx/Irg9ac+TUTT/4VbwINtw8jolHhK8IfTZTT81S38EchXTzchKByXntkfq21o88HyAPt tBCKJgi+vKskyKrtiw0rxXmsICOwzXD/tbtnlDLwI1fs947BOXo56WOlCxrrYZCcQ57Mrb sNXpzHZtT5yiahmyDO/iFZikZMrbUew5evYUhpEUv0uoT26Txg/2xoUlTG0N1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EN1YpzHb; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735456344; a=rsa-sha256; cv=none; b=CEOqNLJHjchutyy3HQd7TzSUcIY8sAu0Ql5jL+Hb5DPznP8gfIEqBPJG9gMwTwRSLG30Ka o7bkKx3u0QejlC4hRF1a0uEcDlHPuY1Xkh3czAcG9PnilJyF7rhLIKA+LJYWeAOzhg94L4 bEoiX5oDwdNjvCsmzdDLIo43lDYWCCIPX/iuPjUTSlAhGLOdYf/Z48IGr25k6hl0zhtpFY 7qhVkle604MmUrY2q3BiQbR+FsmRKJF8CWaKyoKVWdKNdET+EPaZNn4k+1ZtiUgnpBqUjF kFY8m3I4nzyASZKPe8aErCV79AbiI/yAoWhYLLo1Pu6isRNOiwBL9AMq+YTRGw== 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 0130A9FC70 for ; Sun, 29 Dec 2024 08:12:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnSf-0001oS-1k; Sun, 29 Dec 2024 02:11:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnSc-0001oH-IR for emacs-orgmode@gnu.org; Sun, 29 Dec 2024 02:11:38 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnSa-0007bL-Gv for emacs-orgmode@gnu.org; Sun, 29 Dec 2024 02:11:38 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 062D6240101 for ; Sun, 29 Dec 2024 08:11:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1735456293; bh=aDPG7vLh4cypr0gsGatIpO9Aq3N5iI08xx5o8k6k+I8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=EN1YpzHb2UE7frKzUWOE1xCaa0I9oWAiNNOuAiAGCteENFf6BKVc0kaFL2pTtCXQQ kMrXNwVyGj9HQRStrqurNNnMx00aehbnUESwHTNgQwEMwgvxv0cOTn4F7+lO3fUBLu 8dOyJB/I2Bk8q+WXKu5iBizP7IPd02bkXUk3vqNBUWxn0BtO9hM5F8dWxdncNkHv5c InZEYPMu/IBSA/33RjnRrxwdGsZeb1zyDXNuLkAzAdVbeM1+KJ0QBCwmoCspQ8i1Z4 wKe15OiqY0jhCd/19pM0ow02/5OVLMeL6BuN4fOaGWixa+g766ozRL2kpSaJ0/uV05 +qWLWrNvNgK4w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YLVlS1dTrz9rxL; Sun, 29 Dec 2024 08:11:32 +0100 (CET) From: Ihor Radchenko To: Paul Stansell Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)] In-Reply-To: References: <87ldw6jp5s.fsf@localhost> <87zfkmi86w.fsf@localhost> <87wmfpihfh.fsf@localhost> <87h66p5e0q.fsf@localhost> <87h66p3s6v.fsf@localhost> Date: Sun, 29 Dec 2024 07:13:01 +0000 Message-ID: <87seq7vu6a.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -8.79 X-Spam-Score: -8.79 X-Migadu-Queue-Id: 0130A9FC70 X-Migadu-Scanner: mx10.migadu.com X-TUID: dlKaYs+sZ/uo --=-=-= Content-Type: text/plain Paul Stansell writes: >> This looks more reasonable. >> Is this with my patch applied? >> > > Yes, the patch is applied. Ok. Then, may you try another version of the patch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-org-persist-Fix-mixing-cace-data-from-multiple-Em.patch >From 13ade2328dcae881296b5d7acc4493022a8895f3 Mon Sep 17 00:00:00 2001 Message-ID: <13ade2328dcae881296b5d7acc4493022a8895f3.1735456333.git.yantar92@posteo.net> From: Ihor Radchenko Date: Tue, 24 Dec 2024 09:45:42 +0100 Subject: [PATCH v2] org-persist: Fix mixing cace data from multiple Emacs processes * lisp/org-persist.el (org-persist--write-elisp-file): When there is a clash with other Emacs process while writing cache data, discard the cache to avoid any problem. (org-persist--refresh-gc-lock): (org-persist--gc-orphan-p): Bail out when writing fails. Reported-by: Paul Stansell Link: https://orgmode.org/list/YT3PR01MB95943D4DB2E659091A2BDE8DBE2E2@YT3PR01MB9594.CANPRD01.PROD.OUTLOOK.COM --- lisp/org-persist.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/org-persist.el b/lisp/org-persist.el index 4ff43ad7a5..d2ceb8f90f 100644 --- a/lisp/org-persist.el +++ b/lisp/org-persist.el @@ -478,11 +478,12 @@ (defun org-persist--write-elisp-file (file data &optional no-circular pp) (start-time (float-time))) (unless (file-exists-p (file-name-directory file)) (make-directory (file-name-directory file) t)) - ;; Force writing even when the file happens to be opened by - ;; another Emacs process. + ;; Discard cache when there is a clash with other Emacs process. + ;; This way, we make sure that cache is never mixing data & record + ;; from different processes. (cl-letf (((symbol-function #'ask-user-about-lock) - ;; FIXME: Emacs 27 does not yet have `always'. - (lambda (&rest _) t))) + (lambda (&rest _) + (error "Other Emacs process is writing to cache")))) (with-temp-file file (insert ";; -*- mode: lisp-data; -*-\n") (if pp @@ -1251,7 +1252,7 @@ (defun org-persist--refresh-gc-lock () (when (< (- (float-time (cdr record)) (float-time (current-time))) org-persist-gc-lock-expiry) (push record new-alist))) - (org-persist--write-elisp-file file new-alist))) + (ignore-errors (org-persist--write-elisp-file file new-alist)))) (defun org-persist--gc-orphan-p () "Return non-nil, when orphan files should be garbage-collected. @@ -1259,7 +1260,7 @@ (defun org-persist--gc-orphan-p () (let* ((file (org-file-name-concat org-persist-directory org-persist-gc-lock-file)) (alist (when (file-exists-p file) (org-persist--read-elisp-file file)))) (setq alist (org-assoc-delete-all before-init-time alist)) - (org-persist--write-elisp-file file alist) + (ignore-errors (org-persist--write-elisp-file file alist)) ;; Only GC orphan files when there are no active sessions. (not alist))) -- 2.47.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--