Problem
Filesystem probes against an invalid host path, such as a filename longer than the platform component limit, crash a sparse-overlay fresh worker with a raw Node exception:
ENAMETOOLONG: name too long, lstat ...
at sourcePath
at overlay.node_ops.lookup
at FS.lookupNode
at faccessat
PHP should receive normal filesystem errno semantics so functions such as file_exists() can return false and callers can handle the path. Standard NODEFS translates host exceptions through NODEFS.tryFSOperation().
Root cause
createOverlayNodeFsMountHandler().node_ops.lookup() calls sourcePath() and NODEFS.getMode() outside NODEFS.tryFSOperation(). Host errors other than the helper's special-cased ENOENT escape JavaScript and terminate the workload.
Expected behavior
Run the complete overlay lookup inside NODEFS.tryFSOperation() so native ENAMETOOLONG, EACCES, and related lookup errors become Emscripten/PHP filesystem errors.
Reproduction
Inside a sparse overlay mount:
echo file_exists( "/overlay/" . str_repeat( "x", 300 ) ) ? "exists" : "missing";
Expected: missing.
Observed before fix: raw Node ENAMETOOLONG worker crash.
Downstream evidence: the WordPress core wp_tempnam() length tests in the other PHPUnit suite.
Problem
Filesystem probes against an invalid host path, such as a filename longer than the platform component limit, crash a sparse-overlay fresh worker with a raw Node exception:
PHP should receive normal filesystem errno semantics so functions such as
file_exists()can returnfalseand callers can handle the path. Standard NODEFS translates host exceptions throughNODEFS.tryFSOperation().Root cause
createOverlayNodeFsMountHandler().node_ops.lookup()callssourcePath()andNODEFS.getMode()outsideNODEFS.tryFSOperation(). Host errors other than the helper's special-casedENOENTescape JavaScript and terminate the workload.Expected behavior
Run the complete overlay lookup inside
NODEFS.tryFSOperation()so nativeENAMETOOLONG,EACCES, and related lookup errors become Emscripten/PHP filesystem errors.Reproduction
Inside a sparse overlay mount:
Expected:
missing.Observed before fix: raw Node
ENAMETOOLONGworker crash.Downstream evidence: the WordPress core
wp_tempnam()length tests in theotherPHPUnit suite.