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

Unsafe publication of java.util.Properties.map

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9, 10, 11
    • Fix Version/s: 11
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b19
    • Verification:
      Not verified

      Backports

        Description

        JDK-8029891 refactored java.util.Properties to use a transient ConcurrentHashMap that is read from without synchronization. However, I think this implementation opens up the possibility of the map being observed as null in certain methods (such as get) when called from other threads.

        One way to fix this would be by making the map field final (which would necessitate using something like Unsafe.putObjectVolatile to set the field during deserialization).

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  redestad Claes Redestad
                  Reporter:
                  redestad Claes Redestad
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: