JDK-8232973 : Potential infinite loop in macOS hotspot agent
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 8u232,11,14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2019-10-24
  • Updated: 2020-08-07
  • Resolved: 2019-11-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 14
14 b22Fixed
Related Reports
Relates :  
Relates :  
Description
Unfortunately I couldn't find a way to trigger this code, but a simple inspection reveals that if it ever got called it could not complete:

{
      char* dyldpath = getenv("DYLD_LIBRARY_PATH");
      char* dypath = strtok(dyldpath, ":");
      while (dypath != NULL) {
        strcpy(filepath, dypath);
        strcat(filepath, filename);
        if (exists(filepath)) {
           strcpy(rpath, filepath);
           return true;
        }
        dypath = strtok(dyldpath, ":");
      }

This code has been in since support for macOS core files was introduced, and survived this long so it's unlikely it was ever executed.


Comments
I was experimenting with this code, and found it also has this issue of crashing in the first strtok() call due to a NULL pointer if DYLD_LIBRARY_PATH is not set. This is true even after the fix for this bug. If fixed this an numerous other issue with code in this function in JDK-8248879.
07-08-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/44d60fc2dd8a User: sgehwolf Date: 2019-11-04 13:03:24 +0000
04-11-2019