Fork me on GitHub
#lsp
<
2021-10-25
>
andrea.crotti09:10:36

mm interesting I got a double free or corruption error from clojure-lsp, never seen that one before

andrea.crotti09:10:01

using the latest version of clojure-lsp

andrea.crotti09:10:18

weirdly I can't even replicate it running the same command inside the same docker container

andrea.crotti09:10:24

but it only happens when running in CI

ericdallo11:10:33

That's weird, have no idea what error is that

ericdallo11:10:45

Is there any log or something where I can see ?

andrea.crotti13:10:56

but strangely it also stopped happening now

andrea.crotti13:10:12

yeah probably be ignored, some weird thing happened on the machine that was running it maybe

andrea.crotti14:10:35

I noticed that in a project it was only running on cljc files, and I guess it was because :paths in the deps.edn file was just set to src/cljc.

andrea.crotti14:10:59

there are various aliases in the project though so of course also src/clj and src/cljs were in extra-paths

andrea.crotti14:10:13

so is clojure-lsp only looking at :paths ?

ericdallo14:10:42

@andrea.crotti Check here: https://clojure-lsp.io/settings/#source-paths-discovery clojure-lsp has some checks to define which source-paths will be used

andrea.crotti14:10:33

mm

If your project is a deps.edn, clojure-lsp will scan the deps.edn file for :paths, :extra-paths and the paths from the specified :source-aliases setting (default #{:dev :test}), unless you specified :source-paths manually.

andrea.crotti14:10:42

but it's not really working though

andrea.crotti14:10:50

because there is paths and a few extra-paths

andrea.crotti14:10:57

should they be merged together?

ericdallo14:10:52

yes, could you check clojure-lsp log? we log which source-paths we resolved

ericdallo14:10:57

it's the first log when server starts

andrea.crotti14:10:22

mm yeah weird src/cljs is not picked up

andrea.crotti14:10:38

even though it's in extra-paths

andrea.crotti14:10:42

there are multiple extra-paths

andrea.crotti14:10:12

from what I see it might be just taking the last extra-paths it finds

andrea.crotti14:10:20

instead of merging them together

ericdallo14:10:49

could you open an issue with a minimal deps.edn that repro the issue?

andrea.crotti14:10:49

let me see if I can replicate it with a trivial example

ericdallo14:10:03

thanks! I can take a look later today

bruno.bonacci14:10:12

Hi @ericdallo, when i trigger a doc pop-up via M-x lsp-ui-doc-glance the pop-up disappear even when moving the mouse, so it is not possible to scroll through the documentation. Is there a way to keep the popup open while moving the mouse. The popup stays in place only if the mouse pointer happen to be already over the popup. here is the configuration used

(setq lsp-ui-doc-enable   nil
      lsp-ui-doc-position 'at-point
      lsp-ui-doc-include-signature t)

ericdallo14:10:48

Hello! I think lsp-ui-doc-show should be what you are looking for

ericdallo14:10:01

the glance one is just for some quick view I think

ericdallo14:10:36

Personally, I don't use lsp-ui-doc, I use eldoc emacs integration via doom-emacs which shows the doc in a separate buffer

bruno.bonacci14:10:45

I see, thank you.

👍 1
lread23:10:27

@ericdallo GitHub Actions is sometimes giving me JVM fatal errors when running clojure-lsp tests

lread23:10:28

Maybe you've seen these sometimes too?

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f3f43bf02e4, pid=5768, tid=5836
#
# JRE version: OpenJDK Runtime Environment Temurin-11.0.13+8 (11.0.13+8) (build 11.0.13+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (11.0.13+8, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [lmdbjava-native-library-341116842821046309.so+0x62e4]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/runner/work/rewrite-clj/rewrite-clj/test-libs-work/clojure-lsp-2021.10.20-16.49.47/core.5768)
#
# An error report file with more information is saved as:
# /home/runner/work/rewrite-clj/rewrite-clj/test-libs-work/clojure-lsp-2021.10.20-16.49.47/hs_err_pid5768.log
#
# If you would like to submit a bug report, please visit:
#   
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Just assumed it was a JVM bug of some sort. Has happened a few times now so thought I should at least make you aware.

ericdallo23:10:18

Oh never saw that :thinking_face:

ericdallo23:10:08

@UE21H2HHD how those actions on rewrite-clj works?

ericdallo23:10:27

It tries to compile clojure-lsp with your rewrite-clj changes?

lread23:10:16

Yeah, patches clojure-lsp deps with locally installed rewrite-clj jar built off rewrite-clj master.

ericdallo23:10:29

Oh, that's cool

ericdallo23:10:47

I'll try to take a look in about 1hour

ericdallo23:10:59

To check If I know anything

ericdallo23:10:13

But nothing come to my mind right now

lread23:10:18

But I'm not suspecting rewrite-clj - not much has changed in a long while. More guessing we just hit a JDK bug.

lread23:10:20

Your clojure-lsp program is so sophisticated even modern JVMs can't handle it! simple_smile

ericdallo23:10:24

Hahaha wish it was that

lread23:10:05

Just relaunched failed gha job and clojure-lsp worked fine (it is a sporadic failure).

ericdallo23:10:10

Yeah, really sounds like a jdk corner case issue, maybe try other jdk versions? Clojure-lsp CI test java 8, 11 and 15

ericdallo23:10:37

Maybe it could be the jdk you are using, maybe try use the same I use on clojure-lsp GH action?

lread23:10:35

I switched from openjdk to temurin recently. Using temurin JDK 11 for all canary lib testing.

lread23:10:04

(well I guess that was not a switch but responding to a rename)

lread23:10:51

Looking at your workflow, clojure-lsp is still using [email protected] so that means it is using Zulu I think.

ericdallo23:10:38

Hum, probably, I missed that

lread23:10:45

I'm guessing there is nothing for us to solve here. Really more just wanted to make you aware.

ericdallo23:10:51

Probably needs to bump/test a recent version

ericdallo23:10:10

Yeah, I'll test other jdks later, thanks for letting me know!

lread23:10:02

Meh, Zulu might be fine. It was only [email protected] that started letting you specify the distribution if I remember correctly.

👍 1
lread23:10:16

Or who knows, might have something to do with lmdbjava-native-library which I see in the fatal error report.

ericdallo00:10:44

Uh, this comes from datalevin for sure, maybe @U0A74MRCJ knows something about it

ericdallo00:10:27

And we migrated to use datalevin instead of sqlite in the last release

lread00:10:03

Ah, that might be the interesting thing! I guess you could try running your test suite in a loop and see if it eventually fails.

ericdallo00:10:49

yeah, with the same openjdk you use on CI you mean, right?

Huahai01:10:19

Interesting, this is from a compiled lmdb dynamic library, done by lmdbjava, they uses an older version of lmdb, so maybe i should compile my own

👀 1
ericdallo01:10:21

probably that should help with graalvm image compiled with musl/static 👀

Huahai01:10:36

it would to nice to have a reproducible case

Huahai01:10:01

this error is from the jvm version

Huahai01:10:03

so I don’t know

Huahai01:10:36

lmdbjava-native-library-xxx is from LMDBJava, which is not used in our GraalVM version, we compile our own LMDB (same version of LMDB as JVM one though) in GraalVM version

👍 1
Huahai01:10:23

it would be helpful to have a test case that reproduce this error.

Huahai01:10:39

LMDB is compiled as static library in our graalvm version, but it is against glibc, so something might be different from musl

Huahai01:10:52

btw, does musl works on all OS? windows, and macos?

ericdallo01:10:51

I htink only linux @U0A74MRCJ, not sure though

Huahai01:10:13

ok, then the build script will need to do something different depending on OS, i can give it a try when I get the things off my plate.

ericdallo01:10:18

no problem, thank you!

ericdallo01:10:47

I'm a Nix user so the only binary that should work correctly on my machine is a musl static one :)

Huahai01:10:46

i would like this to be out in the next major release, because this may introduce breaking changes

Huahai01:10:10

i don’t want to break people’s database with a minor version bump

Huahai01:10:53

the next release is full-text search feature, i have done bulk of the work, needs to optimize here and there

Huahai01:10:07

maybe no breaking change is necessary, we will have to see

ericdallo01:10:29

I see, take your time :)

lread03:10:07

FWIW, I looked up a previous failure on GitHub Actions from a few days ago, looks very similar to the one I reported today: https://github.com/clj-commons/rewrite-clj/runs/3970926620?check_suite_focus=true#step:9:3098 I'm not sure how long these logs are preserved, so you might want to grab copies.

Huahai18:10:13

i think i may have some ideas on the fix, will see if it works

🤞 2
lread02:10:51

@U0A74MRCJ just curious, did you manage to trigger a reproducible failure?

Huahai15:10:15

it can happen when multiple threads trying to write at the same time

Huahai16:10:27

or program shutdowns abruptly

Huahai21:10:51

0.5.27 is released to hopefully address this problem

ericdallo23:10:49

Thanks! I should bump clojure-lsp soon, but I think only next clojure-lsp release will affect @UE21H2HHD

lread23:10:20

Nice sleuthing @U0A74MRCJ!

lread23:10:01

@ericdallo if I bumped into this on CI I expect others will have bumped into it too! After the upgrade, I’ll be sure to let you know if CI fails for me again.

👍 1
lread17:11:03

@ericdallo I’ve bumped to the current clojure-lsp for my rewrite-clj canary tests. I’ll letcha know if I see any more JVM crashes on CI.

lread23:10:29

Oh so much for the thread, sorry about that!

ericdallo23:10:48

No problem haha