Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows test failures in file.jl: "stat: operation not permitted (EPERM)" #6144

Merged
merged 1 commit into from
Jun 30, 2014

Conversation

tkelman
Copy link
Contributor

@tkelman tkelman commented Mar 13, 2014

This has been seen before by @magistere here. There may still be file handles open so the unlinked file and removed directory cannot be stat-ed. Very similar problem occurs in node: nodejs/node-v0.x-archive#7164. I tried to clean up as much as I could figure out:

ccall(:fclose, Void, (Ptr{Void},), FILEp.ptr)
ccall(:_close, Void, (Ptr{Void},), FILEp.ptr)
FILEp = nothing
a_stat = nothing
af = nothing
b_stat = nothing
buf = nothing
emptyf = nothing
f = nothing
s = nothing
gc()
gc()

but could not get consistent success here. Any suggestions about what might still be open and how to absolutely close it before calling ispath on the deleted file and directory? Skipping the test is a workaround, not a real solution.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Mar 14, 2014

@JeffBezanson libuv uses a number of flags to CreateFile to mitigate this. would you mind copying over their work to ios?

@JeffBezanson
Copy link
Sponsor Member

No problem; can you point me in the right direction?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Mar 14, 2014

somewhere in libuv/src/win/file.c. I haven't looked in a few months for the exact location

@tkelman
Copy link
Contributor Author

tkelman commented May 1, 2014

Recently looked into the temporary folder that's getting used here, and found these tests are leaving around a lot of julia# temp files. Deletion of these temp files apparently isn't happening properly.

@vtjnash
Copy link
Sponsor Member

vtjnash commented May 1, 2014

no, we don't make any effort to delete those, and neither does windows

@tkelman
Copy link
Contributor Author

tkelman commented May 1, 2014

Huh? Isn't rm(file) an effort to delete? Looking into it the temp files are actually coming from the spawn tests, not file, so I misspoke there.

@vtjnash
Copy link
Sponsor Member

vtjnash commented May 1, 2014

Oh, I guess we do make some effort then. It sounds like we are just inconsistent then.

@Keno
Copy link
Member

Keno commented Jun 11, 2014

@quinnj You had started to look into this. Any progress? Otherwise I'll take a look.

@quinnj
Copy link
Member

quinnj commented Jun 11, 2014

No, I wasn't sure where to find libuv's CreateFile flags.

@Keno
Copy link
Member

Keno commented Jun 11, 2014

Ok.

@Keno
Copy link
Member

Keno commented Jun 11, 2014

I did the libuv thing, but it didn't actually help. I'm also not sure we have any open references around (which was the original issue). Interestingly this also doesn't fail for me at the REPL.

@Keno
Copy link
Member

Keno commented Jun 11, 2014

Ok, I straced this and it looks like that stat is failing with DELETE_PENDING, which is hardly surprising.

@Keno
Copy link
Member

Keno commented Jun 11, 2014

Anyway, turns out you can't detect DELETE_PENDING from user mode, so unless somebody wants to write a julia_delete kernel module, I say we just merge this pull request and live with it.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 11, 2014

Bummer, thanks for looking into it. Hopefully this won't be a pattern that comes up too frequently in packages or other user code that would lead to Windows-only breakage.

These are failing with "stat: operation not permitted (EPERM)". There may still be
file handles open so the unlinked file and removed directory cannot be stat-ed.
@tkelman
Copy link
Contributor Author

tkelman commented Jun 20, 2014

Rebased.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 30, 2014

@Keno ok to merge? Lgtm

Keno added a commit that referenced this pull request Jun 30, 2014
Windows test failures in file.jl: "stat: operation not permitted (EPERM)"
@Keno Keno merged commit 903b701 into JuliaLang:master Jun 30, 2014
@tkelman tkelman deleted the patch-2 branch June 30, 2014 17:54
@tkelman
Copy link
Contributor Author

tkelman commented Jun 30, 2014

Thanks guys, another Windows test failure down. Underlying problem's still there, but apparently nothing we can do about it and I doubt it's all that consequential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants