GNU bug report logs - #55706
29.0.50; files test fails about 20% of the time

Previous Next

Package: emacs;

Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>

Date: Sun, 29 May 2022 14:45:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 55706 in the body.
You can then email your comments to 55706 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#55706; Package emacs. (Sun, 29 May 2022 14:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Ingebrigtsen <larsi <at> gnus.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 29 May 2022 14:45:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Michael Albinus <michael.albinus <at> gmx.de>
Subject: 29.0.50; files test fails about 20% of the time
Date: Sun, 29 May 2022 16:44:34 +0200
I can't reproduce this reliably, but in about 20% of the times I run
"make check", this test fails:

Test files-tests-file-name-non-special-file-in-directory-p condition:
    (ert-test-failed
     ((should
       (file-in-directory-p nospecial nospecial-tempdir))
      :form
      (file-in-directory-p "/:/tmp/files-testsuqfdq1.special" "/:/tmp/")
      :value nil))
   FAILED   52/112  files-tests-file-name-non-special-file-in-directory-p (0.001158 sec) at lisp/files-tests.el:692

Michael wrote the test, so I've added him to the CCs.


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
 of 2022-05-17 built on xo
Repository revision: 803041e01474f2a522170c9f388068e8460be2ae
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux bookworm/sid


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Mon, 30 May 2022 16:50:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Mon, 30 May 2022 18:49:33 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi,

> I can't reproduce this reliably, but in about 20% of the times I run
> "make check", this test fails:
>
> Test files-tests-file-name-non-special-file-in-directory-p condition:
>     (ert-test-failed
>      ((should
>        (file-in-directory-p nospecial nospecial-tempdir))
>       :form
>       (file-in-directory-p "/:/tmp/files-testsuqfdq1.special" "/:/tmp/")
>       :value nil))
>    FAILED   52/112  files-tests-file-name-non-special-file-in-directory-p (0.001158 sec) at lisp/files-tests.el:692
>
> Michael wrote the test, so I've added him to the CCs.

Strange. I have applied 100 times "make -C test files-tests". It always
returns

--8<---------------cut here---------------start------------->8---
Ran 112 tests, 111 results as expected, 1 unexpected (2022-05-30 18:34:19+0200, 1.005432 sec)

1 unexpected results:
   PASSED  files-load-elc-gz-file
--8<---------------cut here---------------end--------------->8---

(This might also be worth to be investigated.) No error of
files-tests-file-name-non-special-file-in-directory-p.

Perhaps the parallel nature of the test runs make it happen? Does it
also fail occasionally when you call "make -j1 ..."?

Furthermore, (file-in-directory-p "/:/tmp/files-testsuqfdq1.special" "/:/tmp/")
should always return non-nil, unless the directory /tmp does not exist,
or is not accessible. Could this happen in your environment, temporarily?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Mon, 30 May 2022 16:54:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Mon, 30 May 2022 18:52:49 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Perhaps the parallel nature of the test runs make it happen? Does it
> also fail occasionally when you call "make -j1 ..."?

I have never seen it happen with a -j1, but I don't usually do that.

> Furthermore, (file-in-directory-p "/:/tmp/files-testsuqfdq1.special" "/:/tmp/")
> should always return non-nil, unless the directory /tmp does not exist,
> or is not accessible. Could this happen in your environment, temporarily?

No, it's just a standard Debian/bookworm machine with a normal /tmp.

I'll set it up to look over a -j1 to see whether it even fails when
doing that and report back.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Mon, 30 May 2022 18:30:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Mon, 30 May 2022 20:28:49 +0200
I've now run a number of

for i in `seq 1 40`; do make -j64 check; done > /tmp/j64.out 2>/tmp/j64.err

variations, and it varies how much it fails.  With -j4 and lower, it
never fails.  With j8 to j16 it fails about 1 in 10 times, and with -j32
it fails 40% of the time.  (Take numbers with a grain of salt.)

So there seems to be something racing with this test -- but only this
test.  Pretty bizarre.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Mon, 30 May 2022 18:45:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Mon, 30 May 2022 20:43:56 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi,

> I've now run a number of
>
> for i in `seq 1 40`; do make -j64 check; done > /tmp/j64.out 2>/tmp/j64.err
>
> variations, and it varies how much it fails.  With -j4 and lower, it
> never fails.  With j8 to j16 it fails about 1 in 10 times, and with -j32
> it fails 40% of the time.  (Take numbers with a grain of salt.)
>
> So there seems to be something racing with this test -- but only this
> test.  Pretty bizarre.

Yep, bizarre. I have no idea what's up. Let's sleep about it ...

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Tue, 31 May 2022 09:58:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Tue, 31 May 2022 11:57:38 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi Lars,

> I've now run a number of
>
> for i in `seq 1 40`; do make -j64 check; done > /tmp/j64.out 2>/tmp/j64.err
>
> variations, and it varies how much it fails.  With -j4 and lower, it
> never fails.  With j8 to j16 it fails about 1 in 10 times, and with -j32
> it fails 40% of the time.  (Take numbers with a grain of salt.)

I have less cores in my laptop, so I have applied your code with -j8. It
failed exactly one time. Not bad, so I'm able to reproduce it.

> So there seems to be something racing with this test -- but only this
> test.  Pretty bizarre.

I will instrument both the test function and file-in-directory-p in
order to get more information about the reason. Don't expect results
soon, these days I'm slow in working for Emacs.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Tue, 31 May 2022 18:18:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Tue, 31 May 2022 20:17:08 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> I have less cores in my laptop, so I have applied your code with -j8. It
> failed exactly one time. Not bad, so I'm able to reproduce it.

I was beginning to wonder whether it was just a problem on my build
machine -- I couldn't reproduce it at all on my laptop (but the laptop
is really slow compared to the build machine).

>> So there seems to be something racing with this test -- but only this
>> test.  Pretty bizarre.
>
> I will instrument both the test function and file-in-directory-p in
> order to get more information about the reason. Don't expect results
> soon, these days I'm slow in working for Emacs.

No problem.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Wed, 01 Jun 2022 16:42:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Wed, 01 Jun 2022 18:41:28 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi Lars,

>> I have less cores in my laptop, so I have applied your code with -j8. It
>> failed exactly one time. Not bad, so I'm able to reproduce it.
>
> I was beginning to wonder whether it was just a problem on my build
> machine -- I couldn't reproduce it at all on my laptop (but the laptop
> is really slow compared to the build machine).

Finally, I could catch it. file-in-directory-p calls at the very end
(file-equal-p root dir), which is (file-equal-p "/tmp/" "/tmp/") in our
test case. In file-equal-p, the file attributes of file1 and file2 are
compared via equal, which means in the failing test

--8<---------------cut here---------------start------------->8---
(equal '(t 31 0 0 (25238 27804 344363 628000) (25238 27804 371363 598000) (25238 27804 371363 598000) 820 drwxrwxrwt t 1 37)
       '(t 31 0 0 (25238 27804 344363 628000) (25238 27804 372363 597000) (25238 27804 372363 597000) 800 drwxrwxrwt t 1 37)
--8<---------------cut here---------------end--------------->8---

As you can see, the file attributes of "/tmp" are not equal. This is,
because between the first and second call of file-attributes, "/tmp" has
been changed due to the other test jobs running in parallel.

I've fixed this by creating a subdirectory of "/tmp", using it as
temporary-file-directory. Pushed to master. Could you, pls, check
whether this works also on your build machine with -j64? For me it works
w/o any problem, even with an iteration of 100 over "make -j8 check".

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55706; Package emacs. (Thu, 02 Jun 2022 11:37:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 55706 <at> debbugs.gnu.org
Subject: Re: bug#55706: 29.0.50; files test fails about 20% of the time
Date: Thu, 02 Jun 2022 13:36:46 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> As you can see, the file attributes of "/tmp" are not equal. This is,
> because between the first and second call of file-attributes, "/tmp" has
> been changed due to the other test jobs running in parallel.

Heh.

> I've fixed this by creating a subdirectory of "/tmp", using it as
> temporary-file-directory. Pushed to master. Could you, pls, check
> whether this works also on your build machine with -j64? For me it works
> w/o any problem, even with an iteration of 100 over "make -j8 check".

Thanks; I can confirm that the problem is gone on my main build machine
after running with -j64 dozens of time.

(Closing the bug report.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 55706 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Jun 2022 11:38:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Jul 2022 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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