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

[BUG]: mojo-lsp-server: /__w/modular/modular/third-party/llvm-project/llvm/include/llvm/Support/JSON.h:318: llvm::json::Value::Value(std::string): Assertion `false && "Invalid UTF-8 in value used as JSON"' failed #1897

Open
davidxiaozhi opened this issue Mar 6, 2024 · 8 comments
Assignees
Labels
bug Something isn't working Initiative: LSP mojo-repo Tag all issues with this label

Comments

@davidxiaozhi
Copy link

Bug description

mojo-lsp-server: /__w/modular/modular/third-party/llvm-project/llvm/include/llvm/Support/JSON.h:318: llvm::json::Value::Value(std::string): Assertion `false && "Invalid UTF-8 in value used as JSON"' failed.
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes with the contents they had at crash time.
#0 0x0000556ca205fd37 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x428d37)
#1 0x0000556ca205d90e (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x42690e)
#2 0x0000556ca205f113 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x428113)
#3 0x0000556ca202aa68 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x3f3a68)
#4 0x00007f368533a520 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x00007f368538e9fc pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#6 0x00007f368533a476 gsignal (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#7 0x00007f36853207f3 abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#8 0x00007f368532071b (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#9 0x00007f3685331e96 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#10 0x0000556ca219cdae (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x565dae)
#11 0x0000556ca21a2fd9 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x56bfd9)
#12 0x0000556ca219d37b (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x56637b)
#13 0x0000556ca1fd1ba7 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x39aba7)
#14 0x0000556ca1fdfa36 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0x3a8a36)
#15 0x0000556ca2810707 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0xbd9707)
#16 0x0000556ca2810421 (/home/admin/.modular/pkg/packages.modular.com_mojo/bin/mojo-lsp-server+0xbd9421)
#17 0x00007f368561f253 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xdc253)
#18 0x00007f368538cac3 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x94ac3)
#19 0x00007f368541e850 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x126850)
[Error - 3:43:20 AM] The Mojo Language Client server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ?  linux
- Provide version information for Mojo by pasting the output of `mojo -v`  24.1
- Provide Modular CLI version by pasting the output of `modular -v` 0.5.1
@davidxiaozhi davidxiaozhi added bug Something isn't working mojo Issues that are related to mojo labels Mar 6, 2024
@davidxiaozhi
Copy link
Author

@richardkiss @scw @dlumma @prabhuramachandran Whether there is a temporary solution to fix the problem

@iamtimdavis
Copy link

@River707 and @walter-erquinigo as FYI

@walter-erquinigo
Copy link
Contributor

@davidxiaozhi , thanks for the report! Could you share the source code of the file that caused the issue in the LSP?

@davidxiaozhi
Copy link
Author

@walter-erquinigo @iamtimdavis I am sorry that I cannot upload the source code file, but I have located the problem, which is caused by special invisible characters in the """ """" format comment. Deleting the comment content of a specific line or replacing """ """" with multiple # can also solve the problem

@walter-erquinigo
Copy link
Contributor

@davidxiaozhi , thanks for the prompt reply!
Could you share a minimal mojo file with that invisible character so that I can reproduce locally? I'm asking because I'm having difficulties replicating that exact situation.

@gryznar
Copy link
Contributor

gryznar commented Mar 20, 2024

@davidxiaozhi crash is still a crash. Protecting against that will be helpful for other users with such problem. Task should not be closed until fixing it

@davidxiaozhi
Copy link
Author

@walter-erquinigo @iamtimdavis this is a crash demo
crash.mojo.txt

@walter-erquinigo
Copy link
Contributor

walter-erquinigo commented Mar 22, 2024

This is a parser issue for sure. I'll take a look soon.

@linear linear bot removed the mojo Issues that are related to mojo label Apr 29, 2024
@ematejska ematejska added the mojo-repo Tag all issues with this label label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Initiative: LSP mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

6 participants