Skip to content

Cannot use Java #746

Closed
Closed

Description

@tady159
  • 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

Activity

  1. aseering commented on Aug 3, 2016

    @aseering
    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.

  2. tady159 commented on Aug 3, 2016

    @tady159
    Author

    Adam Seering (@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.

  3. dethoma commented on Aug 4, 2016

    @dethoma

    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.

  4. therealkenc commented on Aug 4, 2016

    @therealkenc

    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.

  5. tady159 commented on Aug 4, 2016

    @tady159
    Author

    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)

  6. dethoma commented on Aug 4, 2016

    @dethoma

    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.

  7. therealkenc commented on Aug 5, 2016

    @therealkenc

    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.

    Deepu Thomas (@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.

  8. therealkenc commented on Aug 5, 2016

    @therealkenc

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

  9. hros commented on Aug 6, 2016

    @hros

    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

  10. imkow commented on Aug 13, 2016

    @imkow

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

  11. therealkenc commented on Aug 14, 2016

    @therealkenc

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

    eclipse

  12. marcogroppo commented on Aug 14, 2016

    @marcogroppo

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

  13. ashic commented on Aug 14, 2016

    @ashic

    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 :)

  14. benhillis commented on Aug 14, 2016

    @benhillis
    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.

  15. MattBDev commented on Aug 16, 2016

    @MattBDev

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

  16. benhillis commented on Aug 19, 2016

    @benhillis
    Member

    Matt (@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.

    S (@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.

  17. therealkenc commented on Aug 27, 2016

    @therealkenc

    S (@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.

  18. therealkenc commented on Aug 31, 2016

    @therealkenc

    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.

  19. stevensgeek41 commented on Oct 21, 2020

    @stevensgeek41

    Hi, is java multithreading supported? I tried use the Thread class to create a number of threads to do some experiment on concurrency bugs, but it seems there is only one thread be created.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions