On Friday 12 December 2025 20:22:59 Martin Storsjö wrote:
> On Thu, 4 Dec 2025, Pali Rohár wrote:
>
> > Changes were applied on top of the c2167bc6da600f7fdbd131734767a67ffb9e970e
> >
> > Note that there are existing ABI issues with dirent.c and ftw.c files.
> > This patch series just make them more visible due to _finddata_t guards.
> > dirent.c ABI issue is expected to be fixed by Lasse Collin readdir()
> > changed. I hope that these changes would not cause too many merge
> > conflicts.
> >
> > It is possible that extended t_findfirst tests could fail. I'm going to
> > run them on more configuration to see if I uncover issues.
>
> These tests after this patchset do fail, in the CI environment:
>
> FAIL: t_findfirst
> =================
>
> Error: .:stat st_ctime (1765539689) differs from _findfirst64i32 time_write
> (1765539850)
>
> Test name: test
> .
> Error: .:stat st_ctime (1765539689) differs from _findfirst64 time_write
> (1765539850)
>
> Test name: testi64
> .
> Error: .:stat st_ctime (1765539689) differs from _findfirst32 time_write
> (1765539850)
>
> Test name: test32
> .
> Error: .:stat st_ctime (1765539689) differs from _findfirst32i64 time_write
> (1765539850)
>
> Test name: test32i64
> .
> Error: .:stat st_ctime (1765539689) differs from _findfirst64i32 time_write
> (1765539850)
>
> Test name: test64i32
> .
> Error: .:stat st_ctime (1765539689) differs from _findfirst64 time_write
> (1765539850)
>
> Test name: test64
> .
> Error: .:wstat st_ctime (1765539689) differs from _wfindfirst64i32
> time_write (1765539850)
>
> Test name: wtest
> .
> Error: .:wstat st_ctime (1765539689) differs from _wfindfirst64 time_write
> (1765539850)
>
> Test name: wtesti64
> .
> Error: .:wstat st_ctime (1765539689) differs from _wfindfirst32 time_write
> (1765539850)
>
> Test name: wtest32
> .
> Error: .:wstat st_ctime (1765539689) differs from _wfindfirst32i64
> time_write (1765539850)
>
> Test name: wtest32i64
> .
> Error: .:wstat st_ctime (1765539689) differs from _wfindfirst64i32
> time_write (1765539850)
>
> Test name: wtest64i32
> .
> Error: .:wstat st_ctime (1765539689) differs from _wfindfirst64 time_write
> (1765539850)
>
> Test name: wtest64
> .
> FAIL t_findfirst.exe (exit status: 1)
>
>
> I have not tried to debug it further figure out why this differs.
>
> // Martin
It differs in few minutes for "." entry. I guess that this can happen
when log file t_findfirst.log is being written to the current directory
which can affect ctime of ".". Probably same problem can happen also for
"..".
It is quite tricky to find out which entries could be modified during
current the test. It can depends on fs caches or other unknown things.
I remember that I read somewhere that FindFirstFile can return cached
values.
Quick fix which avoids this test for . and .. entries:
diff --git a/mingw-w64-crt/testcases/t_findfirst.c
b/mingw-w64-crt/testcases/t_findfirst.c
index de88f6a19979..b8932c359c37 100644
--- a/mingw-w64-crt/testcases/t_findfirst.c
+++ b/mingw-w64-crt/testcases/t_findfirst.c
@@ -17,8 +17,8 @@
fprintf (stderr, "Error: Function %s" F " failed: errno=%d (%s)\n",
#STATFUNC, d.name, errno, strerror (errno)); \
return 1; \
} \
- if (STRCMPAW(d.name, "t_findfirst.log") == 0) { \
- fprintf (stderr, "Skipping file t_findfirst.log as it is being changed
during the test\n"); \
+ if (STRCMPAW(d.name, ".") == 0 || STRCMPAW(d.name, "..") == 0 ||
STRCMPAW(d.name, "t_findfirst.log") == 0) { \
+ fprintf (stderr, "Skipping entry " F " as it is being changed during the
test\n", d.name); \
} else { \
if (st.st_atime != d.time_access) { \
fprintf (stderr, "Error: " F ": %s st_atime (%I64d) differs from %s
time_access (%I64d)\n", d.name, #STATFUNC, (long long)st.st_atime, #FINDFUNC,
(long long)d.time_access); \
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public