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

Please export JLI_MemAlloc from libjvm and document Apple dependency

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • tools
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      I just had to debug a very nasty problem whilst faced with an unhappy customer on launch day; it would be good if Java could be changed so this issue doesn't bite other people.

      On macOS AWT will try to load JavaVM.framework. On modern macOS versions this framework is defunct and the sub-frameworks like JavaRuntimeSupport.framework are gone, so nothing happens. On old versions of macOS like Catalina - which is still in widespread use apparently - this framework will end up loading JavaLaunching.framework which attempts to figure out if a JVM is currently loaded into the process. If it concludes there isn't one then it pops up an error message telling the user to download Java 6 and exits the process.

      Here's the problem: Apple's code decides if a JVM is loaded in the process by searching the symbol table for the symbol JLI_MemAlloc. Why? No clue. Whoever wrote that code made two bad assumptions:

      1. That this symbol is a core part of the JVM and will always be available if the JVM itself is, but it's perfectly normal to load libjvm via JNI without using libjli.

      2. That this symbol will always be there, but it's an implementation detail and not a part of the guaranteed API.

      Not much can be done now, but it'd have sped up debugging if:

      1. This symbol had a nice big comment explaining that this is how old macOS decides if Java is loaded, so it shouldn't be renamed/deleted.

      2. This symbol was exported from libjava or libjvm or libawt or some other library that is sure to be loaded before JavaVM.framework.

      Alternatively if all remaining dependencies on JavaRuntimeSupport could be removed that'd also help.


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: