-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
SystemCallError: Unknown error - mkdir failed #4402
Comments
I patched fileutils.rb. Instead of creating the following folders
It only creates
|
This is an interesting case. I assume it doesn't fail if you have no security manager installed? Your patch to skip already-existing dirs seems simple enough. I'll try it and run some tests here to see what impact it has. Normally we don't patch the stdlib, since it is intended to match CRuby. In this case, if the patch makes sense and doesn't hurt CRuby, I'll just commit there too. |
The patch does not appear to impact tests at all, so it seems good. I'd like our friend @nobu to weigh in (along with anyone else from ruby-core that might be interested). |
I'm curious what "Unknown error" is, and why it isn't rescued. |
@nobu I guess the race would be if some other thread is doing a mkdir at the same time? But wouldn't the outcome simply be that one thread creates the directory and another fails to create it but succeeds in the iteration? I guess there's also an issue if one thread wants to use different permissions...the second thread would fail to create the dir, then see it's there, and proceed as if the modes were fine. @frankwong15 Perhaps it's fine to just let it fail and omit the second part of the patch, as @nobu suggests? |
It is fine for me. First part of the patch is enough for my use case. |
Environment
jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.111-b14 on 1.8.0_111-b14 +jit [linux-x86_64]
Linux frank-nb 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Sample code below:
https://gist.github.com/frankwong15/24b36c82be497fbd8b7d61598efcb16e
Expected Behavior
JRuby has access to /tmp according to security policy and it should be able to create folder under /tmp.
Actual Behavior
JRuby raises SystemCallError because it tries to create folder / which it has no access.
The text was updated successfully, but these errors were encountered: