🔴 [H6] 后台 mmap 索引期间文件截断 → SIGBUS #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
文件:
core/io/progressive_reader.rs:268-287分类: 内存安全 / 并发
问题: 后台索引线程对活跃文件做 mmap,扫描过程中如果文件被外部截断/轮转,访问映射内存会 SIGBUS 崩溃整个进程。
建议修复: 对活跃变化的文件避免 mmap,改用
pread或缓冲读取;或验证稳定元数据后隔离 mmap 访问。