AdaCore / ada_language_server

Server implementing the Microsoft Language Protocol for Ada and SPARK
GNU General Public License v3.0
226 stars 54 forks source link

Repeated Crash Loading Extended Project #1145

Closed grochoge closed 2 months ago

grochoge commented 1 year ago

Using VSCode 1.78.2 Extension v23.0.17.

Trying to open a .adb file in a project that extends another in a directory outside of the workspace, I repeatedly get the following error: image

Can something be added to at least print the exception message?

Also it seems there was debugging information produced by the build, but it is not part of the release archive on Github or in the build artifacts in Actions. Can that be kept somehow?

[Trace - 3:36:35 PM] Received response 'textDocument/foldingRange - (1)' in 7803ms. Request failed: CONSTRAINT_ERROR
[c:\Users\me\.vscode\extensions\adacore.ada-23.0.17\win32\ada_language_server.exe]
0x7ff6f7bcf0a4
0x7ff6f7bdb65c
0x7ff6f7dad2b4
0x7ff6f7cfcfe7
0x7ff6f7ce44d0
0x7ff6f7cf08ce
0x7ff6f7cf12ed
0x7ff6f9ac4bfe
[C:\windows\System32\KERNEL32.DLL]
0x7ffad8567602
[C:\windows\SYSTEM32\ntdll.dll]
0x7ffad898269f
 (-32603).
[Error - 3:36:35 PM] Request textDocument/foldingRange failed.
  Message: CONSTRAINT_ERROR
[c:\Users\me\.vscode\extensions\adacore.ada-23.0.17\win32\ada_language_server.exe]
0x7ff6f7bcf0a4
0x7ff6f7bdb65c
0x7ff6f7dad2b4
0x7ff6f7cfcfe7
0x7ff6f7ce44d0
0x7ff6f7cf08ce
0x7ff6f7cf12ed
0x7ff6f9ac4bfe
[C:\windows\System32\KERNEL32.DLL]
0x7ffad8567602
[C:\windows\SYSTEM32\ntdll.dll]
0x7ffad898269f

  Code: -32603 
[Trace - 3:36:38 PM] Received response 'textDocument/semanticTokens/range - (2)' in 11044ms. Request failed: GPR2.PROJECT_ERROR
[c:\Users\me\.vscode\extensions\adacore.ada-23.0.17\win32\ada_language_server.exe]
0x7ff6f909f008
0x7ff6f91f8828
0x7ff6f7da5372
0x7ff6f7da8560
0x7ff6f7dac39e
0x7ff6f7dacd37
0x7ff6f7dae7ed
0x7ff6f7cfce67
0x7ff6f7ce59f8
0x7ff6f7cf08ce
0x7ff6f7cf12ed
0x7ff6f9ac4bfe
[C:\windows\System32\KERNEL32.DLL]
0x7ffad8567602
[C:\windows\SYSTEM32\ntdll.dll]
0x7ffad898269f
 (-32603).
[Error - 3:36:38 PM] Request textDocument/semanticTokens/range failed.
  Message: GPR2.PROJECT_ERROR
[c:\Users\me\.vscode\extensions\adacore.ada-23.0.17\win32\ada_language_server.exe]
0x7ff6f909f008
0x7ff6f91f8828
0x7ff6f7da5372
0x7ff6f7da8560
0x7ff6f7dac39e
0x7ff6f7dacd37
0x7ff6f7dae7ed
0x7ff6f7cfce67
0x7ff6f7ce59f8
0x7ff6f7cf08ce
0x7ff6f7cf12ed
0x7ff6f9ac4bfe
[C:\windows\System32\KERNEL32.DLL]
0x7ffad8567602
[C:\windows\SYSTEM32\ntdll.dll]
0x7ffad898269f

  Code: -32603 
reznikmm commented 1 year ago

Could you provide a reproducer?

For a while we published a separate extension with debugging information (as AdaCore.ada-debug), but this confused users and we gave it up. I'm not sure how to make/distribute debug information now.

You can try to enable traces. Create %USERPROFILE%\.als\traces.cfg like this

ALS.MAIN=yes
#KNOWLEDGE_BASE=yes
#KNOWLEDGE_BASE.MATHCING=yes
#KNOWLEDGE_BASE.COMPILER_ITERATOR=yes
LIBADALANG.PROJECT_PROVIDER=yes

to see what's going on.

grochoge commented 1 year ago

Unfortunately I don't have a reproducer I can send at the moment.

I tried the following trace config:

ALS.MAIN=yes > main.txt:buffer_size=0
KNOWLEDGE_BASE=yes > kb.txt:buffer_size=0
KNOWLEDGE_BASE.MATHCING=yes > kb.txt:buffer_size=0
KNOWLEDGE_BASE.COMPILER_ITERATOR=yes > kb.txt:buffer_size=0
LIBADALANG.PROJECT_PROVIDER=yes > project.txt:buffer_size=0
ALS.IN=yes > inout.txt:buffer_size=0
ALS.OUT=yes > inout.txt:buffer_size=0

project.txt is empty. Only additional information in main.txt seems to be INFORMATION: raised GPR2.PROJECT_ERROR : cannot retrieve the sources

For debug information, perhaps archive the unstripped executables in the GitHub actions run (and maybe the GitHub release) but strip it for the published extension? Or re-add Debug to the GitHub Actions matrix and let the executable be archived there, but not published as an extension?

reznikmm commented 1 year ago

Could you try VSCode extension 23.0.18? Does it show more information about source loading error?

We also provide debug information since 23.0.18 in GitHub Release Assets. If you unpack an asset archive and move .debug file near to ada_language_server (in $HOME/.vscode/extensions/adacore.ada-23.0.18/linux/ e.g), then addr2line should be able to produce symbolic backtrace.

AnthonyLeonardoGracio commented 2 months ago

Hello,

We have fixed an issue with extended projects in the library that deals with project-loading (library called GPR2), so this issue has been probably solved since then.

If not, don't hesitate to re-open it with a small reproducer.

Regards,