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. -- 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 <p...@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