Cannot use Java #746

Closed
tady159 opened this Issue Aug 3, 2016 · 19 comments

Comments

Projects
None yet
@tady159

tady159 commented Aug 3, 2016

  • A brief description: I cannot run nor compile Java applications using Linux Subsystem.
  • Expected results: I'd expect Java applications to run, or at least to compile with javac.
  • Actual results: No output for an extended amount of time (ranging from a couple minutes to hourse), and then a fatal error message.
  • Your Windows build number: 14393 (Anniversary Update)
  • Steps / commands required to reproduce the error:
  • Install openjdk-7 (jdk, jre, jre-headless);
  • Create a hello world class and compile with javac;
  • Run java -jar with a pre-compiled jar application.
  • Strace of the failing command:
    A fatal error has been detected by the Java Runtime Environment:

Internal Error (safepoint.cpp:325), pid=6312, tid=140008804779776
guarantee(PageArmed == 0) failed: invariant

JRE version: OpenJDK Runtime Environment (7.0_101) (build 1.7.0_101-b00)
Java VM: OpenJDK 64-bit Server VM (24.95-b01 mixed mode linuxe-ambd64 compressed oops)
Derivative: IcedTea 2.6.6
Distribution: Ubuntu 14.04 LTS, package 7u101-2.6.6-0ubuntu0.14.04.1

I'm also attaching the error report filed generated.
hs_err_pid6312.log.txt

@aseering

This comment has been minimized.

Show comment
Hide comment
@aseering

aseering Aug 3, 2016

Contributor

Thanks @tady159 for reporting this! Your report sounds very similar to #566 . Also probably related to #541 . Could you take a look to see if either of those tickets match your concerns? If so, there's a bunch of discussion on both of them already; it would probably be best to have all comments from affected people in the same place.

Contributor

aseering commented Aug 3, 2016

Thanks @tady159 for reporting this! Your report sounds very similar to #566 . Also probably related to #541 . Could you take a look to see if either of those tickets match your concerns? If so, there's a bunch of discussion on both of them already; it would probably be best to have all comments from affected people in the same place.

@tady159

This comment has been minimized.

Show comment
Hide comment
@tady159

tady159 Aug 3, 2016

@aseering I apologize for the duplicate. I did try searching for Java related issues before posting, but I didn't get to those threads, which do match my current issue.

tady159 commented Aug 3, 2016

@aseering I apologize for the duplicate. I did try searching for Java related issues before posting, but I didn't get to those threads, which do match my current issue.

@dethoma

This comment has been minimized.

Show comment
Hide comment
@dethoma

dethoma Aug 4, 2016

Java not working is something we could not address in time for the anniversary edition. We have fixed this in internal builds and they should be rolling out soon in a future insider release.

dethoma commented Aug 4, 2016

Java not working is something we could not address in time for the anniversary edition. We have fixed this in internal builds and they should be rolling out soon in a future insider release.

@dethoma dethoma added the fixinbound label Aug 4, 2016

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Aug 4, 2016

Collaborator

Can you share what was wrong? I debugged a JRE build under gdb for a few hours in June but couldn't pin down any failing syscall or come up with a tight test case that would hang. That is, my test cases frustratingly kept succeeding, and apps that did hang were too big and thready to pin down.

Collaborator

therealkenc commented Aug 4, 2016

Can you share what was wrong? I debugged a JRE build under gdb for a few hours in June but couldn't pin down any failing syscall or come up with a tight test case that would hang. That is, my test cases frustratingly kept succeeding, and apps that did hang were too big and thready to pin down.

@tady159

This comment has been minimized.

Show comment
Hide comment
@tady159

tady159 Aug 4, 2016

@therealkenc By attaching strace to some of the Java processes I got by running javac on a hello world class, I got the following info, all of them running in endless loops:

--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0x8} ---
gettimeofday({1470321308, 372438}, NULL) = 0

sched_yield() = 0

futex(0x7f4b640b9b28, FUTEX_WAKE_PRIVATE, 1) = 0
clock_gettime(CLOCK_MONOTONIC, {503, 579831000}) = 0
gettimeofday({1470321415, 250702}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {503, 580186000}) = 0
clock_gettime(CLOCK_MONOTONIC, {503, 580354000}) = 0
futex(0x7f4b640b9b54, FUTEX_WAIT_BITSET_PRIVATE, 1, {503, 630354000}, ffffffff) = -1 ETIMEDOUT (Connection timed out)

tady159 commented Aug 4, 2016

@therealkenc By attaching strace to some of the Java processes I got by running javac on a hello world class, I got the following info, all of them running in endless loops:

--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0x8} ---
gettimeofday({1470321308, 372438}, NULL) = 0

sched_yield() = 0

futex(0x7f4b640b9b28, FUTEX_WAKE_PRIVATE, 1) = 0
clock_gettime(CLOCK_MONOTONIC, {503, 579831000}) = 0
gettimeofday({1470321415, 250702}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {503, 580186000}) = 0
clock_gettime(CLOCK_MONOTONIC, {503, 580354000}) = 0
futex(0x7f4b640b9b54, FUTEX_WAIT_BITSET_PRIVATE, 1, {503, 630354000}, ffffffff) = -1 ETIMEDOUT (Connection timed out)

@dethoma

This comment has been minimized.

Show comment
Hide comment
@dethoma

dethoma Aug 4, 2016

Linux allows signal handlers to modify register values in the context structure passed to signal handlers and these modified values are used when restoring the context in sigreturn. The change we did addressed a bug in our implementation. This is used by Java's signal handler to translate exception signals into Java exceptions.

dethoma commented Aug 4, 2016

Linux allows signal handlers to modify register values in the context structure passed to signal handlers and these modified values are used when restoring the context in sigreturn. The change we did addressed a bug in our implementation. This is used by Java's signal handler to translate exception signals into Java exceptions.

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Aug 5, 2016

Collaborator

@tady159 - yeah of course, watching javac die was no problem. But javac hello.java is huge and launches like 9 threads. I just couldn't get a test with a couple of threads and Java Mutex or Semaphore to fail, and since my Java is rusty these days I gave up pretty quickly.

