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

lsp-server crashes on drakma http request #167

Open
mezzoEmrys opened this issue Sep 18, 2023 · 4 comments
Open

lsp-server crashes on drakma http request #167

mezzoEmrys opened this issue Sep 18, 2023 · 4 comments

Comments

@mezzoEmrys
Copy link

Platform: Windows

(drakma:http-request "http://lisp.org")

being run causes Alive to report an error, with

[Error - 10:32:27 PM] Connection to server is erroring. Shutting down server.

as the only message in the output log. The same code runs fine through my sbcl instance in the vscode terminal.

@nobody-famous
Copy link
Owner

I'm able to recreate the issue, so that's a plus. When I run it, it's getting a socket error because of some non-blocking issue but then something is blowing up trying to send the debugger request. I see the message being sent in the lsp code, but not in the vscode trace, so I'm thinking something is causing the message to get formatted wrong. I'm still trying to figure out what's going on there.

@madkins23
Copy link
Contributor

I was trying to duplicate this on Ubuntu Linux but it seems to be working for me:

(ql:quickload :drakma)
To load "drakma":
  Load 1 ASDF system:
    drakma
; Loading "drakma"
................
(drakma)

(drakma:http-request "http://lisp.org")
<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>

I tested this with Alive 0.4.1 / SBCL 2.3.2 first and then realized the latest Linux version was SBCL 2.3.8 so I loaded that and tested again with the same result. Checking back, it looks like SBCL 2.3.2 is the latest Windows version.

If I'm not testing this properly let me know and I'll try to get it fail. My original goal was to use my lsp-tester to grab the actual traffic between Alive and Alive LSP and add it here just in case that shed some light on the issue.

@nobody-famous
Copy link
Owner

I now have a theory. It's not generating the headers correctly for the packet. For no good reason, it's not putting \r\n line endings, it's only putting \n. It's not doing that for anything else, only the debugger request for the drakma call. I'm going to switch how I generate the packets and see if I can get it to stop doing that. With any luck, that'll fix it.

It's not too surprising that it might be working correctly on Linux. SBCL on Windows is known to be flaky.

@nobody-famous
Copy link
Owner

OK, that fixed it. It should go into the debugger now instead of crashing the server.

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

3 participants