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

(se) EPollArrayWrapper optimization for update events should be robust to dynamic changes in file descriptor resource limits

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b145
    • OS:
      linux
    • Verification:
      Not verified

      Description

      sun.nio.ch.EPollArrayWrapper uses an optimization to store events for file descriptors smaller than a certain threshold in an array and those greater than or equal to that threshold in a HashMap. The threshold is determined statically for the class and is by default based on the resource limit on the file descriptor number. It is conceivable however that this resource limit could change between when the static values are initialized and either the class is instantiated (and HashMap initialized or not) or when the pending update events are set or queried for a given file descriptor. If the resource limit on file descriptor number increases to a value greater than the event array size then an attempt could be made to dereference the uninitialized HashMap resulting in a NullPointerException. It is suspected but not verified that this is what happened to cause JDK-8165823. In any case, EPollArrayWrapper should be robust to a dynamically changed file descriptor resource limit.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              bpb Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: