Skip to content

find: -used/-atime family samples directory times after an atime-bumping enumeration open #1402

Closed

Description

@caomengxuan666

Follow-up from the #1309–#1317 verification sweep (PR #1388, merged 84c4ce6): find -used 1 on the root directory operand (.) can include . when GNU does not — a directory-time sampling-order residual, not a predicate error.

Evidence (one fixture, three stages, mingw+Wine harness):

  1. GNU runs first, winx second: winx includes . (atime already mutated by the GNU run — the known atime trap).
  2. Two identical fixtures run separately: file sets identical except ..
  3. Same fixture, winx runs first: before the run, . has atime−ctime = −5.0 ms (clearly negative, so GNU semantics exclude it), yet winx includes .; after the run the gap is +302 ms — winx's own enumeration open raises the directory atime (relatime) before the predicate samples it. GNU run afterwards on the same bumped fixture also includes ..

So the traversal opens/lists the directory (bumping its atime) and only then samples atime/ctime for the -used/-atime family. File operands are unaffected; all file sets matched GNU exactly.

Fix direction: sample a directory's times before the enumeration open that can bump them (or carry the pre-open stat through traversal). Not a blocker for #1388 (merged). Invisible on real Windows in the default configuration (NTFS last-access updates are off by default), which is why this is filed as a follow-up rather than a merge gate.

Destination: winx find follow-up batch (with the Windows-CI gtest verification of #1309–#1317). Labels/assignee per filing hygiene.

Activity

  1. added
    bug
    compat-gap
    on Oct 26, 2026
  2. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcompat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions