-
Notifications
You must be signed in to change notification settings - Fork 266
Project compiled with GCC gets crash on parse errors since adding "-working-directory" argument in project.cc #457
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
Comments
I do not find
Please check https://github.com/MaskRay/ccls/wiki/Debugging#logs
|
Hi MaskRay, It is injected by src/project.cc: Line 596 in 8b03321
Line 652 in 8b03321
Line 176 in 8b03321
By 'crash', I mean the log states when parsing those files 'clang crash'. I'm not sure where this error comes from exactly, but commenting out all of the lines in project.cc referring to -working-directory makes everything work correctly. |
This mere information doesn't help identifying the problem. Also, check #71 Use https://releases.llvm.org/download.html archive if that doesn't fix the issue. |
Here is an example crash, if you're interested. In this case of a simple C linux kernel module.
|
This just looks like a clang 7 bug that was probably fixed in clang 8 or the upcoming clang 9. You can try https://releases.llvm.org/download.html archives. Don't get stuck on whatever old clang libraries your distribution provides. |
Uh oh!
There was an error while loading. Please reload this page.
Observed behavior
"-working-directory" argument added in src/project.cc causes GCC based projects to get 'crash' errors when parsing, because it is not a valid option in gcc.
compile_commands.json
or.ccls
([wiki/Project-Setup]{
"directory": "/home/user/git-projects/event_collector",
"arguments": [
"/usr/bin/c++",
"-Werror",
"-std=c++14",
"-g",
"-D",
"LINUX",
"-Werror",
"-std=c++14",
"-g",
"-I/usr/lib/llvm-6.0/include/../tools/clang/include",
"-I./bcc/include/api/",
"-I./bcc/include/",
"-I./bcc/libbpf/include/uapi/",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden",
"-I/home/jthomas/.conan/data/boost/1.65.1/conan/stable/package/f13b8707a96902c3870d1d62327acbc46ec72985/include",
"-I/home/jthomas/.conan/data/OpenSSL/1.0.2q/conan/stable/package/b781af3f476d0aa5070a0a35b544db7a3c193cc8/include",
"-I/home/jthomas/.conan/data/bzip2/1.0.6/conan/stable/package/b27e2b40bcb70be2e7d6f0e0c6e43e35c530f8d3/include",
"-I/home/jthomas/.conan/data/zlib/1.2.11/conan/stable/package/d50a0d523d98c15bb147b18fa7d203887c38be8b/include",
"-DBOOST_USE_STATIC_LIBS",
"-c",
"-o",
"src/event_collector.o",
"src/event_collector.cpp"
],
"file": "src/event_collector.cpp"
}
Expected behavior
Previous versions of CCLS worked fine, and if I rebuild ccls removing the -working-directory args, everything works.
System information
gcc version
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
ccls version:
ccls version 0.20190314.1-21-g8b033217
clang version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)
clang version:
clang version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)
OS:
Ubuntu 18.04
Editor:
NeoVim
(But reproduces just running "ccls -index=. -v=2")
Language client (and version):
(Coc.vim) 0.0.73
The text was updated successfully, but these errors were encountered: