Closed ericdallo closed 3 years ago
@ericdallo I think you should keep respecting the locking?
boolean unless @ptaoussanis thinks otherwise.
Done @borkdude, not sure the code is good though
@ericdallo LGTM
@ptaoussanis this seems to fix my issue here: https://github.com/clojure-lsp/clojure-lsp/pull/267 :)
Hey, @ptaoussanis could you review/merge this, please?
Should now be fixed on master, pushing release shortly - thanks!
Hey @ptaoussanis I tested and it seems your fix on master doesn't work :/ Here is the stack trace: https://pastebin.com/21BByhhX
Any reason why not use clojure locking
macro (used in this PR) instead of manually using monitor-enter/exit ?
I think the verifier might have trouble analyzing this since there is a condition involved. Just using the locking
macro should solve this as in @ericdallo's PR.
Apologies! The proposed fix unfortunately breaks the intended locking behaviour (the object to lock against needs to be shared), and I was under the impression from Clojure CLJ-1472 that pulling the lock into a local let would be sufficient + a smaller change.
Would like to understand a little better what the cause of the Graal problem is exactly. Could someone show me what I'd need to do to reproduce the verification error locally? (Have zero experience with Graal).
Thanks!
@ptaoussanis
I think just replacing the manual lock to a locking
clojure would be enough, but if you want to test it manually, you can clone clojure-lsp
on this branch: https://github.com/clojure-lsp/clojure-lsp/pull/267/files and run ./graalvm/native-compile.sh
, you will need graalvm 11 21.0 installed too.
@ptaoussanis To test this, you can set up the hello world project as described here:
https://github.com/lread/clj-graal-docs/blob/master/doc/hello-world.md
And then use timbre to log something in the main function.
@borkdude's comment here was correct (and thanks for helping clarify):
every invocation of the function needs to be locked on the same object
Unfortunately the latest PR re-introduces a possible deadlock: https://github.com/ptaoussanis/timbre/pull/330. We need to be careful about not unnecessarily changing the semantics of what happens under lock.
@ptaoussanis is the PR ok now? Should I change anything more?
Thanks for the updated PR, looks good 👍
com.taoensso/timbre {:mvn/version "5.1.2-SNAPSHOT"}
is on Clojars now. Could you please give it one last check and if you're satisfied, I'll cut a stable release?
BTW the issue with Timbre pulling in transitive :dev dependencies should now also be resolved, so you should be able to remove any exclusions that you've added.
Perfect! Sure, I'll try right now
Got this error now:
It seems to be this issue reported by @borkdude: https://github.com/oracle/graal/issues/1613#issuecomment-521592548
So is there any way to fix that including taoensso.encore
source code? how did you fix it exactly @borkdude?
@ericdallo As you can read in that issue: on macOS CI it helped to bump Xcode. Not sure why this helped.
Yeah, I'm compiling on NixOS :/ Not sure it'll happen on the CI too, but seems to happen with that snapshot from @ptaoussanis
Let's not bother @ptaoussanis with this. The locking issue is now solved.
Yeah, besides that, I could not confirm if it fixed @ptaoussanis but I could confirm the exclusions are not necessary anymore indeed.
Merged manually, thanks again!
just FYI I really don't know why, but the 5.1.2 fixes the above issue 🤷🏻♂️ while the 5.1.2-SNAPSHOT doesn't, so that's good news :D
When compiling a app using
spit-appender
, graalvm complains about a lock from monitor-enter/exit that does not matches. Log: https://pastebin.com/g9wqxqbvThis looks the same issue
clojure.core
had on its defmacrolocking
on CLJ-1472, since the macro is fixed, we can use it instead of manually callingmonitor-enter/exit
Thank you for the help on this @borkdude