i extended Cairo in one place and now tests only on winows are failing with
Got an exception of type Base.UVError outside of a @test
unlink: resource busy or locked (EBUSY)
in uv_error at .\libuv.jl:68 [inlined]
in unlink(::String) at .\file.jl:382
in #rm#7(::Bool, ::Bool, ::Function, ::String) at .\file.jl:107
in macro expansion; at C:\Users\appveyor\.julia\v0.5\Cairo\test\runtests.jl:197 [inlined]
in macro expansion; at .\test.jl:674 [inlined]
in anonymous at .\<missing>:?
in include_from_node1(::String) at .\loading.jl:488
in process_options(::Base.JLOptions) at .\client.jl:265
in _start() at .\client.jl:321
Could you please clarify. You mean: open file, close file, rm file in sequence without writing to file? Is this special on UV windows?
For the longer story see https://github.com/JuliaGraphics/Cairo.jl/pull/183/files where i use the same tests on scripting surfaces like previously on other surfaces that create a file.
I mean close the file before doing anything else (i.e. not through the opened file handle) on the file. This includes removing the file. This is unrelated to libuv but is windows specific.
It’s an windows issue so you should expect to find the document in windows documentation.
It applies to all files including but no limited to, ccall(:open), any libraries that open files, mmap, open, etc and in this case it’s likely that cairo is doing it.
I somehow understand the situation. Still, the same sequence of actions is/was already tested successfully and now the ‘new’ test is failing. Could it be libuv can manage only a limited set of ‘unclosed’ files/stream and start complaining at N+1? My goal was to isolate the error and it seems like i’m seeing side-effects of previous access?
I still don’t understand what are you confused by. A few guesses.
You are seeing a windows specific issue so it won’t appear anywhere else.
The issue is related to files so it won’t appear for any other file-like objects including IOBuffer()
The error happens only if someone kept a file handle open, it is likely in libcairo and the issue might appear or not depending on what you are doing with it.
The error happens if GC didn’t do the cleanup on some object. Moving the code can very easily affect this.