Fork me on GitHub
#graalvm
<
2019-06-21
>
ghadi22:06:22

Hi everyone, I made a patch for that "unbalanced monitors" issue that works a tiny bit differently than the existing one. When I build clojure with that patch, and use a non-AOT'ed clojure.spec.alpha, the binary compiles successfully. When I run the binary, it fails on "cannot find clojure.core.server__init" https://clojure.atlassian.net/projects/CLJ/issues/CLJ-1472?filter=allopenissues I pasted the patch in there ^ along with what I'm calling native image with. Any assistance would be helpful

ghadi22:06:19

I suspect that the new RT.init() differences in 1.10.1 vs what's in 1.10.0 are the difference, but haven't tested

ghadi22:06:18

before:

(defmacro locking
   [x & body]
   `(let [lockee# ~x]
     (try
      (monitor-enter lockee#)
       ~@body
       (finally
        (monitor-exit lockee#)))))
after:
(defmacro locking
   [x & body]
   `(let [lockee# ~x]
     (monitor-enter lockee#)
     (^:reentrant-finally try
       ~@body
       (finally
        (monitor-exit lockee#)))))
 
I ended up teaching the compiler how to emit try with a special flag on it differently ^:reentrant-finally

ghadi22:06:01

this makes the bytecode exactly the same as javac's