puremourning / vimspector

vimspector - A multi-language debugging system for Vim
http://puremourning.github.io/vimspector-web
Apache License 2.0
4.1k stars 173 forks source link

Bash debugging not working in vim - "The server has terminated with status 122" #866

Closed w11d closed 4 months ago

w11d commented 4 months ago

Description

Attempting to start debugger for bash files results in Initializing debug session [name] (0)... indefinitely, log indicates:

2024-06-07 00:21:46,408 - INFO - debug_session.py:2049 - 0 - The server has terminated with status 122

Is it reproducible in vim?

Reproducible in Vim

Works with clean config?

Yes

Sample project works?

Reproducible with sample project

Minimal Reproduction

./run_test_vim bash/test_script

Expected Behaviour

Debugger to start and be connected to vim

Actual Behaviour

Debugger window displays Initializing debug session [name] (0)...

Additional information

Thank you for Vimspector - I love it for python!

Installation Type

Vim packages (git clone)

Vimspector version

c37d50fc463013bdad2ba044615b0bc2ce163681

Debug Info

:VimspectorDebugInfo with the 'hung' debug window up results in `Vimspector not connected, start a debug session first`

Log file

2024-06-07 00:28:40,654 - INFO - debug_session.py:128 - 0 - **** INITIALISING NEW VIMSPECTOR SESSION FOR ID 0 ****
2024-06-07 00:28:40,654 - INFO - debug_session.py:130 - 0 - API is: 
2024-06-07 00:28:40,654 - INFO - debug_session.py:131 - 0 - VIMSPECTOR_HOME = /home/bill/.vim/pack/puremourning/start/vimspector/python3/vimspector/../..
2024-06-07 00:28:40,657 - INFO - debug_session.py:132 - 0 - gadgetDir = /home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux
2024-06-07 00:28:40,658 - INFO - debug_session.py:226 - 0 - User requested start debug session with {}
2024-06-07 00:28:40,659 - DEBUG - debug_session.py:187 - 0 - Reading configurations from: None
2024-06-07 00:28:40,659 - DEBUG - debug_session.py:187 - 0 - Reading configurations from: /home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash/.vimspector.json
2024-06-07 00:28:40,661 - DEBUG - debug_session.py:250 - 0 - Reading gadget config: /home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/.gadgets.json
2024-06-07 00:28:40,668 - DEBUG - debug_session.py:250 - 0 - Reading gadget config: None
2024-06-07 00:28:42,050 - DEBUG - utils.py:633 - None - Returning gadgetDir from the map for gadgetDir with args ()
2024-06-07 00:28:42,050 - DEBUG - utils.py:633 - None - Returning file from the map for file with args ()
2024-06-07 00:28:42,050 - DEBUG - utils.py:684 - None - Put fileDirname into mapping for fileDirname with args ()
2024-06-07 00:28:42,051 - DEBUG - utils.py:633 - None - Returning fileDirname from the map for fileDirname with args ()
2024-06-07 00:28:42,898 - DEBUG - utils.py:714 - None - Value for args not set in ${args} (from ${args}): set to 
2024-06-07 00:28:42,898 - DEBUG - utils.py:633 - None - Returning args from the map for args with args ()
2024-06-07 00:28:42,898 - DEBUG - utils.py:633 - None - Returning gadgetDir from the map for gadgetDir with args ()
2024-06-07 00:28:42,898 - DEBUG - utils.py:633 - None - Returning workspaceRoot from the map for workspaceRoot with args ()
2024-06-07 00:28:42,898 - DEBUG - utils.py:633 - None - Returning BASHDB_HOME from the map for BASHDB_HOME with args ()
2024-06-07 00:28:42,898 - DEBUG - utils.py:633 - None - Returning BASHDB_HOME from the map for BASHDB_HOME with args ()
2024-06-07 00:28:42,899 - DEBUG - utils.py:633 - None - Returning file from the map for file with args ()
2024-06-07 00:28:42,899 - INFO - debug_session.py:485 - 0 - Configuration: {"adapter": "vscode-bash", "autoselect": false, "configuration": {"request": "launch", "program": "/home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash/test_script", "cwd": "/home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash", "args": []}}
2024-06-07 00:28:42,899 - INFO - debug_session.py:487 - 0 - Adapter: {"command": ["node", "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/out/bashDebug.js"], "configuration": {"args": [], "argsString": "", "cwd": "/home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash", "env": {}, "pathBash": "bash", "pathBashdb": "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/bashdb_dir/bashdb", "pathBashdbLib": "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/bashdb_dir", "pathCat": "cat", "pathMkfifo": "mkfifo", "pathPkill": "pkill", "program": "/home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash/test_script", "request": "launch", "terminalKind": "integrated", "type": "bashdb"}, "name": "bashdb"}
2024-06-07 00:28:42,900 - DEBUG - debug_session.py:1203 - 0 - min_width/height: 149/50, actual: 209/38 - result: horizontal
2024-06-07 00:28:42,909 - DEBUG - debug_session.py:1787 - 0 - LAUNCH!
2024-06-07 00:28:42,910 - INFO - debug_session.py:1402 - 0 - Starting debug adapter with: {"command": ["node", "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/out/bashDebug.js"], "configuration": {"args": [], "argsString": "", "cwd": "/home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash", "env": {}, "pathBash": "bash", "pathBashdb": "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/bashdb_dir/bashdb", "pathBashdbLib": "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/bashdb_dir", "pathCat": "cat", "pathMkfifo": "mkfifo", "pathPkill": "pkill", "program": "/home/bill/.vim/pack/puremourning/start/vimspector/support/test/bash/test_script", "request": "launch", "terminalKind": "integrated", "type": "bashdb"}, "name": "bashdb"}
2024-06-07 00:28:42,910 - DEBUG - debug_session.py:1421 - 0 - Connection Type: job
2024-06-07 00:28:42,912 - INFO - debug_session.py:1505 - 0 - Debug Adapter Started
2024-06-07 00:28:42,912 - DEBUG - debug_adapter_connection.py:205 - 0 - Sending Message: {"command": "initialize", "arguments": {"adapterID": "bashdb", "clientID": "vimspector", "clientName": "vimspector", "linesStartAt1": true, "columnsStartAt1": true, "locale": "en_GB", "pathFormat": "path", "supportsVariableType": true, "supportsVariablePaging": false, "supportsRunInTerminalRequest": true, "supportsMemoryReferences": true, "supportsStartDebuggingRequest": true}, "seq": 0, "type": "request"}
2024-06-07 00:28:42,912 - INFO - debug_session.py:2049 - 0 - The server has terminated with status 122
2024-06-07 00:28:42,912 - DEBUG - debug_adapter_connection.py:162 - 0 - Closing down: Aborting request {'command': 'initialize', 'arguments': {'adapterID': 'bashdb', 'clientID': 'vimspector', 'clientName': 'vimspector', 'linesStartAt1': True, 'columnsStartAt1': True, 'locale': 'en_GB', 'pathFormat': 'path', 'supportsVariableType': True, 'supportsVariablePaging': False, 'supportsRunInTerminalRequest': True, 'supportsMemoryReferences': True, 'supportsStartDebuggingRequest': True}, 'seq': 0, 'type': 'request'}
2024-06-07 00:28:42,913 - DEBUG - debug_session.py:2072 - 0 - No server exit handler
2024-06-07 00:29:58,786 - DEBUG - debug_session.py:620 - 0 - Stop debug adapter with callback: _Reset
2024-06-07 00:29:58,786 - INFO - debug_session.py:662 - 0 - Debugging complete.
2024-06-07 00:29:58,786 - DEBUG - debug_session.py:665 - 0 - Clearing down UI

Vim version

VIM - Vi IMproved 8.1 (2018 May 18, compiled May 03 2024 02:36:35)
Included patches: 1-213, 1840, 214-579, 1969, 580-1848, 4975, 5023, 2110, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-2111, 2111-2112, 2112-2269, 3612, 3625, 3669, 3741, 1847
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       -tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
-balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
-browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     -perl              -toolbar
+cindent           +job               +persistent_undo   +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          -ruby              +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      +sound             -xfontset
+digraphs          +mouse             +spell             -xim
-dnd               -mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        +mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary        
+extra_search      +mouse_sgr         -tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-XSjhdc/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lcanberra -lacl -lattr -lgpm -ldl     -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm

Python version

3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0]

Neovim diagnostics

n/a

Operating System

Linux tyro 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Declaration

w11d commented 4 months ago

£10.00 GBP to Hector's Greyhound Rescue - :dog: :heart:

puremourning commented 4 months ago

./run_test_vim bash/test_script

Hmm well it works for me(TM)

https://asciinema.org/a/pawCKJXmCsZUt7n7j0YQVs740

can you try running the server manually and see what happens?

"node" "/home/bill/.vim/pack/puremourning/start/vimspector/gadgets/linux/vscode-bash-debug/out/bashDebug.js"
w11d commented 4 months ago

Aha! I didn't have nodejs installed, and installing it fixed the issue - must have missed this step in the docs. Thanks again!