@dethoma - thanks! I had a suspicion it was signally (SIGINT doesn't work on hang). I am sure this will fix some stability elsewhere too. I was worried it was going to be one of those heisenbugs that wouldn't die, or at the very least not get a lot of engineering attention because there is plenty of other low-hanging-fruit to work on. Very appreciated by everyone, and not just the Eclipse/Gradle/Hg4J people. A lot of js folks run their stuff through Closure. +1 for the understated "fixed now" post BTW.

Collaborator

therealkenc commented Aug 5, 2016

@tady159 - yeah of course, watching javac die was no problem. But javac hello.java is huge and launches like 9 threads. I just couldn't get a test with a couple of threads and Java Mutex or Semaphore to fail, and since my Java is rusty these days I gave up pretty quickly.

@dethoma - thanks! I had a suspicion it was signally (SIGINT doesn't work on hang). I am sure this will fix some stability elsewhere too. I was worried it was going to be one of those heisenbugs that wouldn't die, or at the very least not get a lot of engineering attention because there is plenty of other low-hanging-fruit to work on. Very appreciated by everyone, and not just the Eclipse/Gradle/Hg4J people. A lot of js folks run their stuff through Closure. +1 for the understated "fixed now" post BTW.

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Aug 5, 2016

Collaborator

Gotta wonder why javac is throwing a Java exception when nothing exceptional is happening though. Don't answer that...

Collaborator

therealkenc commented Aug 5, 2016

Gotta wonder why javac is throwing a Java exception when nothing exceptional is happening though. Don't answer that...

@hros

This comment has been minimized.

Show comment
Hide comment
@hros

hros Aug 6, 2016

naturally, I couldn't get oracle jdk to run as well
Does your fix of the bug enable running the oracle JDK?
when can we expect the bug fix?
Is it possible to move to the "fast ring" only for the linux subsystem? (I don't wont to undermine the stability of my windows)
thanks
and kudos for a wonderful product

hros commented Aug 6, 2016

naturally, I couldn't get oracle jdk to run as well
Does your fix of the bug enable running the oracle JDK?
when can we expect the bug fix?
Is it possible to move to the "fast ring" only for the linux subsystem? (I don't wont to undermine the stability of my windows)
thanks
and kudos for a wonderful product

@imkow

This comment has been minimized.

Show comment
Hide comment
@imkow

imkow Aug 13, 2016

anybody tried Java/JDK 8 on build 14901? Is it OK?

imkow commented Aug 13, 2016

anybody tried Java/JDK 8 on build 14901? Is it OK?

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Aug 14, 2016

Collaborator

14901 just came down on my machine. I think you can declare victory and go home. Pretty awesome. 🙌

eclipse

Collaborator

therealkenc commented Aug 14, 2016

14901 just came down on my machine. I think you can declare victory and go home. Pretty awesome. 🙌

eclipse

@marcogroppo

This comment has been minimized.

Show comment
Hide comment
@marcogroppo

marcogroppo Aug 14, 2016

Awesome! However... do I really need to install an Insider Preview just to get these bug fixes? Is there any other way?

Awesome! However... do I really need to install an Insider Preview just to get these bug fixes? Is there any other way?

@ashic

This comment has been minimized.

Show comment
Hide comment
@ashic

ashic Aug 14, 2016

Fast ring 14901 came through last night. Glad to say installation of Oracle JDK 8 from ppa, scala, and sbt worked. sbt compile, run, etc. works. I also symlinked .ivy2/cache to the one on windows. That worked too. This is most excellent :)

ashic commented Aug 14, 2016

Fast ring 14901 came through last night. Glad to say installation of Oracle JDK 8 from ppa, scala, and sbt worked. sbt compile, run, etc. works. I also symlinked .ivy2/cache to the one on windows. That worked too. This is most excellent :)

@benhillis

This comment has been minimized.

Show comment
Hide comment
@benhillis

benhillis Aug 14, 2016

Member

Glad things are working for you! As I mentioned in the other thread I'm trying to get this fix pulled into Anniversary Update.

Member

benhillis commented Aug 14, 2016

Glad things are working for you! As I mentioned in the other thread I'm trying to get this fix pulled into Anniversary Update.

@MattBDev

This comment has been minimized.

Show comment
Hide comment
@MattBDev

MattBDev Aug 16, 2016

@benhillis is there anything that we (the users) can do (like draw attention) to get this fix back-ported in an upcoming cumulative update?

@benhillis is there anything that we (the users) can do (like draw attention) to get this fix back-ported in an upcoming cumulative update?

@benhillis

This comment has been minimized.

Show comment
Hide comment
@benhillis

benhillis Aug 19, 2016

Member

@MattBDev You've already helped draw attention. When justifying the servicing request we pointed to this thread and others on GitHub as evidence of the value of this fix.

@SRGOM If the servicing folks decide to take this fix we will certainly let our users know. If you're waiting on inotify one of our developers is wrapping that up right now and that should be available on an Insider build fairly soon.

Member

benhillis commented Aug 19, 2016

@MattBDev You've already helped draw attention. When justifying the servicing request we pointed to this thread and others on GitHub as evidence of the value of this fix.

@SRGOM If the servicing folks decide to take this fix we will certainly let our users know. If you're waiting on inotify one of our developers is wrapping that up right now and that should be available on an Insider build fairly soon.

@shuxin

This comment has been minimized.

Show comment
Hide comment
@shuxin

shuxin Aug 20, 2016

me too.
I think this bug may like that one https://bugzilla.kernel.org/show_bug.cgi?id=32922

shuxin commented Aug 20, 2016

me too.
I think this bug may like that one https://bugzilla.kernel.org/show_bug.cgi?id=32922

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Aug 27, 2016

Collaborator

@SRGOM I would be 100% happy to share, but it wouldn't work. Your NT kernel will reject it. Unfortunately it isn't like me sharing a third party (say NVIDIA) driver with you. It wasn't until I read these slides that understood the disconnect. I could share my whole Windows\system32 directory of course, but then you can get that from the fast ring. Hence the dilemma. If it were possible to distribute lxcore/lxss in isolation, Ben would have done that already, just like the VS Code guys push out releases nightly.

Collaborator

therealkenc commented Aug 27, 2016

@SRGOM I would be 100% happy to share, but it wouldn't work. Your NT kernel will reject it. Unfortunately it isn't like me sharing a third party (say NVIDIA) driver with you. It wasn't until I read these slides that understood the disconnect. I could share my whole Windows\system32 directory of course, but then you can get that from the fast ring. Hence the dilemma. If it were possible to distribute lxcore/lxss in isolation, Ben would have done that already, just like the VS Code guys push out releases nightly.

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Aug 31, 2016

Collaborator

Cool hack, but sorry my knowledge of how MS signs core drivers ends here. If I had to guess (pulling the guess completely out of my ass) the core drivers are signed with a key specific to the build - the certs being what they are as a separate matter. We're way off topic for a Java fixinbound, but in another thread on another day I'd like to hear why the meat of WSL can't be done as a Third Party driver decoupled from Windows releases. I know the pico process can't be done that way (by fiat), but much (most?) of WSL's functionality is going to look exactly like Cygwin under the hood and there isn't any technical reason I can see why the pico process can't call out to do that work.

Collaborator

therealkenc commented Aug 31, 2016

Cool hack, but sorry my knowledge of how MS signs core drivers ends here. If I had to guess (pulling the guess completely out of my ass) the core drivers are signed with a key specific to the build - the certs being what they are as a separate matter. We're way off topic for a Java fixinbound, but in another thread on another day I'd like to hear why the meat of WSL can't be done as a Third Party driver decoupled from Windows releases. I know the pico process can't be done that way (by fiat), but much (most?) of WSL's functionality is going to look exactly like Cygwin under the hood and there isn't any technical reason I can see why the pico process can't call out to do that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment