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

Server crashes when invalidating some sentences #1048

Open
thery opened this issue Feb 25, 2025 · 7 comments · Fixed by #1049
Open

Server crashes when invalidating some sentences #1048

thery opened this issue Feb 25, 2025 · 7 comments · Fixed by #1049
Labels
bug Something isn't working

Comments

@thery
Copy link
Contributor

thery commented Feb 25, 2025

I am using 2.2.4 and the parsing phase seems more fragile. While editing I have sometimes the server crashing.
Here is my log file of the Coq Language Server

[top                 , 69531, 1740479886.430753] ==========================================================
[top                 , 69531, 1740479886.430856] cannot find dependents for sentence 923
[top                 , 69531, 1740479886.430859] ==========================================================
[Error - 11:38:06 AM] Server process exited with code 0.
[Info  - 11:38:06 AM] Connection to server got closed. Server will restart.
true
[top                 , 96024, 1740484354.726290] ==========================================================
[top                 , 96024, 1740484354.726321] cannot find dependents for sentence 1371
[top                 , 96024, 1740484354.726322] ==========================================================
[Error - 12:52:34 PM] Server process exited with code 0.
[Info  - 12:52:34 PM] Connection to server got closed. Server will restart.

How I can find what senterce 923 and 1371 refer to?

@rtetley
Copy link
Collaborator

rtetley commented Feb 25, 2025

This is an issue in the scheduler. Do you have an example where this happens ?
We now schedule parse errors as a specific event to have it show up in the interface (as opposed to running through).

@rtetley rtetley added the bug Something isn't working label Feb 25, 2025
@rtetley rtetley added this to the Next release (2.3.0) milestone Feb 25, 2025
@rtetley rtetley changed the title Server process exited with code 0 Server crashes when invalidating some sentences Feb 25, 2025
@rtetley
Copy link
Collaborator

rtetley commented Feb 25, 2025

Okay, I believe the culprit is:

let deps = Scheduler.dependents schedule id in

When a sentence is invalidated we check if we need to invalidate its dependents. In the off chance that we scheduled a block on parse error event that needs to be "invalidated", this will try and look for its dependents (to invalidate them) and crash.

I can push a hotfix / release if this is really blocking or we can wait till next release (in about 3 weeks time).

@thery
Copy link
Contributor Author

thery commented Feb 25, 2025

Ok here is a way to reproduce it. I create a syntax error and try to execute it.

Image

now editing anywhere on the line of the error makes the server crash

@rtetley
Copy link
Collaborator

rtetley commented Feb 25, 2025

Well I've got a fix, so depending on how impactful this is, I can release.

@thery
Copy link
Contributor Author

thery commented Feb 25, 2025

Please release 🙏

@rtetley rtetley reopened this Mar 5, 2025
@rtetley
Copy link
Collaborator

rtetley commented Mar 5, 2025

I have had reports of similar crashes happening just with some copy pasting through a coq file... See https://coq.zulipchat.com/#narrow/channel/237662-VsCoq-devs-.26-users/topic/VSCoq.20resetting.20a.20lot.20on.202.2E2.2E5

If anyone gets a similar behaviour please could you report ? Trying to pin-point the problem !

@thery
Copy link
Contributor Author

thery commented Mar 6, 2025

Got the same error as @TheoWinterhalter

==========================================================
[top                 , 385482, 1741257457.337959] Trying to get range of non-existing sentence 1453
[top                 , 385482, 1741257457.337962] 
==========================================================
[Error - 11:37:37 AM] Server process exited with code 0.
[Info  - 11:37:37 AM] Connection to server got closed. Server will restart.
true

very difficult to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants