FAILURE MAP
← Case archive

FA-11551 / Filesystem semantics / Open access

Replacing a pathname retargets an already open descriptor · case 01

Replacing a pathname retargets an already open descriptor.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The handle stores a name and resolves it on every read instead of storing inode identity.

THE FAILURE

The handle stores a name and resolves it on every read instead of storing inode identity.

Unsuccessful approach: Preserving the original inode only when it had another name ignores the descriptor reference.

Case contract

Deterministic in-memory filesystem model. Open destination containing old, then atomically replace its name with a different inode containing new. Return [open-handle content, pathname content]; aliases counts additional names of old inode.

Why this case matters

An offline semantic experiment for file API clients; it models only the stated operations, not a complete operating system.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(old, new, aliases):
    return [new,new]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open target survives replacement',solve('old'+str(N),'new',0),['old'+str(N),'new'])
check('other hardlink survives',solve('old','new',N),['old','new'])
check('empty original file',solve('','new',0),['','new'])
check('empty replacement',solve('old','',0),['old',''])
check('same bytes different identities',solve('same','same',0),['same','same'])
check('both empty',solve('','',N),['',''])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
open target survives replacement['new', 'new']['old1', 'new']Failed
other hardlink survives['new', 'new']['old', 'new']Failed
empty original file['new', 'new']['', 'new']Failed
empty replacement['', '']['old', '']Failed
same bytes different identities['same', 'same']['same', 'same']Passed
both empty['', '']['', '']Passed

SHA-256 / 0a51b55da1a4311246bb90e19e1c719cc5bf5e9aa21d21f9c29692f36846d683

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(old, new, aliases):
    return [old if aliases else new,new]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open target survives replacement',solve('old'+str(N),'new',0),['old'+str(N),'new'])
check('other hardlink survives',solve('old','new',N),['old','new'])
check('empty original file',solve('','new',0),['','new'])
check('empty replacement',solve('old','',0),['old',''])
check('same bytes different identities',solve('same','same',0),['same','same'])
check('both empty',solve('','',N),['',''])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
open target survives replacement['new', 'new']['old1', 'new']Failed
other hardlink survives['old', 'new']['old', 'new']Passed
empty original file['new', 'new']['', 'new']Failed
empty replacement['', '']['old', '']Failed
same bytes different identities['same', 'same']['same', 'same']Passed
both empty['', '']['', '']Passed

SHA-256 / c7af438ddfaadde1ac47d2e28949c48233a070440809493b729e742ca4b4554c

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:48.932277+00:00.

Case digest / 382abff78ca10d94307f399c4fd75b447c543c6f5ad1c3f0eddcc83a600b28de