intersystems / language-server

Repository for the VS Code Language Server
https://marketplace.visualstudio.com/items?itemName=intersystems.language-server
Other
16 stars 6 forks source link

Crashes on editing some classes #306

Closed CoffeeMonster42 closed 5 months ago

CoffeeMonster42 commented 5 months ago

On editing some classes the language server is crashing with this output

[Error - 9:49:21 AM] Server process exited with code 3221225477. [Info - 9:49:21 AM] Connection to server got closed. Server will restart. true

gjsjohnmurray commented 5 months ago

I suggest you alter the intersystems.language-server.trace.server to get extra information in the InterSystems Language Server channel of the Output view (normally in the Panel). Take care not to post sensitive information here. If it isn't easy to mask before posting please create a WRC ticket and attach the output there, then quote the ticket number here.

CoffeeMonster42 commented 5 months ago

This is the output i get after changing the setting

[Trace - 1:37:58 PM] Sending request 'initialize - (0)'. [Trace - 1:37:59 PM] Received response 'initialize - (0)' in 285ms. [Trace - 1:37:59 PM] Sending notification 'initialized'. [Trace - 1:37:59 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:37:59 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:37:59 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:37:59 PM] Sending request 'textDocument/diagnostic - (1)'. [Trace - 1:37:59 PM] Sending request 'textDocument/diagnostic - (2)'. [Trace - 1:37:59 PM] Sending request 'textDocument/diagnostic - (3)'. [Trace - 1:37:59 PM] Received request 'client/registerCapability - (0)'. [Trace - 1:37:59 PM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms [Trace - 1:37:59 PM] Sending notification 'workspace/didChangeConfiguration'. [Trace - 1:37:59 PM] Sending request 'textDocument/documentSymbol - (4)'. [Trace - 1:37:59 PM] Sending request 'textDocument/codeAction - (5)'. [Trace - 1:37:59 PM] Sending request 'textDocument/documentLink - (6)'. [Trace - 1:37:59 PM] Sending request 'textDocument/documentSymbol - (7)'. [Trace - 1:37:59 PM] Sending request 'textDocument/foldingRange - (8)'. [Error - 1:37:59 PM] Server process exited with code 3221225477. [Info - 1:37:59 PM] Connection to server got closed. Server will restart. true [Trace - 1:37:59 PM] Sending request 'initialize - (0)'. [Trace - 1:37:59 PM] Received response 'initialize - (0)' in 231ms. [Trace - 1:37:59 PM] Sending notification 'initialized'. [Trace - 1:37:59 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:37:59 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:37:59 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:37:59 PM] Sending request 'textDocument/diagnostic - (1)'. [Trace - 1:37:59 PM] Sending request 'textDocument/diagnostic - (2)'. [Trace - 1:37:59 PM] Sending request 'textDocument/diagnostic - (3)'. [Trace - 1:37:59 PM] Received request 'client/registerCapability - (0)'. [Trace - 1:37:59 PM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms [Trace - 1:37:59 PM] Sending notification 'workspace/didChangeConfiguration'. [Trace - 1:37:59 PM] Sending request 'textDocument/documentSymbol - (4)'. [Trace - 1:37:59 PM] Sending request 'textDocument/codeAction - (5)'. [Trace - 1:37:59 PM] Sending request 'textDocument/documentLink - (6)'. [Trace - 1:38:00 PM] Sending request 'textDocument/documentSymbol - (7)'. [Trace - 1:38:00 PM] Sending request 'textDocument/foldingRange - (8)'. [Error - 1:38:00 PM] Server process exited with code 3221225477. [Info - 1:38:00 PM] Connection to server got closed. Server will restart. true [Trace - 1:38:00 PM] Sending request 'initialize - (0)'. [Trace - 1:38:00 PM] Received response 'initialize - (0)' in 226ms. [Trace - 1:38:00 PM] Sending notification 'initialized'. [Trace - 1:38:00 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:38:00 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:38:00 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:38:00 PM] Sending request 'textDocument/diagnostic - (1)'. [Trace - 1:38:00 PM] Sending request 'textDocument/diagnostic - (2)'. [Trace - 1:38:00 PM] Sending request 'textDocument/diagnostic - (3)'. [Trace - 1:38:00 PM] Received request 'client/registerCapability - (0)'. [Trace - 1:38:00 PM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms [Trace - 1:38:00 PM] Sending notification 'workspace/didChangeConfiguration'. [Trace - 1:38:00 PM] Sending request 'textDocument/documentSymbol - (4)'. [Trace - 1:38:00 PM] Sending request 'textDocument/codeAction - (5)'. [Trace - 1:38:00 PM] Sending request 'textDocument/documentLink - (6)'. [Trace - 1:38:00 PM] Sending request 'textDocument/documentSymbol - (7)'. [Trace - 1:38:00 PM] Sending request 'textDocument/foldingRange - (8)'. [Error - 1:38:00 PM] Server process exited with code 3221225477. [Info - 1:38:00 PM] Connection to server got closed. Server will restart. true [Trace - 1:38:00 PM] Sending request 'initialize - (0)'. [Trace - 1:38:01 PM] Received response 'initialize - (0)' in 231ms. [Trace - 1:38:01 PM] Sending notification 'initialized'. [Trace - 1:38:01 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:38:01 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:38:01 PM] Sending notification 'textDocument/didOpen'. [Trace - 1:38:01 PM] Sending request 'textDocument/diagnostic - (1)'. [Trace - 1:38:01 PM] Sending request 'textDocument/diagnostic - (2)'. [Trace - 1:38:01 PM] Sending request 'textDocument/diagnostic - (3)'. [Trace - 1:38:01 PM] Received request 'client/registerCapability - (0)'. [Trace - 1:38:01 PM] Sending response 'client/registerCapability - (0)'. Processing request took 1ms [Trace - 1:38:01 PM] Sending notification 'workspace/didChangeConfiguration'. [Trace - 1:38:01 PM] Sending request 'textDocument/documentSymbol - (4)'. [Trace - 1:38:01 PM] Sending request 'textDocument/codeAction - (5)'. [Trace - 1:38:01 PM] Sending request 'textDocument/documentLink - (6)'. [Trace - 1:38:01 PM] Sending request 'textDocument/documentSymbol - (7)'. [Trace - 1:38:01 PM] Sending request 'textDocument/foldingRange - (8)'. [Error - 1:38:01 PM] Server process exited with code 3221225477. [Error - 1:38:01 PM] The InterSystems Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

isc-bsaviano commented 5 months ago

@CoffeeMonster42 What version of the extension are you using? Can you paste the text of the class that's causing the crash here? I will try to reproduce your issue.

CoffeeMonster42 commented 5 months ago

Version is 2.4.3

This issue is also on WRC# 984045

isc-bsaviano commented 5 months ago

Thanks for posting the class. This class is huge, so it's going to take me some time to identify which specific piece is causing the crash. Did this crash with version 2.4.2? If not you can manually install that version of the extension so you can keep working while I investigate. You can install a previous version by clicking on the gear icon for the extension in the extensions view and selecting the Install Another Version... option.

CoffeeMonster42 commented 5 months ago

I've tried going back multiple versions but they are giving the same error I can still edit the class however it is rather annoying as the outline breaks.

isc-bsaviano commented 5 months ago

I think I found the cause of the crash. There's a huge in the Storage definition (line 4075) that the parser chokes on. The parser is reading the huge amount of data and a SIGINT is thrown part of the way through. I'm not familiar with this, but I think that data is inserted when you tune a table. I will ask around internally to see if a can/should contain >150KB of data or if this is a bug. For what it's worth, the default VS Code coloring for XML also fails on this line (the tag isn't colored). What version of IRIS are you on?

CoffeeMonster42 commented 5 months ago

$zv is IRIS for Windows (x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:16:40 EDT

isc-bsaviano commented 5 months ago

Thanks. Let me see what information I can gather.

isc-bsaviano commented 5 months ago

After speaking to the SQL team, this appears to be caused by a bug that was fixed in IRIS 2022.1.3 (YCL157). I recommend upgrading to a version with the fix and tuning your tables again. The WRC can help with that.

isc-bsaviano commented 5 months ago

@CoffeeMonster42 Even though I was able to reproduce the crash I'm going to close this because the code that caused the crash was buggy. An immediate workaround is to re-tune your table or remove the tune table statistics from the class. I recommend that you upgrade to a version with the fix that I mentioned.

CoffeeMonster42 commented 5 months ago

Thanks.

Do you know how I can remove the stats from the class?

On Thu, Feb 22, 2024 at 7:59 PM Brett Saviano @.***> wrote:

@CoffeeMonster42 https://github.com/CoffeeMonster42 Even though I was able to reproduce the crash I'm going to close this because the code that caused the crash was buggy. An immediate workaround is to re-tune your table or remove the tune table statistics from the class. I recommend that you upgrade to a version with the fix that I mentioned.

— Reply to this email directly, view it on GitHub https://github.com/intersystems/language-server/issues/306#issuecomment-1959978363, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUUT64PLIISK5J3OJJQ7UETYU6BR7AVCNFSM6AAAAABDSRHR66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZHE3TQMZWGM . You are receiving this because you were mentioned.Message ID: @.***>

isc-bsaviano commented 5 months ago

You can use the $SYSTEM.SQL.TuneTable() method with the sixth argument (ClearValues) set to 1. Note that clearing table stats may negatively affect performance so you shouldn't do this on a live/production system.