-
Notifications
You must be signed in to change notification settings - Fork 823
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
Java/gradle project throws java.net.SocketException #851
Comments
The strace above doesn't appear to have the failing setsockopt system call. It's likely happening from a different thread than the main thread. Would you be able to rerun your strace with these options? strace -ff -o trace ./gradlew --stacktrace Thanks! |
|
@pboos - Thanks for the trace and the feedback. We have opened a task on our end to track the unimplemented socket option and we will look into it. |
@sunilmut Any update on this? Anxiously chomping at the bit for full Java support over here :-) |
@mphaney - Apologize for the delay. IPV6 socket option 0x31 is |
@sunilmut No troubles :-) Thank you very much for the feedback and the EXTREMELY hard work! I sincerely look forward to dispensing with Cygwin and using pure Bash for my development. |
After I disabled IPv6 by specifying
|
Starting build 14936, IPV6_V6ONLY should be fully supported. So, hopefully, no workaround is needed anymore for that. |
@sunilmut On 14936 I am not seeing the setsockopt issue, but instead having issues when gradle tries to clone a child process. The following sections of the attached strace.txt may be relevant. Update: Still occuring on 14951 clone(child_stack=0x7f4453dcfff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f4453dd09d0, tls=0x7f4453dd0700, child_tidptr=0x7f4453dd09d0) = 944 Caused by: java.io.IOException: error=12, Cannot allocate memory |
@therealkenc I have no prior experience with strace, I think this is what you were after? Let me know if I can be of any further assistance. strace -ff gist |
Appreciate the follow-up. Here's the failure in question from your previous post's trace. Strangely that pattern isn't present in your second link, but if you're still getting "Cannot allocate memory" looking errors this is where it is coming from. I was just curious whether it was something seen before.
|
@therealkenc I have created a simple java class to demonstrate this behaviour. Also it affects both the oracle and openjdk java runtimes. |
Your little class ran fine for me here when compiled with |
Using the class I posted I get |
No error here. Technically my gist was this, because you weren't importing IOException in yours. This is on 14951/14955 and jdk8 1.8.0_91. Note that the
You don't need to follow everything that is going on in the strace; just click through your link and search on the string "memory" or "allocate". The other one you posted has a failure on the vfork if you search for "allocate". It's huge so give it time to load. This is what I am seeing. Those process detached entries are all the
|
Spitballing... one thing you might try is upping your NT page size as mentioned in #597. I have a lot of virtual memory so there's an outside chance I'm not hitting what you're hitting. I am seeing the Also it still isn't clear that you are getting a threaded strace (ie -ff). Note the [pid NNNNN] below, which you should see also if you get that far.
|
I have set my swap file to 5000MB, which should be sufficient to rule that out? I am still seeing the vfork error. Any point in my doing a clean re-install of WSL?
|
Great! Like the auto mechanic said, "there's your problem". Try making the NT page size something ridiculous like 16 or 32GB, if you've got the disk space. You can set it back after of course. Good catch even if it doesn't work. Probably should spawn a new issue# since we're way off the Gradle setsockopt reservation here. [edit] Clean install never hurts but seems doubtful since you've already tried both Oracle and OpenJDK and I'd expect that would have eliminated installation variables. But who knows. |
Well it works successfully at 16GB - I never would have guessed! Thanks so much for your help in debugging the issue, I have raised a new issue at #1286 |
@chesterm8 Could you explain how did you make it work? What commands did you run? What switches did you move? Thanks a lot |
I've made a variety of changes to this area which will be coming to Insider builds soon.
The end result is these types of errors should go away - and if they don't you can enable overcommit. |
Curious, what's the semantics when you set |
There are three settings: |
Very cool 🙌. I guess Real Linux also has |
@benhillis Nice work. |
Running our gradle project throws a java.net.SocketException which runs nicely on normal linux machines and as well mac os x.
Run through nicely and do the build.
14393.10
java 1.8 sdk from oracle, gradlew project (with gradle 2.1)
PS: Just as a side note. I really am looking forward to Subsystem for Linux running well. I think microsoft is doing something really great here! I know it is a lot of work and still a long road to the final goal. I hope you can really make it happen!
The text was updated successfully, but these errors were encountered: