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

clangd hangs on invalid config file. #452

Closed
hokein opened this issue Jul 8, 2020 · 0 comments
Closed

clangd hangs on invalid config file. #452

hokein opened this issue Jul 8, 2020 · 0 comments
Assignees

Comments

@hokein
Copy link
Contributor

hokein commented Jul 8, 2020

Reproduce steps:

  1. use the head-version clangd, with -enable-config=true
  2. put an invalid .clangd in llvm-project root
  3. run clangd

clangd seems hanging, and keeps emitting

E[19:48:32.726] config error at workspace/llvm-project/.clangd:5:0: Config should be a dictionary

.clangd content:

If:

bcdo
arichardson pushed a commit to arichardson/llvm-project that referenced this issue Jul 15, 2020
Summary:
A few things were broken:
 - use of Document::parseBlockNode() is incorrect and prevents moving to the
   next doc in error cases. Use getRoot() instead.
 - bailing out in the middle of iterating over a list/dict isn't allowed,
   unless you are going to throw away the parser: the next skip() asserts.
   Always consume all items.
 - There were two concepts of fatal errors: error-diagnostics and drop-fragment.
   (The latter is the "return false" case in the parser). They didn't coincide.
   Now, parser errors and explicitly emitted error diagnostics are fatal.

Fixes clangd/clangd#452

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83436
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
Summary:
A few things were broken:
 - use of Document::parseBlockNode() is incorrect and prevents moving to the
   next doc in error cases. Use getRoot() instead.
 - bailing out in the middle of iterating over a list/dict isn't allowed,
   unless you are going to throw away the parser: the next skip() asserts.
   Always consume all items.
 - There were two concepts of fatal errors: error-diagnostics and drop-fragment.
   (The latter is the "return false" case in the parser). They didn't coincide.
   Now, parser errors and explicitly emitted error diagnostics are fatal.

Fixes clangd/clangd#452

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants