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] when I import assert.h file, the clangd is broken #1871

Closed
jingyuexing opened this issue Oct 13, 2021 · 11 comments
Closed

[clangd] when I import assert.h file, the clangd is broken #1871

jingyuexing opened this issue Oct 13, 2021 · 11 comments
Labels
language server issue Issues related to language servers communicating with this plugin

Comments

@jingyuexing
Copy link

Describe the bug
when I write into some code, for example, inline assembly or import assert.h , then clangd is broken

To Reproduce
Steps to reproduce the behavior:

  1. open a .c file
  2. write content as #include <assert.h>
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Environment (please complete the following information):

  • OS: Windows
  • Sublime Text version: 4100
  • LSP version: v1.12.1
  • Language servers used: clangd 13.0.0

Additional context

#include <stdint.h>
#include <stdlib.h>
int32_t *somefunc( hash){
}
__asm{

}

You can try to copy that code to your editor

@jingyuexing
Copy link
Author

The error code is very unusual, the 3221225501 binary code is 11000000000000000000000000011101

@rchl
Copy link
Member

rchl commented Oct 15, 2021

Sounds like a server issue but can you provide a full server log? (https://lsp.sublimetext.io/troubleshooting/#self-help-instructions)

@jingyuexing
Copy link
Author

jingyuexing commented Oct 15, 2021

Sounds like a server issue but can you provide a full server log? (https://lsp.sublimetext.io/troubleshooting/#self-help-instructions)

log
  clangd: I[23:02:47.295] <-- reply(0)
clangd: I[23:02:47.295] --> $/progress
clangd: I[23:02:47.295] --> $/progress
:: <-  clangd $/progress: {'token': 'backgroundIndexProgress', 'value': {'kind': 'begin', 'title': 'indexing', 'percentage': 0}}
:: <-  clangd $/progress: {'token': 'backgroundIndexProgress', 'value': {'kind': 'report', 'percentage': 0, 'message': '0/1'}}
clangd: Assertion failed: isValid(), file C:\src\llvm_package_1300-rc4\llvm-project\clang\include\clang/Basic/SourceLocation.h, line 327
clangd:  #0 0x00007ff60d15a1b6 (E:\Programming\LLVM\bin\clangd.exe+0xfa1b6)
clangd:  #1 0x00007ff97aaa1881 (C:\WINDOWS\System32\ucrtbase.dll+0x71881)
clangd:  #2 0x00007ff97aaa2851 (C:\WINDOWS\System32\ucrtbase.dll+0x72851)
clangd:  #3 0x00007ff97aaa41b5 (C:\WINDOWS\System32\ucrtbase.dll+0x741b5)
clangd:  #4 0x00007ff97aaa44f1 (C:\WINDOWS\System32\ucrtbase.dll+0x744f1)
clangd:  #5 0x00007ff60d9b0fc8 (E:\Programming\LLVM\bin\clangd.exe+0x950fc8)
clangd:  #6 0x00007ff60dff7da1 (E:\Programming\LLVM\bin\clangd.exe+0xf97da1)
clangd:  #7 0x00007ff60dff7ffd (E:\Programming\LLVM\bin\clangd.exe+0xf97ffd)
clangd:  #8 0x00007ff60d91cf09 (E:\Programming\LLVM\bin\clangd.exe+0x8bcf09)
clangd:  #9 0x00007ff60d91d97b (E:\Programming\LLVM\bin\clangd.exe+0x8bd97b)
clangd: #10 0x00007ff60d920c82 (E:\Programming\LLVM\bin\clangd.exe+0x8c0c82)
clangd: #11 0x00007ff60d90f403 (E:\Programming\LLVM\bin\clangd.exe+0x8af403)
clangd: #12 0x00007ff60d8923d0 (E:\Programming\LLVM\bin\clangd.exe+0x8323d0)
clangd: #13 0x00007ff60d94c1ae (E:\Programming\LLVM\bin\clangd.exe+0x8ec1ae)
clangd: #14 0x00007ff60e429762 (E:\Programming\LLVM\bin\clangd.exe+0x13c9762)
clangd: #
  

@jingyuexing
Copy link
Author

jingyuexing commented Oct 15, 2021

Sounds like a server issue but can you provide a full server log? (https://lsp.sublimetext.io/troubleshooting/#self-help-instructions)

Although I know this is a server issue, clang-project cannot submit an issue, so I told you this issue, maybe you can solve this issue

@jingyuexing
Copy link
Author

Sounds like a server issue but can you provide a full server log? (https://lsp.sublimetext.io/troubleshooting/#self-help-instructions)

SourceLocation.h#L327

@rchl
Copy link
Member

rchl commented Oct 16, 2021

I'm sure you can report a bug to clang. https://llvm.org/docs/HowToSubmitABug.html

I doubt that any of us will have time and/or expertise to analyze this clang crash.

@rwols rwols added the language server issue Issues related to language servers communicating with this plugin label Oct 16, 2021
@rwols
Copy link
Member

rwols commented Oct 16, 2021

There is a GitHub issue tracker here: https://github.com/clangd/clangd/issues/

cc @HighCommander4, @kadircet

@rwols
Copy link
Member

rwols commented Oct 16, 2021

It doesn't crash here by the way

Schermopname.2021-10-16.om.23.49.19.mov
~/d/clangd-test-crash $ xcrun clangd --version
Apple clangd version 13.0.0 (clang-1300.0.29.3)

@jingyuexing
Copy link
Author

It doesn't crash here by the way

Schermopname.2021-10-16.om.23.49.19.mov

~/d/clangd-test-crash $ xcrun clangd --version
Apple clangd version 13.0.0 (clang-1300.0.29.3)

There is another way that is the same as the issue title.

@jingyuexing
Copy link
Author

It doesn't crash here by the way

Schermopname.2021-10-16.om.23.49.19.mov

~/d/clangd-test-crash $ xcrun clangd --version
Apple clangd version 13.0.0 (clang-1300.0.29.3)
#include <assert.h> // when I include assert.h ,then clangd is crash 
// any code in here

@rwols
Copy link
Member

rwols commented Dec 30, 2021

I see you've tried to submit a bug (clangd/clangd#892) but it needed more information. I hope you can find the time to obtain that additional information for the clangd developers.

@rwols rwols closed this as completed Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language server issue Issues related to language servers communicating with this plugin
Projects
None yet
Development

No branches or pull requests

3 participants