Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8308764

Reporting errors from create_vm may crash

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • 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.

            dholmes David Holmes
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: