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
When accessing a declared, but uninstantiated, map in the Variables view there is a memory leak. Python, neovim, and codelldb begin to use 2+gb of RAM each. Vimspector becomes unresponsive and neovim must be force quit.
Is it reproducible in vim?
Only broken in Neovim
Works with clean config?
Yes
Sample project works?
Reproducible with sample project
Minimal Reproduction
List of steps to reproduce:
Copy and paste the below files into a project eg.cpp
#include <map>
int main() {
auto m = std::map<char, int>();
m['a'] = 0;
return 0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.26)
project("eg")
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# debug and coc-clangd config
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(eg eg.cpp)
# Install targets
install(TARGETS eg DESTINATION bin)
Build the project with cmake . then cmake --build .
In neovim open up eg.cpp
Create a breakpoint at line 4 :call vimspector#SetLineBreakpoint('eg.cpp', 4)
Launch debugging :call vimspector#Launch()
Immediately move to the buffer vimspector.Variables
Under Scope: local try to to open up the m variable by hovering over it and hitting enter/return
Wait or keep hitting enter. It takes a second for the error to appear.
Expected Behaviour
Accessing the variable before it is instantiated should not cause a memory leak.
Or at least if it does the debugger should be able to reset. It currently goes unresponsive.
Actual Behaviour
The debugger (vimspector commands) are no longer responsive, throwing a python eval error. Neovim stays active (unless in tmux which hangs forever).
The processes for neovim, python, and codelldb begin to use excessive amounts of memory. The only way out of this is to force quite the neovim process that originally launched the vimspector session.
If that process is not stopped then any new session that's created will experience the same issue.
Additional information
I'm a c++ novice so wouldn't be surprised if I'm making a mistake somewhere.
I'm happy to contribute if needed!
Installation Type
Other (specify in notes)
Vimspector version
vim-plug. Sorry I'm not sure what you need from git rev-parse HEAD
Debug Info
All commands, including `VimspectorDebugInfo` become unresponsive. Here's the output right before that moment.
[]
--------------------------------------------------------------------------------
Ex Breakpoints:
--------------------------------------------------------------------------------
{
"filters": [
"cpp_throw"
]
}
--------------------------------------------------------------------------------
### Vim version
```Text
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1697887905
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.4/share/nvim"
Run :checkhealth for more info
### Python version
3.11.6 (main, Oct 2 2023, 20:46:14) [Clang 14.0.3 (clang-1403.0.22.14.1)]
### Neovim diagnostics
```Text
==============================================================================
coc: health#coc#check
- OK nvim version satisfied
- OK Environment check passed
- OK Javascript bundle build/index.js found
- OK Service started
==============================================================================
nvim: require("nvim.health").check()
Configuration ~
- OK no issues found
Runtime ~
- OK $VIMRUNTIME: /opt/homebrew/Cellar/neovim/0.9.4/share/nvim/runtime
Performance ~
- OK Build type: Release
Remote Plugins ~
- OK Up to date
terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=^H`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="iTerm.app"
- $COLORTERM="truecolor"
==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v22.9.0 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: Apple clang version 15.0.0 (clang-1500.0.40.1)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "arm64",
release = "23.1.0",
sysname = "Darwin",
version = "Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000"
} ~
Parser/Features H L F I J
- arduino ✓ ✓ ✓ ✓ ✓
- bash ✓ ✓ ✓ . ✓
- c ✓ ✓ ✓ ✓ ✓
- cmake ✓ . ✓ ✓ ✓
- cpp ✓ ✓ ✓ ✓ ✓
- css ✓ . ✓ ✓ ✓
- csv ✓ . . . .
- dockerfile ✓ . . . ✓
- gitignore ✓ . . . ✓
- html ✓ ✓ ✓ ✓ ✓
- htmldjango ✓ . ✓ ✓ ✓
- ini ✓ . ✓ . ✓
- javascript ✓ ✓ ✓ ✓ ✓
- json ✓ ✓ ✓ ✓ .
- lua ✓ ✓ ✓ ✓ ✓
- markdown ✓ . ✓ ✓ ✓
- proto ✓ . ✓ ✓ ✓
- python ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- rust ✓ ✓ ✓ ✓ ✓
- sql ✓ . . ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc ✓ . . . ✓
- yaml ✓ ✓ ✓ ✓ ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang} ~
==============================================================================
provider: health#provider#check
Clipboard (optional) ~
- OK Clipboard tool found: pbcopy
Python 3 provider (optional) ~
- `g:python3_host_prog` is not set. Searching for python3.11 in the environment.
- Executable: /opt/homebrew/bin/python3.11
- Python version: 3.11.6
- pynvim version: 0.5.0
- OK Latest pynvim is installed.
Python virtualenv ~
- OK no $VIRTUAL_ENV
Ruby provider (optional) ~
- Ruby: ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]
- WARNING `neovim-ruby-host` not found.
- ADVICE:
- Run `gem install neovim` to ensure the neovim RubyGem is installed.
- Run `gem environment` to ensure the gem bin directory is in $PATH.
- If you are using rvm/rbenv/chruby, try "rehashing".
- See :help |g:ruby_host_prog| for non-standard gem installations.
- You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim
Node.js provider (optional) ~
- Node.js: v22.9.0
- Nvim node.js host: /opt/homebrew/lib/node_modules/neovim/bin/cli.js
- WARNING Package "neovim" is out-of-date. Installed: 4.10.1, latest: 5.3.0
- ADVICE:
- Run in shell: npm install -g neovim
- Run in shell (if you use yarn): yarn global add neovim
- Run in shell (if you use pnpm): pnpm install -g neovim
Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
- ADVICE:
- See :help |provider-perl| for more information.
- You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim
==============================================================================
vim.lsp: require("vim.lsp.health").check()
- LSP log level : WARN
- Log path: /Users/kylekent/.local/state/nvim/lsp.log
- Log size: 0 KB
vim.lsp: Active Clients ~
- No active clients
==============================================================================
vim.treesitter: require("vim.treesitter.health").check()
- Nvim runtime ABI version: 14
- OK Parser: arduino ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/arduino.so
- OK Parser: bash ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/bash.so
- OK Parser: c ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/c.so
- OK Parser: cmake ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/cmake.so
- OK Parser: cpp ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/cpp.so
- OK Parser: css ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/css.so
- OK Parser: csv ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/csv.so
- OK Parser: dockerfile ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/dockerfile.so
- OK Parser: gitignore ABI: 13, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/gitignore.so
- OK Parser: html ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/html.so
- OK Parser: htmldjango ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/htmldjango.so
- OK Parser: ini ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/ini.so
- OK Parser: javascript ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/javascript.so
- OK Parser: json ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/json.so
- OK Parser: lua ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/lua.so
- OK Parser: markdown ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/markdown.so
- OK Parser: proto ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/proto.so
- OK Parser: python ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/python.so
- OK Parser: query ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/query.so
- OK Parser: rust ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/rust.so
- OK Parser: sql ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/sql.so
- OK Parser: typescript ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/typescript.so
- OK Parser: vim ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/vim.so
- OK Parser: vimdoc ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/vimdoc.so
- OK Parser: yaml ABI: 14, path: /Users/kylekent/.local/share/nvim/plugged/nvim-treesitter/parser/yaml.so
- OK Parser: c ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.4/lib/nvim/parser/c.so
- OK Parser: lua ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.4/lib/nvim/parser/lua.so
- OK Parser: query ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.4/lib/nvim/parser/query.so
- OK Parser: vim ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.4/lib/nvim/parser/vim.so
- OK Parser: vimdoc ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.4/lib/nvim/parser/vimdoc.so
Operating System
Darwin Kyles-MBP-2.attlocal.net 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64
Luckily on further inspection just waiting +30s to let vimspector do its thing allows it to function. The problem must've been running things like :VimspectorRestart in the middle of a process.
This doesn't occur in lldb on its own, so vimspector isn't working as expected. I'm happy to help profile and contribute if needed.
Description
When accessing a declared, but uninstantiated, map in the Variables view there is a memory leak. Python, neovim, and codelldb begin to use 2+gb of RAM each. Vimspector becomes unresponsive and neovim must be force quit.
Is it reproducible in vim?
Only broken in Neovim
Works with clean config?
Yes
Sample project works?
Reproducible with sample project
Minimal Reproduction
List of steps to reproduce:
eg.cpp
CMakeLists.txt
.vimspector.json
cmake .
thencmake --build .
eg.cpp
:call vimspector#SetLineBreakpoint('eg.cpp', 4)
:call vimspector#Launch()
vimspector.Variables
Scope: local
try to to open up them
variable by hovering over it and hitting enter/returnExpected Behaviour
Accessing the variable before it is instantiated should not cause a memory leak.
Or at least if it does the debugger should be able to reset. It currently goes unresponsive.
Actual Behaviour
The debugger (vimspector commands) are no longer responsive, throwing a python eval error. Neovim stays active (unless in tmux which hangs forever).
The processes for neovim, python, and codelldb begin to use excessive amounts of memory. The only way out of this is to force quite the neovim process that originally launched the vimspector session.
If that process is not stopped then any new session that's created will experience the same issue.
Additional information
I'm a c++ novice so wouldn't be surprised if I'm making a mistake somewhere.
I'm happy to contribute if needed!
Installation Type
Other (specify in notes)
Vimspector version
vim-plug. Sorry I'm not sure what you need from git rev-parse HEAD
Debug Info
Operating System
Darwin Kyles-MBP-2.attlocal.net 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64
Declaration
The text was updated successfully, but these errors were encountered: