Skip to content

fs__sendfile may abort when coping file with unknown reason in windows #60927

@songjhaha

Description

@songjhaha

We hit a SIGABRT of libuv when running cp to copy a lots of file in dir, the carsh log like:

[2026/2/5 09:25:20]Assertion failed: req->result != -1, file src/win/fs.c, line 2118
[2026/2/5 09:25:20]
[2026/2/5 09:25:20][2128] signal (22): SIGABRT
[2026/2/5 09:25:20]in expression starting at d:\fileshare\build.jl:31
[2026/2/5 09:25:20]crt_sig_handler at C:/Users/vagrant/builds/julialang/julia/src\signals-win.c:95
[2026/2/5 09:25:20]raise at C:\Windows\System32\msvcrt.dll (unknown line)
[2026/2/5 09:25:20]abort at C:\Windows\System32\msvcrt.dll (unknown line)
[2026/2/5 09:25:20]assert at C:\Windows\System32\msvcrt.dll (unknown line)
[2026/2/5 09:25:20]fs__sendfile at /workspace/srcdir/libuv\src/win\fs.c:2118
[2026/2/5 09:25:20]uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3209
[2026/2/5 09:25:20]uv_fs_sendfile at /workspace/srcdir/libuv\src/win\fs.c:3739
[2026/2/5 09:25:20]jl_fs_sendfile at C:/Users/vagrant/builds/julialang/julia/src\jl_uv.c:364
[2026/2/5 09:25:20]sendfile at .\filesystem.jl:151
[2026/2/5 09:25:20]sendfile at .\file.jl:998
[2026/2/5 09:25:20]#cptree#12 at .\file.jl:351
[2026/2/5 09:25:20]cptree at .\file.jl:338
[2026/2/5 09:25:20]#cptree#12 at .\file.jl:348
[2026/2/5 09:25:20]cptree at .\file.jl:338
[2026/2/5 09:25:20]#cptree#12 at .\file.jl:348
[2026/2/5 09:25:20]cptree at .\file.jl:338
[2026/2/5 09:25:20]#cptree#12 at .\file.jl:348
[2026/2/5 09:25:20]cptree at .\file.jl:338
[2026/2/5 09:25:20]#cptree#12 at .\file.jl:348
[2026/2/5 09:25:20]cptree at .\file.jl:338
[2026/2/5 09:25:20]#cptree#12 at .\file.jl:348
[2026/2/5 09:25:20]cptree at .\file.jl:338 [inlined]
[2026/2/5 09:25:20]#cp#14 at .\file.jl:382
[2026/2/5 09:25:20]cp at .\file.jl:376 [inlined]
....

I dig into the source code of libuv and found uv could abort when ReadFile or WriteFile failed.

https://github.com/JuliaLang/libuv/blob/b21d6d84e46f6c97ecbc8e4e8a8ea6ad98049ea8/src/win/fs.c#L2104C12-L2104C22

It is always a unrecoverable scenario? could I just report a error with GetLastError?

System: Windows10
Julia version: 1.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIndicates similar issues or pull requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions