You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I detected critical memory leak in CCLS. I use Arch Linux on linux-zen 6.8.8 kernel. CPU - AMD FX-8350, 16GB RAM. I compiled clang-git from AUR with enabled -fsanitize=address to get report when it crashes. Yes, every save (probably) CCLS run 2-4 more jobs without ending others, so after some time i get over 200 jobs on small project, containing several hundreds of lines of code. In this time CCLS uses 1.5GB of RAM and 30TB of virtual RAM. Then it crashes with following reports:
=================================================================
==21974==ERROR: AddressSanitizer: requested allocation size 0x7e750f672170 (0x7e750f673170 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T5)
#0 0x5d678ae3dd89 in malloc (/usr/bin/ccls+0x126d89) (BuildId: 26bd40cd47bdaebbefcf51c149c7159af78c7241)
#1 0x7e750fedec48 in llvm::SmallVectorBase<unsigned long>::grow_pod(void*, unsigned long, unsigned long) (/usr/lib/libLLVM-17.so+0x6dec48) (BuildId: 23cd725c53bbcb975bb284794c263d7ee44cbd7f)
==21974==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big (/usr/bin/ccls+0x126d89) (BuildId: 26bd40cd47bdaebbefcf51c149c7159af78c7241) in malloc
Thread T5 created by T0 here:
#0 0x5d678ae34fa8 in pthread_create (/usr/bin/ccls+0x11dfa8) (BuildId: 26bd40cd47bdaebbefcf51c149c7159af78c7241)
#1 0x5d678af8ac5c in ccls::spawnThread(void* (*)(void*), void*) /usr/src/debug/ccls-git/ccls/src/platform_posix.cc:75:3
#2 0x5d678affa7bd in ccls::SemaManager::SemaManager(ccls::Project*, ccls::WorkingFiles*, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<ccls::Diagnostic, std::allocator<ccls::Diagnostic>>)>, std::function<void (ccls::RequestId)>) /usr/src/debug/ccls-git/ccls/src/sema_manager.cc:762:3
#3 0x5d678af70ea1 in ccls::pipeline::mainLoop() /usr/src/debug/ccls-git/ccls/src/pipeline.cc:625:15
#4 0x5d678aea3610 in main /usr/src/debug/ccls-git/ccls/src/main.cc:146:7
#5 0x7e750f241ccf (/usr/lib/libc.so.6+0x25ccf) (BuildId: 6542915cee3354fbcf2b3ac5542201faec43b5c9)
==21974==ABORTING
ccls server connection was closed
[Error - 7:06:19 PM] Connection to server got closed. Server will not be restarted.
[Error - 7:06:19 PM] Request textDocument/completion failed.
Error: Connection got disposed.
at Object.dispose (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageWriter.fireClose (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/messageWriter.js:39:27)
at Socket.<anonymous> (/home/hyperwin/.vscode-oss/extensions/ccls-project.ccls-0.1.29-universal/node_modules/vscode-jsonrpc/lib/messageWriter.js:58:46)
at Socket.emit (node:events:517:28)
at Pipe.<anonymous> (node:net:350:12)
Observed behavior
I detected critical memory leak in CCLS. I use Arch Linux on linux-zen 6.8.8 kernel. CPU - AMD FX-8350, 16GB RAM. I compiled clang-git from AUR with enabled -fsanitize=address to get report when it crashes. Yes, every save (probably) CCLS run 2-4 more jobs without ending others, so after some time i get over 200 jobs on small project, containing several hundreds of lines of code. In this time CCLS uses 1.5GB of RAM and 30TB of virtual RAM. Then it crashes with following reports:
compile_commands.json:
Expected behavior
It supposed to be stable, isnt it?
Steps to reproduce
System information
CCLS:
CLang:
OS:
Editor:
CCLS extension version v0.1.29
The text was updated successfully, but these errors were encountered: