[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#796798: perl: FTBFS on kfreebsd-*: t/op/stat.t failure



Control: tags -1 + patch

Hi,

Sorry I didn't reply on this thread sooner.

Niko Tyni wrote:
> > On Mon, Aug 24, 2015 at 07:15:19PM +0300, Niko Tyni wrote:
> > >   t/op/stat ..................................................... FAILED at test 9
> 
> > > I see the buildds are now running kernel 10.1-0 while the earlier
> > > builds were on 9.0-2.
> > > 
> > > @buildd admins: any ideas? Are there known issues with ctime in
> > > /tmp on the buildds?

It could have been a configuration change on the buildds (maybe
softupdates are enabled now?) or otherwise a kernel code change in ufs,
nullfs (used for bind mounts) or vfs (file I/O more generally).

Looking at it more closely, the testcase is essentially:

  echo stuff > foo	# we expect mtime == ctime
  sleep 2
  ln foo bar		# this should update ctime of foo
  stat foo		# we expect mtime != ctime

If I merely stat() the file before the sleep - that fixes it - this is
actually a heisenbug!

The problem is with mtime.  It seems to be not calculated immediately,
but deferred until the next stat, after the hard link is created, such
that mtime=ctime and so the test fails.  A stat() right before the
sleep, or a much longer sleep (~30s), causes mtime to be calculated
earlier and so fixes it.

It's obviously a kernel behaviour, its unclear if it's a bug (it may be
an expected quirk of softupdates), and in any case definitely not a Perl
bug.  Might we please add a stat() to work around it, as attached;  that
would allow the test to still run, and still return a meaningful result
rather than skipping/ignoring the test on kfreebsd.

Thanks!
Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
From: Steven Chamberlain <steven@pyro.eu.org>
Date: Thu, 17 Dec 2015 02:15:58 +0000
Subject: Work around Debian Bug#796798

kFreeBSD 10 (possibly only with softupdates enabled) may defer
calculating the mtime for more than 2 seconds.  Work around this
with a stat() call to calculate the mtime immediately.

--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -96,6 +96,7 @@
 print FOO "Now is the time for all good men to come to.\n";
 close(FOO);
 
+stat($tmpfile);	# Work around Debian Bug#796798
 sleep 2;
 
 my $has_link = 1;

Attachment: signature.asc
Description: Digital signature


Reply to: