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

Incorrect use of os::lasterror in ClassListParser

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic
    • OS:
      generic

      Description

        _file = fopen(file, "r");
        _line_no = 0;
        _interfaces = new (ResourceObj::C_HEAP, mtClass) GrowableArray<int>(10, true);

        if (_file == NULL) {
          char errmsg[JVM_MAXPATHLEN];
          os::lasterror(errmsg, JVM_MAXPATHLEN);
          vm_exit_during_initialization("Loading classlist failed", errmsg);
        }

      'errno' from the fopen may have been overwritten inside the allocation logic (particularly if logging is enabled) by the time we call os::lasterror.

        Attachments

          Activity

            People

            Assignee:
            pchilanomate Patricio Chilano Mateo
            Reporter:
            pchilanomate Patricio Chilano Mateo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: