You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] LocalFS.StatFile panics on non-ENOENT stat errors #25602
LocalFS.StatFile can panic on filesystem errors other than ENOENT because it dereferences a nil os.FileInfo after os.Stat returns an error.
Reproduction
At commit 7821d21c723372e45a8f65da3bbb896a157b1036:
Create a regular file at root/a.
Call LocalFS.StatFile("a/b").
os.Stat returns an ENOTDIR error and a nil stat, after which pkg/fileservice/local_fs.go:972-977 calls stat.IsDir(). The process panics instead of returning the filesystem error. The same pattern applies to other non-ENOENT errors.
Expected
Any os.Stat error should be returned (with ENOENT mapped to FileNotFound) before dereferencing stat.
go test ./pkg/fileservice \
-run '^Test(DiskObjectStorageWriteFailureRemovesTempFile|DiskObjectStorageSizeMismatchRemovesTempFile|DiskObjectStorageDeleteReturnsRemovalError|LocalFSStatFileReturnsNonNotExistError)$' \
-count=3 -v
Activity
fix(fileservice): preserve errors and cache merge ordering (#25659)
LeftHandCold commentedon Jul 15, 2026
fixed
Ariznawlll commentedon Jul 15, 2026
最新 main 详细验证
origin/main@f1c0a92d882dbdad469ffd2c96f607796207c797。本 issue 对应测试过程
file。file/child调用StatFile,制造“中间路径不是目录”的 OS 错误。syscall.ENOTDIR,而不是被错误归一化成os.ErrNotExist。结果
TestLocalFSStatFileReturnsNonNotExistError:PASS 3/3。ok github.com/matrixorigin/matrixone/pkg/fileservice 0.461s。fix(fileservice): preserve errors and cache merge ordering (matrixori…
fix(fileservice): preserve errors and cache merge ordering (matrixori…
fix(fileservice): preserve errors and cache merge ordering (matrixori…