GNU bug report logs - #60626
30.0.50; `buffer-live-p' sometimes returns t on killed buffers

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sat, 7 Jan 2023 12:45:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60626 in the body.
You can then email your comments to 60626 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#60626; Package emacs. (Sat, 07 Jan 2023 12:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ihor Radchenko <yantar92 <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Jan 2023 12:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; `buffer-live-p' sometimes returns t on killed buffers
Date: Sat, 07 Jan 2023 12:44:47 +0000
Hi,

We are recently experiencing test failures using Emacs 28, Emacs 27, and
Emacs 26 on CI (non-interactively):

https://builds.sr.ht/~bzg/job/918602

2 unexpected results:
   FAILED  ob-octave/graphics-file  ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #<killed buffer>) :value t)
   FAILED  ob-octave/graphics-file-space  ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #<killed buffer>) :value t)

Note that (buffer-live-p #<killed buffer>) returns non-nil, which is
unexpected.

I am also able to reproduce locally using rake + podman:

See https://git.sr.ht/~bzg/org-mode-tests/:

1. cd /path/to/org-mode-tests
2. ln -s /path/to/org ./org-mode
3. cd local
4. rake test:debian:emacs28 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60626; Package emacs. (Sat, 07 Jan 2023 13:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 60626 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 60626 <at> debbugs.gnu.org
Subject: Re: bug#60626: 30.0.50;
 `buffer-live-p' sometimes returns t on killed buffers
Date: Sat, 07 Jan 2023 15:42:19 +0200
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Date: Sat, 07 Jan 2023 12:44:47 +0000
> 
> We are recently experiencing test failures using Emacs 28, Emacs 27, and
> Emacs 26 on CI (non-interactively):

What about Emacs 29?  Or is this report only about versions 28 and
older?  In the latter case, why would it suddenly start failing, if
those versions are no longer being developed?

> https://builds.sr.ht/~bzg/job/918602
> 
> 2 unexpected results:
>    FAILED  ob-octave/graphics-file  ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #<killed buffer>) :value t)
>    FAILED  ob-octave/graphics-file-space  ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #<killed buffer>) :value t)
> 
> Note that (buffer-live-p #<killed buffer>) returns non-nil, which is
> unexpected.

Are you sure this is the right interpretation?

Anyway, is there any hope for a more self-contained recipe, which I
could try on my system without too much ado?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60626; Package emacs. (Sat, 07 Jan 2023 15:02:02 GMT) Full text and rfc822 format available.

Message #11 received at 60626 <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60626 <at> debbugs.gnu.org
Subject: Re: bug#60626: 30.0.50; `buffer-live-p' sometimes returns t on
 killed buffers
Date: Sat, 07 Jan 2023 15:01:34 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> We are recently experiencing test failures using Emacs 28, Emacs 27, and
>> Emacs 26 on CI (non-interactively):
>
> What about Emacs 29?  Or is this report only about versions 28 and
> older?  In the latter case, why would it suddenly start failing, if
> those versions are no longer being developed?

The failures are after we added `buffer-live-p' into assert form:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?h=bugfix&id=41ebc2e40c33080a47cebb2507f038058b862655

Unfortunately, we don't have CI configuration for Emacs 29 now.

>> https://builds.sr.ht/~bzg/job/918602
>> 
>> 2 unexpected results:
>>    FAILED  ob-octave/graphics-file  ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #<killed buffer>) :value t)
>>    FAILED  ob-octave/graphics-file-space  ((should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))) :form (buffer-live-p #<killed buffer>) :value t)
>> 
>> Note that (buffer-live-p #<killed buffer>) returns non-nil, which is
>> unexpected.
>
> Are you sure this is the right interpretation?

I think so. The full backtrace is

Test ob-octave/graphics-file backtrace:
  signal(ert-test-failed (((should-not (buffer-live-p (get-buffer "*Or
  ert-fail(((should-not (buffer-live-p (get-buffer "*Org-Babel Error O
  (if (not (unwind-protect (setq value-1507 (apply fn-1505 args-1506))
  (let (form-description-1509) (if (not (unwind-protect (setq value-15
  (let ((value-1507 'ert-form-evaluation-aborted-1508)) (let (form-des
  (let* ((fn-1505 #'buffer-live-p) (args-1506 (condition-case err (let
  (progn (org-mode) (let ((point (string-match "<point>" inside-text))
  (unwind-protect (progn (org-mode) (let ((point (string-match "<point
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current
  (let ((inside-text (if (stringp (format "#+begin_src octave :results
  (unwind-protect (let ((inside-text (if (stringp (format "#+begin_src
  (let ((file (make-temp-file "test-ob-octave-" nil ".png"))) (unwind-
  (let ((lexical-binding t)) (if (get-buffer "*Org-Babel Error Output*
  (closure (t) nil (let ((lexical-binding t)) (if (get-buffer "*Org-Ba
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name ob-octave/graphics-file :documentatio
  ert-run-or-rerun-test(#s(ert--stats :selector "\\(org\\|ob\\|ox\\...
  ert-run-tests("\\(org\\|ob\\|ox\\)" #f(compiled-function (event-type
  ert-run-tests-batch("\\(org\\|ob\\|ox\\)")
  ert-run-tests-batch-and-exit("\\(org\\|ob\\|ox\\)")
  (let ((org-id-track-globally t) (org-test-selector (if org-test-sele
  org-test-run-batch-tests("\\(org\\|ob\\|ox\\)")
  command-line-1(("--load" "/home/build/.emacs.d/init.el" "--eval" "(s
  command-line()
  normal-top-level()
Test ob-octave/graphics-file condition:
    (ert-test-failed
     ((should-not
       (buffer-live-p
	(get-buffer "*Org-Babel Error Output*")))
      :form
      (buffer-live-p #<killed buffer>)
      :value t))
   FAILED   164/1187  ob-octave/graphics-file (0.257630 sec)

> Anyway, is there any hope for a more self-contained recipe, which I
> could try on my system without too much ado?

Unfortunately, no. Tests are not failing for me locally, so the
container setup appears to be part of the recipe.

I was only able to reproduce locally running the container.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60626; Package emacs. (Mon, 09 Jan 2023 10:22:02 GMT) Full text and rfc822 format available.

Message #14 received at 60626 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 60626 <at> debbugs.gnu.org
Subject: Re: bug#60626: 30.0.50; `buffer-live-p' sometimes returns t on
 killed buffers
Date: Mon, 09 Jan 2023 11:21:06 +0100
Ihor Radchenko <yantar92 <at> posteo.net> writes:

> >> Note that (buffer-live-p #<killed buffer>) returns non-nil, which is
> >> unexpected.
> >
> > Are you sure this is the right interpretation?
>
> I think so.

Couldn't it be that the buffer had been live when the form had been
evaluated, but killed when the form had been printed (later)?  The
information you posted does not necessarily imply that `buffer-live-p'
ever returned t when called with a killed buffer.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60626; Package emacs. (Wed, 11 Jan 2023 11:08:01 GMT) Full text and rfc822 format available.

Message #17 received at 60626 <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 60626 <at> debbugs.gnu.org
Subject: Re: bug#60626: 30.0.50; `buffer-live-p' sometimes returns t on
 killed buffers
Date: Wed, 11 Jan 2023 11:08:04 +0000
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

>> > Are you sure this is the right interpretation?
>>
>> I think so.
>
> Couldn't it be that the buffer had been live when the form had been
> evaluated, but killed when the form had been printed (later)?  The
> information you posted does not necessarily imply that `buffer-live-p'
> ever returned t when called with a killed buffer.

This is likely true.

The test looks like

(unwind-protect
        (org-test-with-temp-text
	    (format "#+begin_src octave :results file graphics :file %s
sombrero;
#+end_src"
		    file)
          (org-babel-execute-src-block)
          (should (search-forward (format "[[file:%s]]" file) nil nil))
          (should (file-readable-p file))
          (should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))))
      ;; clean-up
      (delete-file file)
      (when (get-buffer "*Org-Babel Error Output*")
        (kill-buffer "*Org-Babel Error Output*")))

So, unwind fallback forms are likely executed.

Thanks for the pointer!

I think this bug report can then be closed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 11 Jan 2023 12:51:02 GMT) Full text and rfc822 format available.

Notification sent to Ihor Radchenko <yantar92 <at> posteo.net>:
bug acknowledged by developer. (Wed, 11 Jan 2023 12:51:02 GMT) Full text and rfc822 format available.

Message #22 received at 60626-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: michael_heerdegen <at> web.de, 60626-done <at> debbugs.gnu.org
Subject: Re: bug#60626: 30.0.50; `buffer-live-p' sometimes returns t on
 killed buffers
Date: Wed, 11 Jan 2023 14:50:40 +0200
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 60626 <at> debbugs.gnu.org
> Date: Wed, 11 Jan 2023 11:08:04 +0000
> 
> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> 
> > Couldn't it be that the buffer had been live when the form had been
> > evaluated, but killed when the form had been printed (later)?  The
> > information you posted does not necessarily imply that `buffer-live-p'
> > ever returned t when called with a killed buffer.
> 
> This is likely true.
> 
> The test looks like
> 
> (unwind-protect
>         (org-test-with-temp-text
> 	    (format "#+begin_src octave :results file graphics :file %s
> sombrero;
> #+end_src"
> 		    file)
>           (org-babel-execute-src-block)
>           (should (search-forward (format "[[file:%s]]" file) nil nil))
>           (should (file-readable-p file))
>           (should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))))
>       ;; clean-up
>       (delete-file file)
>       (when (get-buffer "*Org-Babel Error Output*")
>         (kill-buffer "*Org-Babel Error Output*")))
> 
> So, unwind fallback forms are likely executed.
> 
> Thanks for the pointer!
> 
> I think this bug report can then be closed.

Thanks, closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Feb 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.