-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes on FreeBSD with "Mutex.lock: Resource deadlock avoided" #245
Comments
@ulugbekna Mind taking a look? Otherwise we'll just need to revert. Unfortunately, I don't very much about BSD, but would definitely prefer if things worked there. |
I remember we previously discussed this piece of code. I will look into this during the weekend but can't promise I'll be able to solve this. I know little about threads module and BSD. In my opinion, locking a mutex twice should result in a deadlock; maybe since the second lock is done by the same thread, it is a no-op and just gives some time for the thread to be created (to avoid races, as you said in slack DM). Has removing the second lock resulted in bad behavior of the program previously? |
FWIW ocaml 4.12 might get errorchecking mutex behavior as default and attempting to lock a mutex from the thread that already owns the mutex will raise a Sys_error exception |
seeing this error on HEAD, 59c9138--installed today on 4.10.0+multicore |
Could one of you try this on master again? #264 is supposed to fix this I think. |
@rgrinberg I tried this on freebsd and #264 indeed fixes the issue reported here. |
I can confirm that the error is gone when running |
Thanks everyone |
CHANGES: ## Features - Add keyword completion - Add go to declaration functionality to jump to a value's specification in a .mli file (ocaml/ocaml-lsp#294) ## Fixes - ocaml/ocaml-lsp#245: correctly use mutexes on OpenBSD (ocaml/ocaml-lsp#264) - ocaml/ocaml-lsp#268: Do not use vendored libraries when building the lsp package (ocaml/ocaml-lsp#260) - ocaml/ocaml-lsp#271: Clear diagnostics when files are closed - Disable non-prefix completion. There's no reliably way to trigger it and it can be slow.
When compiled on FreeBSD 12.1 with ocamlc 4.09.1 from opam, running lsp server results in:
In general
on FreeBSD results in
Fatal error: exception Sys_error("Mutex.lock: Resource deadlock avoided")
, but on Linux it blocks, so I'm not sure if this is something specific to ocaml-lsp, or to ocamlc on FreeBSD.Reverting to parent of 51f0de6 ("scheduler tweaks") makes this error go away.
The text was updated successfully, but these errors were encountered: