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
Include debug info in clangd release packages #1641
Comments
The CI script has already enabled clangd/.github/workflows/autobuild.yaml Line 183 in 6e7f596
But sending a fatal signal like SIGABRT by hand to the latest released binary(16.0.2) on my MacOS (without llvm installed) still yields nothing but signature + offsets: I[22:18:41.886] clangd version 16.0.2 (https://github.com/llvm/llvm-project 18ddebe1a1a9bde349441631365f0472e9693520)
I[22:18:41.886] Features: mac+grpc+xpc
I[22:18:41.886] PID: 7272
I[22:18:41.886] Working directory: /Users/zyounan/clangd_16.0.2/bin
I[22:18:41.886] argv[0]: ./clangd
I[22:18:41.886] Starting LSP over stdin/stdout
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 clangd 0x000000010478fc2c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 clangd 0x000000010478ee98 llvm::sys::RunSignalHandlers() + 64
2 clangd 0x0000000104790304 SignalHandler(int) + 344
3 libsystem_platform.dylib 0x00000001a3c042a4 _sigtramp + 56
4 libsystem_c.dylib 0x00000001a3ac6978 __sread + 24
5 libsystem_c.dylib 0x00000001a3aa1b8c _sread + 32
6 libsystem_c.dylib 0x00000001a3aa1b20 __srefill1 + 36
7 libsystem_c.dylib 0x00000001a3ab6c84 fgets + 112
8 clangd 0x000000010566701c clang::clangd::(anonymous namespace)::readLine(__sFILE*, llvm::SmallVectorImpl<char>&) + 132
9 clangd 0x0000000105665fc0 clang::clangd::(anonymous namespace)::JSONTransport::loop(clang::clangd::Transport::MessageHandler&) + 688
10 clangd 0x0000000105558b50 clang::clangd::ClangdLSPServer::run() + 44
11 clangd 0x00000001046bc614 main + 10216
12 dyld 0x00000001a38abe50 start + 2544 In contrast, if we do have
Thus I guess the crash report without line number is due to the absence of |
Interesting, thanks for checking. I think the part about needing Reviewing the Discord conversation with Tobias, it was the packages on releases.llvm.org that he said didn't contain debug symbols; if our Github releases do, then maybe there's nothing further to do here. |
Though I guess the awkward part is, to get a local stack trace with line numbers, user needs to combine our binary from a Github package, with Maybe we should include |
Not for Windows. Triggering a crash on Windows still yields nothing for me:
I think we can add extra PDB file for the Windows release, in the way where
Fedora maintains a nightly llvm package with debug symbols that can be found here. I suspect other RedHat distros like CentOS could also benefit from it, but I didn't give it a shot. In addition, the well-known official deb package release provides Unfortunately, we don't have one for Windows. But since the releases.llvm.org points to the release page on Github, I think it's better to submit the issue/request to the main repository?
Sounds reasonable to me. It is convenient for users without llvm-toolchain installed to obtain a glibc-independent and static-linked single binary and putting that into somewhere is rather portable than installing the whole llvm-toolchain, especially if the developing environment is based on a docker image. But what's concerning me is that, given the fact that |
This could help with dumping human-readable backtrace symbols with line no. See also clangd#1641.
Putting PDB file in the binary directory works for me. Exception Code: 0xC0000005
#0 0x00007ff6c79a9b43 clang::Decl::getKind D:\a\clangd\clangd\llvm-project\clang\include\clang\AST\DeclBase.h:435:0
#1 0x00007ff6c79a9b43 clang::CXXRecordDecl::classof D:\a\clangd\clangd\llvm-project\clang\include\clang\AST\DeclCXX.h:1873:0
#2 0x00007ff6c79a9b43 llvm::isa_impl<clang::CXXRecordDecl,clang::RecordDecl,void>::doit D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:64:0
#3 0x00007ff6c79a9b43 llvm::isa_impl_cl<clang::CXXRecordDecl,clang::RecordDecl const *>::doit D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:110:0
#4 0x00007ff6c79a9b43 llvm::isa_impl_wrap<clang::CXXRecordDecl,clang::RecordDecl const *,clang::RecordDecl const *>::doit D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:137:0
#5 0x00007ff6c79a9b43 llvm::isa_impl_wrap<clang::CXXRecordDecl,clang::RecordDecl const * const,clang::RecordDecl const *>::doit D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:127:0
#6 0x00007ff6c79a9b43 llvm::CastIsPossible<clang::CXXRecordDecl,clang::RecordDecl const *,void>::isPossible D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:255:0
#7 0x00007ff6c79a9b43 llvm::CastInfo<clang::CXXRecordDecl,clang::RecordDecl const *,void>::doCastIfPossible D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:493:0
#8 0x00007ff6c79a9b43 llvm::dyn_cast D:\a\clangd\clangd\llvm-project\llvm\include\llvm\Support\Casting.h:663:0
#9 0x00007ff6c79a9b43 clang::ASTContext::getASTRecordLayout(class clang::RecordDecl const *) const D:\a\clangd\clangd\llvm-project\clang\lib\AST\RecordLayoutBuilder.cpp:3308:0
#10 0x00007ff6c795a97f clang::ASTContext::getTypeInfoImpl(class clang::Type const *) const D:\a\clangd\clangd\clangd_20230620\tools\clang\include\clang\AST\TypeNodes.inc:35:0
...omitted... |
Filing this following a suggestion by @tobiashieta on Discord.
This would allow users of the release packages to include more useful stack traces when reporting a crash.
The debug info could be included in the packages by default, or alternatively supplied in a separate package.
The text was updated successfully, but these errors were encountered: