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

SA core file support on OSX has some bugs trying to locate the jvm libraries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b11

      Description

      I tried to attach to a core file that was generated while running the jhsdb command (yes, using SA to debug SA). SA crashed when I did this, and after fixing the crash, it was still unable to attach.

      The issue is with ps_core.c::get_real_path(), which tries to find the path to the java libs. It starts by searching for bin/java in the path to the executable (execpath), and uses that to find the path to the java libraries. However, that doesn't work if the execpath ends in bin/jhsdb, or any other java launcher in the bin directory. It then checks JAVA_HOME. If that is null, it then falls into the following code:

            char* dyldpath = getenv("DYLD_LIBRARY_PATH");
            char* save_ptr;
            char* dypath = strtok_r(dyldpath, ":", &save_ptr);

      This gets a SEGV if DYLD_LIBRARY_PATH is null (the crash I mentioned above), so one fix needed is to add the null check. If the DYLD_LIBRARY_PATH check fails, then it gives up, so another change I made that helped with the jhsdb case was as a last resort to have it just search for bin/ instead of bin/java.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: