-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Bug] GHDL-LS crashes with some projects on Windows #79
Comments
An update: when specifying the full source file path in the ....
"files": [
{ "file": "ENTITY_TOP.vhd", "language": "vhdl" }
]
.... to this: ....
"files": [
{ "file": "C:/Work/MEGA/Portable/GHDL/bin/src_test/ENTITY_TOP.vhd", "language": "vhdl" }
]
.... then GHDL-LS doesn't crash anymore when opening that file, but it reports as warning:
In conclusion, in my opinion, there are some serious bugs in the way file paths are managed by GHDL-LS on Windows. For example, when opening the source file with the entity definition of So, we have to investigate the way file paths are handled by GHDL-LS on Windows, and this should be a good start to fix the issue. |
@pidgeon777, how are you installing GHDL, ghdl-ls and the Neovim client on WIndows? |
For installing ghdl-ls, I followed those advices: Neovim (nightly win64) was downloaded from here: https://github.com/neovim/neovim/releases Neovim version:
|
I barely use windows, so I have to create a setup to reproduce the issue.
|
I'm willing to help with the testing. |
Ok. The first thing to do is to reproduce the bug with logs enabled in ghdl-lsp.
You need to run ghdl-lsp with two '-v'.
The log file would contain more details.
|
vhdl-ls.log:
|
But in the last log, there is no crash. |
More in detail, these are all of the tests I did. In each of those, opening Setup A hdl-prj.json: {
"options": {
"ghdl_analysis": [
"--workdir=work",
"--ieee=synopsys",
"-fexplicit",
"--warn-library",
"--warn-default-binding",
"--warn-binding",
"--warn-reserved",
"--warn-nested-comment",
"--warn-parenthesis",
"--warn-vital-generic",
"--warn-delayed-checks",
"--warn-body",
"--warn-specs",
"--warn-runtime-error",
"--warn-shared",
"--warn-hide",
"--warn-unused",
"--warn-others",
"--warn-pure",
"--warn-static"
]
},
"files": [
{ "file": "C:/Work/MEGA/Portable/GHDL/bin/src_test/ENTITY_TOP.vhd", "language": "vhdl" },
{ "file": "C:/Work/MEGA/Portable/GHDL/bin/src_test/ENTITY_TOP_2.vhd", "language": "vhdl" },
{ "file": "C:/Work/MEGA/Portable/GHDL/bin/src_test/TEST.vhd", "language": "vhdl" },
{ "file": "C:/Work/MEGA/Portable/GHDL/bin/src_test/Sub/ENTITY_1.vhd", "language": "vhdl" },
{ "file": "C:/Work/MEGA/Portable/GHDL/bin/src_test/Sub/ENTITY_2.vhd", "language": "vhdl" }
]
} LSP command: cmd = {"ghdl-ls", "--verbose", "--verbose", "--log-file", "vhdl-ls.log", "--trace-file", "vhdl-ls.trace"}, Results: vhdl-ls.log:
lsp.log:
This should be classified as a bug I think (it can append 1 to 5 to the trace file names, but not beyond, resulting in a crash). Anyway, after having deleted those files and restarted the test, we obtain: vhdl-ls.log:
vhdl-ls.trace.in:
vhdl-ls.trace.out:
lsp.log:
The third row of {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///C:/Work/MEGA/Portable/GHDL/bin/src_test/ENTITY_TOP.vhd","diagnostics":[{"source":"ghdl","range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"message":"entity \"entity_top\" was also defined in file \"C:/Work/MEGA/Portable/GHDL/bin/src_test/ENTITY_TOP.vhd\"","severity":2},{"source":"ghdl","range":{"start":{"line":84,"character":2},"end":{"line":84,"character":2}},"message":"infinite loop for this process without a wait statement","severity":2}]}}Content-Length: 38 This is a bug because the full path of What I mean is that, if a file listed in In my opinion, this is due to the way Setup B Here I only changed the paths of the source files, going from absolute to relative (to the location of hdl-prj.json: {
"options": {
"ghdl_analysis": [
"--workdir=work",
"--ieee=synopsys",
"-fexplicit",
"--warn-library",
"--warn-default-binding",
"--warn-binding",
"--warn-reserved",
"--warn-nested-comment",
"--warn-parenthesis",
"--warn-vital-generic",
"--warn-delayed-checks",
"--warn-body",
"--warn-specs",
"--warn-runtime-error",
"--warn-shared",
"--warn-hide",
"--warn-unused",
"--warn-others",
"--warn-pure",
"--warn-static"
]
},
"files": [
{ "file": "ENTITY_TOP.vhd", "language": "vhdl" },
{ "file": "ENTITY_TOP_2.vhd", "language": "vhdl" },
{ "file": "TEST.vhd", "language": "vhdl" },
{ "file": "Sub/ENTITY_1.vhd", "language": "vhdl" },
{ "file": "Sub/ENTITY_2.vhd", "language": "vhdl" }
]
} Results: vhdl-ls.log:
vhdl-ls.trace.in:
vhdl-ls.trace.out:
lsp.log:
In the log file above, this line is reported:
This time Summary: When opening
Also, in Setup B, if a file not listed in Finally, there seems to be a bug about |
I have tried to install neovim on my windows VM. Big failure: I cannot install nvim-lspconfig plugin. |
I am making some progresses. |
I would suggest making use of this config: https://github.com/ChristianChiarulli/LunarVim It already provides many useful plugins, and also it simplifies the process of enabling GHDL-LS in Neovim. I can provide support if needed. |
I also add that Neovim 0.5 stable has just been released after 3 years of development, 0.4.4 is now its previous version. |
I was not able to reproduce the issue, but I am using the python from mingw. From the log, I would assume you are using a full windows python. Is that correct ? |
@tgingold with latest change how pyGHDL sets the DLL search path for Python 3.8/3.9, you should be able to run also ghdl-ls from Windows CPython. You can call the |
Depends how it was built!
|
For installing
I can confirm that this is the command used to launch GHDL-LS in Neovim:
This command, in turn, launches:
|
Ok, I can reproduce a crash. |
There is a consistency issue with the colon in uri like 'file:///C:/xxx' |
On my setup, my last commit fixes the issue. Now, does it work on your setup ? |
I have two questions, these are the commands I executed for installing GHDL-LS into Windows. In MSYS2 shell: $ pacman -Syu
$ pacman -S mingw-w64-x86_64-ghdl-llvm
$ pacman -S mingw-w64-x86_64-python-pip
$ pacman -S git In MinGW64 shell: pip install git+https://github.com/ghdl/ghdl.git I would like to ask:
Thank you |
The format is |
@umarcor should know how to get the latest binaries (and if this is possible). You can also simply do a new pip install on the git repo. The binaries haven't changed. For my setup, I always have a cloned repo and I build locally. |
Well, I am not sure about this.
LSP clients use this schema for local resources, and it looks to comply with https://datatracker.ietf.org/doc/html/rfc8089
|
When I use GHDL-LS with Neovim, if I open a source file not defined in the list of project files, GHDL-LS keep running, but as soon as I open a source file belonging to the list specified in the
hdl-prj.json
file, it crashes.OS: Windows 10 x64 Pro
ghdl-ls: ghdl-ls 2.0.0-dev
hdl-prj.json:
ENTITY_TOP.vhd:
vhdl-ls.log
vhdl-ls.trace.in
vhdl-ls.trace.out
Neovim LSP log:
particularly:
Something seems to have caused an exception related to the
files_map.adb
GHDL-LS file, line 608.The text was updated successfully, but these errors were encountered: