Uploaded image for project: 'core.cache'
  1. CCACHE-28

SoftCache NullPointerException in has? with many threads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Labels:
      None
    • Environment:

      Linux, Oracle JRE 1.6

    • Patch:
      Code

      Description

      "cell" can be null on this call to SoftReference.get():
      https://github.com/clojure/core.cache/blob/master/src/main/clojure/clojure/core/cache.clj#L501

      If the cache did not contain "item" in the call to (get cache item) in the let binding, but another thread pre-empts and adds it before the subsequent call to contains?, we'll attempt to call .get() on nil.

      Would it perhaps be sufficient to just check whether cell is nil instead of calling contains? in the check on the previous line?

        Attachments

          Activity

            People

            • Assignee:
              fogus Fogus
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: