Skip to content
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

when binding to tcp server inside Bordeaux Thread on MacOS QuickLisp gets stuck and server is not bound to port #27

Open
troydm opened this issue Jan 2, 2021 · 4 comments

Comments

@troydm
Copy link

troydm commented Jan 2, 2021

When binding to tcp server inside Bordeaux Thread on MacOS QuickLisp gets stuck and server is not bound to port

Basically what happens is that (ql:quickload "jsonrpc/transport/tcp" :silent t) is called from inside Bordeaux Thread and it gets stuck thus server is not loaded, not sure whenever it's QuickLisp's problem or just bunch of stuff but this happens on MacOS 10.13.3 running SBCL 2.0.11.

From what I understand root cause is find-mode-class in utils.lisp and it's causing Bordeaux Thread to get stuck, I'm still not sure why QuickLisp gets stuck when loading "jsonrpc/transport/tcp" but it causes whole server not to start

I've encountered this issue when trying to run cl-lsp which started as usually however port was not bound and no error messages were printed so it took me some time to debug this issue

Current workaround that I've found is to call (ql:quickload "jsonrpc/transport/tcp" :silent t) from main thread prior to starting a server, but it's an ad-hoc workaround at best that just happens to work

@troydm
Copy link
Author

troydm commented Jan 3, 2021

further investigation showed that this actually happens on ASDF side, so when jsonrpc tries to loaded "jsonrpc/transport/tcp" package it results in quicklisp calling (asdf:load-system "jsonrpc/transport/tcp" :verbose nil) and this method call gets stuck if it's called from inside bt thread, still not sure what's causing it to get stuck tho

Tested same setup on Linux, running same version of SBCL and everything works fine, it seems like this is MacOS/ASDF/Bordeaux Threads related issue

@troydm
Copy link
Author

troydm commented Jan 4, 2021

Further investigation revealed by user @metayan from #sbcl IRC revealed that this issue is only SBCL 2.0.11 specific and can't be reproduced on SBCL 2.1.0

@cxxxr
Copy link
Owner

cxxxr commented Jan 6, 2021

I was able to reproduced it with mac/sbcl/2.0.11.
It seems to be possible to avoid this by doing "(swank:create-server)" beforehand.
Perhaps it is a socket issue specific to a particular sbcl version?

@troydm
Copy link
Author

troydm commented Jan 6, 2021

@cxxxr it's definitely not socket related as it actually hangs when trying to load asdf system when called inside a separate bordeaux thread, not sure how to avoid it without actually calling (ql:quickload "jsonrpc/transport/tcp" :silent t) before spawning separate jsonrpc tcp server thread. also probably calling (swank:create-server) somehow fixes it, not sure, haven't tried it myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants