Reporting errors from create_vm may crash

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: 21
    • Component/s: hotspot
    • b26

      JNI_CreateJavaVM_inner calls create_vm and examines the result. If it indicates an error (not JNI_OK) then it checks for a pending exception and reports that. That check requires the current thread. However, in some cases create_vm deletes the main thread before returning an error code. As a result, the attempt to get and use current thread will crash (either an assert or a null pointer access).

      This crash can be reproduced fairly easily by patching create_vm's handling of the result of init_globals(), using -XX:+UseNewCode to force an error return. I tripped over it while testing a fix for JDK-8240774.

            Assignee:
            David Holmes
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: