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

Re: Bug#824451: libarchive: FTBFS on kFreeBSD: tar/test/test_option_older_than.c:70: File should exist



Hello Petter Reinholdtsen.

(Adding debian-bsd list to CC...)

Thank you very much for looking into this issue!

On Sat, Jun 25, 2016 at 11:59:07AM +0200, Petter Reinholdtsen wrote:
> Control: tags -1 + patch
> 
> [Simon McVittie]
> > As already reported to debian-bsd by the libarchive maintainer,
> > libarchive 3.2.0 fails to build from source on kFreeBSD due to this
> > test failure:
> > 
> >  40: test_option_older_than
> >  tar/test/test_option_older_than.c:70: File should exist: a/b/old.txt
> >  tar/test/test_option_older_than.c:83: File should exist: a/b/old.txt
> 
> I had a look at this, and tracked it down to an access() call reporting
> "No such file or directory", for no apparent reason.  The files are present
> when I have a look in the directory after the test run fail.  Look like some
> race condition.
> 
> This made me wonder if perhaps the problem was the kFreeBSD kernel file
> system caching, and I tested to run fsync() when the files are created
> to ensure the data make it to disk.  This solved the problem when I
> tested it on amd64 kFreeBSD.  The attached patch fixes the test failure.

In my ears this sounds pretty much like we're either:

a/ working around a really serious potential data loss bug in kfreebsd
b/ hiding a race in the testsuite by making it less likely to trigger

Neither really sounds like we're getting the correct fix, but maybe
I'm wrong.

Could you please advice on what your ideas about the patch is/was?
Just suggesting where the problem might be and provide a workaround or
do you consider the patch the correct fix for the problem?

Your feedback would be much appreciated!

Would also be great if someone with good kfreebsd knowledge could
confirm that we're not doing a/.


> -- 
> Happy hacking
> Petter Reinholdtsen

> Description: Fix test failure on kFreeBSD
>   Use fsync() in test suite when creating a file, to ensure it is
>   available when access() look for it shortly after the creation.
> 
>   Add more error reporting when the access() call fail to get
>   more information in the future when such failure happen.
> Author: Petter Reinholdtsen <pere@falla.debian.org>
> Bug-Debian: https://bugs.debian.org/824451
> Forwarded: no
> Reviewed-By: <name and email of someone who approved the patch>
> Last-Update: <YYYY-MM-DD>
> 
> --- libarchive-3.2.0.orig/tar/test/main.c
> +++ libarchive-3.2.0/tar/test/main.c
> @@ -920,7 +920,7 @@ assertion_file_exists(const char *filena
>  	if (!access(f, F_OK))
>  		return (1);
>  #endif
> -	failure_start(filename, line, "File should exist: %s", f);
> +	failure_start(filename, line, "File should exist: %s (%s)", f, strerror(errno));
>  	failure_finish(NULL);
>  	return (0);
>  }
> @@ -1644,6 +1644,7 @@ assertion_make_file(const char *file, in
>  			return (0);
>  		}
>  	}
> +	fsync(fd);
>  	close(fd);
>  	return (1);
>  #endif

Regards,
Andreas Henriksson


Reply to: