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

Errors persist after they have been fixed when related to ! or !!in one instance and // in another #62

Closed
joshring opened this issue Sep 4, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@joshring
Copy link

joshring commented Sep 4, 2024

Describe the bug
Errors persist after they have been fixed when related to ! or !!

To Reproduce
Found when adding a ! and !! to the end of line 379 in the code below.

Log: https://paste.mozilla.org/GB6k7PJV
Code: https://paste.mozilla.org/rf47x7Jp#L11 (I am just experimenting don't learn from this)

Expected behavior
Expected the error to be resolved when the code changed (are the ! characters being ignored in the diff?)

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux Ubuntu 24.04 LTS
  • Editor Visual Studio Code

code -v
1.92.2
fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
x64

@pherrymason pherrymason added the bug Something isn't working label Sep 4, 2024
@joshring
Copy link
Author

joshring commented Sep 4, 2024

Another replication, this time with errors about shadowing which stuck around after commenting that code out:

This was the original error:

 411: fn void! main(String[] args)
 412: {
 413:     BookShopFaults order_failed = BookShopFaults.BOOK_NOT_FOUND;
 414:     BookShopFaults order_failed = BookShopFaults.BOOK_OUT_OF_STOCK;
                         ^^^^^^^^^^^^
(/home/josh/git/c3_tests/test1/src/optional.c3:414:20) Error: 'order_failed' would shadow a previous declaration.

 410: 
 411: fn void! main(String[] args)
 412: {
 413:     BookShopFaults order_failed = BookShopFaults.BOOK_NOT_FOUND;
                         ^^^^^^^^^^^^
(/home/josh/git/c3_tests/test1/src/optional.c3:413:20) Note: The previous use of 'order_failed' was here.

Log: https://paste.mozilla.org/jAv9OWUP
code: https://paste.mozilla.org/fcwPcKNr

screenshot: (the file was saved)
image

@joshring joshring changed the title Errors persist after they have been fixed when related to ! or !! Errors persist after they have been fixed when related to ! or !!in one instance and // in another Sep 4, 2024
@pherrymason
Copy link
Owner

pherrymason commented Sep 5, 2024

I've found some issues indeed:

  • Diagnostics are triggered on document change, but that does not means the file was saved, so c3c build might be rebuilding an old version.
  • I see old diagnostics still on cache that should have been removed.

@joshring
Copy link
Author

joshring commented Sep 5, 2024

I checked out a clean version of c3-lsp and rebuilt with latest main branch

I now get some issues with c3c versions, it seems to have 0.6.2 hard coded but I have specified the current version. Rebuild C3C from latest master didn't help

c3c -V
C3 Compiler Version:       0.6.3 (Pre-release, Sep  5 2024 09:03:23)
Installed directory:       /home/josh/git/c3_tests/c3c/build/
Git Hash:                  5e4d790fc3d1fffcd0729c35afe33fba938c0f41
LLVM version:              18.1.3
LLVM default target:       x86_64-pc-linux-gnu

c3lsp.json

{
    "C3": {
        "version": "0.6.3",
        "path": "/home/josh/git/c3_tests/c3c/build/c3c",
        "stdlib-path": "/home/josh/git/c3_tests/c3c/build/lib/std"
    },
    "Diagnostics": {
        "enabled": false,
        "delay": 2000
    }
}

Logs:

[Error - 08:56:02] Client C3LSP: connection to server is erroring.
write EPIPE
Shutting down server.
[Error - 08:56:02] Client C3LSP: connection to server is erroring.
write EPIPE
[Error - 08:56:02] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
	at mh.shutdown (/home/josh/git/vscode-c3/dist/extension.js:71:8468)
	at mh.stop (/home/josh/git/vscode-c3/dist/extension.js:71:8047)
	at mh.stop (/home/josh/git/vscode-c3/dist/extension.js:74:30480)
	at mh.handleConnectionError (/home/josh/git/vscode-c3/dist/extension.js:73:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Error - 08:56:02] Server initialization failed.
  Message: write EPIPE
  Code: -32099 
[Error - 08:56:02] C3LSP client: couldn't create connection to server.
  Message: write EPIPE
  Code: -32099 
[Info  - 08:56:02] Connection to server got closed. Server will restart.
true
2024/09/05 08:56:02.370  DEBUG [C3-LSP.parser] No crash reports
2024/09/05 08:56:02.370  DEBUG [C3-LSP.parser] C3 Language version specified: 0.6.2
panic: c3 language version not supported

goroutine 1 [running]:
github.com/pherrymason/c3-lsp/internal/lsp/server.checkRequestedLanguageVersion({{0xc3c5c9, 0x5}, 0x1})
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:179 +0x25e
github.com/pherrymason/c3-lsp/internal/lsp/server.NewServer({{{{0xc3c5c9, 0x5}, 0x1}, {{0x0, 0x0}, 0x0}, {{0x0, 0x0}, 0x0}}, {0x1, ...}, ...}, ...)
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:71 +0x30f
main.main()
	/home/josh/git/c3_tests/c3_lsp/server/cmd/lsp/main.go:54 +0x2f8
[Error - 08:56:02] Server process exited with code 2.
[Error - 08:56:02] Server process exited with code 2.
[Error - 08:56:02] Client C3LSP: connection to server is erroring.
Cannot call write after a stream was destroyed
[Error - 08:56:02] Server initialization failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 08:56:02] C3LSP client: couldn't create connection to server.
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 08:56:02] Restarting server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Info  - 08:56:02] Connection to server got closed. Server will restart.
true
2024/09/05 08:56:02.428  DEBUG [C3-LSP.parser] No crash reports
2024/09/05 08:56:02.428  DEBUG [C3-LSP.parser] C3 Language version specified: 0.6.2
panic: c3 language version not supported

goroutine 1 [running]:
github.com/pherrymason/c3-lsp/internal/lsp/server.checkRequestedLanguageVersion({{0xc3c5c9, 0x5}, 0x1})
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:179 +0x25e
github.com/pherrymason/c3-lsp/internal/lsp/server.NewServer({{{{0xc3c5c9, 0x5}, 0x1}, {{0x0, 0x0}, 0x0}, {{0x0, 0x0}, 0x0}}, {0x1, ...}, ...}, ...)
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:71 +0x30f
main.main()
	/home/josh/git/c3_tests/c3_lsp/server/cmd/lsp/main.go:54 +0x2f8
2024/09/05 08:56:02.445  DEBUG [C3-LSP.parser] No crash reports
2024/09/05 08:56:02.445  DEBUG [C3-LSP.parser] C3 Language version specified: 0.6.2
panic: c3 language version not supported

goroutine 1 [running]:
github.com/pherrymason/c3-lsp/internal/lsp/server.checkRequestedLanguageVersion({{0xc3c5c9, 0x5}, 0x1})
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:179 +0x25e
github.com/pherrymason/c3-lsp/internal/lsp/server.NewServer({{{{0xc3c5c9, 0x5}, 0x1}, {{0x0, 0x0}, 0x0}, {{0x0, 0x0}, 0x0}}, {0x1, ...}, ...}, ...)
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:71 +0x30f
main.main()
	/home/josh/git/c3_tests/c3_lsp/server/cmd/lsp/main.go:54 +0x2f8
[Error - 08:56:02] Server process exited with code 2.
[Error - 08:56:02] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 08:56:02] Connection to server got closed. Server will restart.
true
[Error - 08:56:02] C3LSP client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
2024/09/05 08:56:02.625  DEBUG [C3-LSP.parser] No crash reports
2024/09/05 08:56:02.625  DEBUG [C3-LSP.parser] C3 Language version specified: 0.6.2
panic: c3 language version not supported

goroutine 1 [running]:
github.com/pherrymason/c3-lsp/internal/lsp/server.checkRequestedLanguageVersion({{0xc3c5c9, 0x5}, 0x1})
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:179 +0x25e
github.com/pherrymason/c3-lsp/internal/lsp/server.NewServer({{{{0xc3c5c9, 0x5}, 0x1}, {{0x0, 0x0}, 0x0}, {{0x0, 0x0}, 0x0}}, {0x1, ...}, ...}, ...)
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:71 +0x30f
main.main()
	/home/josh/git/c3_tests/c3_lsp/server/cmd/lsp/main.go:54 +0x2f8
[Error - 08:56:02] Server process exited with code 2.
[Error - 08:56:02] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 08:56:02] Connection to server got closed. Server will restart.
true
[Error - 08:56:02] C3LSP client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 08:56:02] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
2024/09/05 08:56:02.828  DEBUG [C3-LSP.parser] No crash reports
2024/09/05 08:56:02.828  DEBUG [C3-LSP.parser] C3 Language version specified: 0.6.2
panic: c3 language version not supported

goroutine 1 [running]:
github.com/pherrymason/c3-lsp/internal/lsp/server.checkRequestedLanguageVersion({{0xc3c5c9, 0x5}, 0x1})
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:179 +0x25e
github.com/pherrymason/c3-lsp/internal/lsp/server.NewServer({{{{0xc3c5c9, 0x5}, 0x1}, {{0x0, 0x0}, 0x0}, {{0x0, 0x0}, 0x0}}, {0x1, ...}, ...}, ...)
	/home/josh/git/c3_tests/c3_lsp/server/internal/lsp/server/server.go:71 +0x30f
main.main()
	/home/josh/git/c3_tests/c3_lsp/server/cmd/lsp/main.go:54 +0x2f8
[Error - 08:56:02] Server process exited with code 2.
[Error - 08:56:02] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 08:56:02] The C3LSP server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 08:56:02] C3LSP client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 08:56:02] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

@joshring
Copy link
Author

joshring commented Sep 6, 2024

I believe this is fixed now closing

@joshring joshring closed this as completed Sep 6, 2024
@pherrymason
Copy link
Owner

Thank you for your detailed reports

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

No branches or pull requests

2 participants