-
Notifications
You must be signed in to change notification settings - Fork 267
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
VSCode extension shows forever "verifying" - how to diagnose? #1213
Comments
Thanks for the report. I just recently received a similar report. The problem you're describing makes me feel that there is some synchronization issue with the UI rather than a problem with the language server. The LS can write log files. You can enable it by replacing the most likely empty nlog.config of your extension install-dir (something like Nevertheless, I have the feeling that there might be errors happening during the verification. You may already see them in the VSCode output when switching to the Dafny Language Server view, without having to enable the log explicitly: |
No, once the "Verifying" indicator is showing, other documents don't get verified when I edit them. Looking at the Dafny Language Server view, when I open the affected document, an entry appears like this:
... which seems to follow the format of previous didOpen entries. But nothing more appears after that, even if I activate other documents. Relatedly: if VSCode opens with the affected document active, the Dafny Language Server view does not even appear in the popup list. This kept me confused for a while. I also tried changing the empty nlog.config in that directory you mentioned for the one you provided. I couldn't find any log.txt file being created even after restarting the whole VSCode. When / where should it appear? |
I just tried the stabilize-verification-status branch, but the behavior seems to be the same. |
Thanks for your tests. This effectively sounds like the language server gets stuck during verification (or some pre-/post-processing related to it). I already got an earlier report with some code snippet - with the observation that the error did not occur on extension 1.4.0 and its DafnyLS 3.0.0. However, I cannot reproduce the error on my devices and I do not own a Mac/OSX. Would you mind sharing a minimal example? Maybe I have better luck with another example to reproduce the error you're describing. You should see the logs after adding the contents to nlog.config and restarting VSCode. Although, I don't think there will be any helpful error messages in the log since resources should be freed upon error; thus, the DafnyLS shouldn't get stuck. |
If I manage to isolate a shareable snippet that triggers the problem I'll report back... As for the logs, nlog.config is already set as suggested but I just don't see any log.txt file being generated. Should it appear in the same directory as nlog.config? |
Thanks a lot. Yes, the log file should be generated within the same dir. But I forgot to mention: Since you have probably configured a custom language server that's not located in the default install dir, you have to place the nlog.config within the dir of your server installation. The log file should appear within the same dir as you have installed the server. |
Aha, thank you, that was it - now I have a log.txt file.
... where XXX.dfy is the file that gets stuck in "Verifying". |
A coarse observation: by looking at macOS' Activity Monitor, I see that verifying a small Dafny file that doesn't exhibit the bug causes some spikes of CPU activity by processes named dotnet and z3. |
Thanks a lot for sharing your observations. These warnings are not problematic (I should lower their severity by now) since they only depict language features that are currently not supported by the language server (they'll miss code navigation and similar features). Are there any errors/exceptions within the log? |
I just re-checked the executables that are triggered by the editing of code in VSCode, using In summary: the "bad" file runs
No, it is all
No, that file has a few errors of the |
I am sorry that my response took so long; I couldn't get access to an OSX device to debug the issue. # Increase the stack size
export COMPlus_DefaultStackSize=100000
# Launch VSCode
code |
I can confirm that my big file does finish its verification if I set the COMPlus_DefaultStackSize environment variable. |
Thank you very much for your quick response and confirmation. |
I just found something remarkable. If I add VSCode must be doing some magic on its own restart to import environment variables... which is great, because looks like macOS Big Sur 11.4 has no way to permanently add environment variables to the GUI process. The methods that worked in earlier versions seem to be gone now. |
Thank you for your follow-up. I am glad that you managed to create a (hopefully) satisfactory solution. Moreover, thank you for sharing it. |
Yes, sorry, I didn't think to close it. |
Dafny 3.1.0.30421 - commit 98e24a6
VSCode 1.55.2
Dafny extension 1.5.0, using LS from external Dafny
My .dfy file opened in VSCode causes it to forever show a "Verifying" message (with circling arrow) in the status bar. There is no Z3 running in the OS Activity Monitor (nor any other process that might look like some work is happening), so looks like this will never change by itself.
Edits in the file might cause the message to stabilize into a "Verified" message, or make it go into "verifying" again. It's a big file, and I didn't manage to extract some snippet that would keep the weird behavior.
Is there any easy way in which I can get some visibility into what's going on, so maybe I can isolate a proper bug report?
The text was updated successfully, but these errors were encountered: