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

Windows race remapping memory read-write for CDS and redefine classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • OS:
      windows

      Description

      From David Holmes:

      Re: "Maybe the logic for "remapping the RO section to read-write" is faulty on Windows and in rare occasions would unmap the RO section"

      That rings a bell:

      // Remap a block of memory.
      char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
                             char *addr, size_t bytes, bool read_only,
                             bool allow_exec) {
        // This OS does not allow existing memory maps to be remapped so we
        // have to unmap the memory before we remap it.
        if (!os::unmap_memory(addr, bytes)) {
          return NULL;
        }

        // There is a very small theoretical window between the unmap_memory()
        // call above and the map_memory() call below where a thread in native
        // code may be able to access an address that is no longer mapped.

        return os::map_memory(fd, file_name, file_offset, addr, bytes,
                 read_only, allow_exec);
      }

      What happens to the memory contents between the unmap and map?

      Change below to use VirtualProtect got GetLastError = 75

      http://cr.openjdk.java.net/~coleenp/8087153.01/

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: