vscode-bash-debug icon indicating copy to clipboard operation
vscode-bash-debug copied to clipboard

When starts debug it hangs and nothing happens it keeps loading code 1.33

Open NULL0B opened this issue 5 years ago • 48 comments

When starts debug it hangs and nothing happens it keeps loading I think is related to new debugger subsession on code 1.33 works perfect in 1.30

NULL0B avatar Apr 05 '19 07:04 NULL0B

Same for me...

rvuistin avatar Apr 05 '19 07:04 rvuistin

It works fine on vscode 1.32.3

rvuistin avatar Apr 05 '19 07:04 rvuistin

Please provide:

  • launch.json contents (significant part)
  • output of : "showDebugOutput": true, option
  • general info about setup

I just ran it on 1.33 and 1.34-insider + W10, cannot reproduce.

rogalmic avatar Apr 05 '19 07:04 rogalmic

I have to correct myself, it launches only when i debug the extension.

When running directly the extension from store, it fails...

"terminalKind": "debugConsole", "terminalKind": "external" seem to work

rogalmic avatar Apr 05 '19 07:04 rogalmic

This seems to be an issue with VSCode 1.33, since introducing:

ConPTY turned on by default on Windows build 18309+
For supporting versions of Windows 10 Insiders, the new terminal back-end ConPTY will be turned on by default. This should result in a more stable experience closer to the native terminal and adds 256 color support.

Setting "terminal.integrated.windowsEnableConpty": true@settings.json fixed the launch with "terminalKind": "integrated"@launch.json on W10 17763.379 . Not sure if this affects other systems as well, but it might since clearly my system is not 18309+.

rogalmic avatar Apr 05 '19 10:04 rogalmic

for me it still hangs...

my launch.json: "type": "bashdb", "request": "launch", "name": "Bash-Debug (simplest configuration)", "cwd": "${workspaceFolder}", "program": "${file}", "showDebugOutput": true, "terminalKind": "integrated" ,

terminal related config in settings.json: "terminal.integrated.windowsEnableConpty": true, "terminal.integrated.shell.windows": "C:\Windows\System32\bash.exe", "terminal.external.windowsExec": "C:\WINDOWS\System32\bash.exe",

Ikarus76 avatar Apr 05 '19 13:04 Ikarus76

@Ikarus76 ,please provide: launch.json contents (significant part) output of : "showDebugOutput": true, option general info about setup

rogalmic avatar Apr 05 '19 13:04 rogalmic

@Ikarus76 : seems to be issue with bash integrated terminal in this case. "terminal.integrated.shell.windows": "C:\WINDOWS\System32\bash.exe",

Try commenting this out and running with PS.

rogalmic avatar Apr 05 '19 14:04 rogalmic

changes nothing, still hanging

Ikarus76 avatar Apr 05 '19 14:04 Ikarus76

{ "version": "0.2.0", "configurations": [ { "type": "bashdb", "request": "launch", "name": "Bash-Debug (simplest configuration)", "program": "${file}" } ] }

rvuistin avatar Apr 05 '19 14:04 rvuistin

Windows 10 Home Version 1809 OS build 17763.379 Still using winpty

rvuistin avatar Apr 05 '19 14:04 rvuistin

I will need to investigate this more.

Please verify if "terminalKind": "debugConsole" @launch.json works, so that it is terminal related (keeping in mind that debugConsole does not handle stdin).

rogalmic avatar Apr 05 '19 14:04 rogalmic

I will need to investigate this more.

Please verify if "terminalKind": "debugConsole" @launch.json works, so that it is terminal related (keeping in mind that debugConsole does not handle stdin).

same with "terminalKind": "debugConsole"

Ikarus76 avatar Apr 05 '19 15:04 Ikarus76

I just started to use Visual Code and the extension, got the same hang issue. Did a downgrade of VS Code, and all works as expected. Got it from here: https://code.visualstudio.com/updates/v1_32

temporary "workaround" for those that cannot wait until it is back!

tconrado avatar Apr 05 '19 16:04 tconrado

I cannot reproduce the "debugConsole" output issue.

As for "integrated" terminal output, seems that VSCode's this.runInTerminalRequest(...) does not work properly now:

{"title":"Bash Debug Console","cwd":".","args":["wsl.exe","bash","-c","cd \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/testing\"; while [[ ! -p \"/tmp/vscode-bash-debug-fifo-19228\" ]]; do sleep 0.25; done; \"bash\" \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/vscode-bash-debug/bashdb_dir/bashdb\" --quiet --tty \"/tmp/vscode-bash-debug-fifo-19228\" --tty_in \"/tmp/vscode-bash-debug-fifo-19228_in\" --library \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/vscode-bash-debug/bashdb_dir\" -- \"/mnt/d/Users/rogal_000/Documents/src/BashDebugger/testing/test.sh\" "]}

{"type":"response","seq":3,"command":"runInTerminal","request_seq":2,"success":true,"body":{}}

Success is returned, but no debug terminal appears (no terminal run == no bashdb process).

rogalmic avatar Apr 05 '19 18:04 rogalmic

I dont think is related to ConPTY turned on by default on Windows build 18309+ I was using Debian Buster vscode 1.33 Maybe https://microsoft.github.io/debug-adapter-protocol/changelog @rogalmic

NULL0B avatar Apr 05 '19 21:04 NULL0B

Created an issue for VSCode: https://github.com/Microsoft/vscode/issues/71844

@JPRO89-Cu The released version of Bash Debug uses :

    "vscode-debugadapter": "1.33.0",
    "vscode-debugprotocol": "1.33.0"

and works with older version of tool. I tried updating the dependency, but it does not make difference.

It seems that the issue is in terminal implementation itself. It is quite possible that there is another issue as well, since there are reports that setting "terminalKind": "debugConsole"@launch.json does not help (just I cannot reproduce it currently).

I have attached test project zip in ticket, for me only the option without specified terminal fails (W10 17763.404). On different machine W10 17763.379, "terminal.integrated.windowsEnableConpty": true, seemed to make a difference.

Pretty annoying bug :)

rogalmic avatar Apr 06 '19 08:04 rogalmic

i just only set : "terminalKind": "debugConsole"@launch.json and it worked but debug console says /root/.vscode/extensions/rogalmic.bash-debug-0.3.4/bashdb_dir/command/source.sh: line 41: /dev/stdin: No such device or address

NULL0B avatar Apr 06 '19 21:04 NULL0B

@JPRO89-Cu - this is expected, as debugConsole has no stdin.

rogalmic avatar Apr 06 '19 21:04 rogalmic

Same problem on Ubuntu 16.04, vscode 1.33.0. Just installed the extension, tried the simplest configuration and it hangs loading the script.

Adding "terminalKind": "debugConsole" solves the problem.

anatoli26 avatar Apr 08 '19 04:04 anatoli26

Hi, I discovered, that if I use 'args' in the launch.json it hangs. Without args it works. even with integrated terminal.

Ikarus76 avatar Apr 08 '19 15:04 Ikarus76

MacOS 10.14.4 VSCode 1.33.0 Bash: 5.0.3(1)-release Not working

With: "terminalKind": „debugConsole“, works ok. Do you need any logs?

DJManas avatar Apr 09 '19 20:04 DJManas

MacOS 10.14.4 VSCode 1.33.0 bash 5.0.2(1)-release (x86_64-apple-darwin18.2.0) Not working, nothing happens, no stdout

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "bashdb",
            "request": "launch",
            "name": "Bash-Debug (select script from list of sh files)",
            "cwd": "${workspaceFolder}",
            "program": "${command:SelectScriptName}",
            "args": []
        },
        {
            "type": "bashdb",
            "request": "launch",
            "name": "Bash-Debug (hardcoded script name)",
            "cwd": "${workspaceFolder}",
            "program": "${workspaceFolder}/path/to/script.sh",
            "args": []
        },
        {
            "type": "bashdb",
            "request": "launch",
            "name": "Bash-Debug (simplest configuration)",
            "program": "${file}"
        }
    ]
}

klzsysy avatar Apr 10 '19 02:04 klzsysy

There are tickets for VSCode, since running in terminal is done via debugadapter's method. https://github.com/Microsoft/vscode/issues/71844 https://github.com/Microsoft/vscode/issues/71917 https://github.com/Microsoft/debug-adapter-protocol/issues/43

For now as a workaround terminalKind needs to be specified, default config will fail (https://github.com/Microsoft/debug-adapter-protocol/issues/43).

For problems with terminalKind set explicitly "integrated" or "external", please create separate tickets with:

  • system version
  • setting values (if set) for: "terminal.integrated.shell.*" "terminal.integrated.windowsEnableConpty"
  • information from debugging session, if terminal was opened and if there were any errors within terminal window/pane (the actual terminal launch command is visible for user)
  • launch.json contents, the config part that was launched

When changing settings, restart the VSCode just to be safe.

rogalmic avatar Apr 10 '19 09:04 rogalmic

it's work for me.

my laptop: ubuntu: 18.04 vscode: 1.33.1 bash: 4.4.19 bashdb: 4.4-0.92

launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "bashdb", "request": "launch", "terminalKind": "debugConsole", "name": "Bash-Debug (simplest configuration)", "program": "${file}" } ] }

amostsai avatar Apr 24 '19 09:04 amostsai

Setting terminalKind to debugConsole in launch.json fixes the issue for me.

Some information about my system:

  • VSCode version: VSCodium 1.33.0
  • Bash version: 5.0.3(1)
  • bashdb version: 4.4-1.0.1
  • launch.json:
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "bashdb",
            "request": "launch",
            "name": "Bash-Debug (simplest configuration)",
            "program": "${file}",
            "terminalKind": "debugConsole"
        }
    ]
}

EDIT: Setting terminalKind to integrated or external (i.e. any of the other options) also fixes the issue. So it seems that currently the option has to be defined by the user in order for the extension to work properly.

rgeorgiev583 avatar Apr 26 '19 20:04 rgeorgiev583

i just only set : "terminalKind": "debugConsole"@launch.json and it worked but debug console says /root/.vscode/extensions/rogalmic.bash-debug-0.3.4/bashdb_dir/command/source.sh: line 41: /dev/stdin: No such device or address

Hi, I also run into similar case, and @rgeorgiev583's post about setting "terminalKind": "integrated" solved the aforementioned problem. I tested the solution in the following platform:

  • OS: Manjaro Linux 18.0.4 updated to kernel 4.19.42
  • Code: 1.33.1
  • bash: 5.0.7
  • bashdb: 4.4_1.0.1

GeorgeLiou avatar May 20 '19 07:05 GeorgeLiou

Since nothing is going on debugadapter side, I will need to set default value of "terminalKind".

The issue is that value "integrated" has problems inside VSCode (when path contains nan-ascii chars), while "debugConsole" does not allow interactive strips using stdin.

So - how to choose which is better as default ? Voting? :)

rogalmic avatar May 20 '19 10:05 rogalmic

Hmmm...I think I'm having the same problem but setting to "debugConsole" doesn't resolve the issue.

I'm running Ubuntu 18.04, VSC 1.41.1, bash 4.4.19-2ubuntu1.2 amd64. My launch.json file looks like this:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "bashdb",
            "request": "launch",
            "terminalKind": "debugConsole",
            "name": "Bash-Debug (simplest configuration)",
            "program": "${file}",
            "showDebugOutput": true
        }
    ]
}

Debug output looks like this:

(I've trimmed the file paths for where the code resides to /home/dave/code/plugins/lqd-messages/ for readability sake. The full file path would be /home/dave/code/vvv/www/wordpress-one/public_html/wp-content/plugins/lqd-messages

::PROXYID::12183
/home/dave/.vscode/extensions/rogalmic.bash-debug-0.3.6/bashdb_dir/command/source.sh: 
line 41: /dev/stdin: No such device or address
(/home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh:3):
3:	if [ $# -lt 3 ]; then
Debug environment: bash_ver=4.4.20(1)-release, bashdb_ver=4.4-0.94-mod, 
program=/home/dave/.vscode/extensions/rogalmic.bash-debug-0.3.6/bashdb_dir/bashdb, 
args=12186
############################################################
backtrace
->0 in file `/home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh' at line 3
##1 source("/home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh") called from file `/home/dave/.vscode/extensions/rogalmic.bash-debug-0.3.6/bashdb_dir/bashdb' at line 102
##2 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-14185", "--tty_in", "/tmp
/vscode-bash-debug-fifo-14185_in", "--library", "/home/dave/.vscode/extensions
rogalmic.bash-debug-0.3.6/bashdb_dir", "--", "/home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh") called from file 
`/home/dave/.vscode/extensions/rogalmic.bash-debug-0.3.6/bashdb_dir/bashdb' at line 0
12186############################################################
File /home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh loaded.
break </home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh:5 >
Breakpoint 1 set in file /home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh, line 5.
Source files which we have recorded info about:
  /home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh: /home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh, 174 lines
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   /home/dave/code/plugins/lqd-messages/bin/install-wp-tests.sh:5
12186############################################################
Program stopped.
It stopped after being stepped.
Next statement to be run is:
	[ $# -lt 3 ]
examine <$PWD>
/home/dave/code/plugins/lqd-messages/bin
examine <$? # from . "$_Dbg_script_file">
0 # from '. "$_Dbg_script_file"'
12186############################################################
examine <branches>
branches
12186############################################################

Any suggestions?

Thanks!

davidshq avatar Jan 06 '20 20:01 davidshq

@davidshq The log seems ok, everything was exeuted as it should be (this is not the terminal issue). Any chance to get the traces of communication between VSCode-debugadapter?

To get the trace add the line to launch.json:

"trace": true

rogalmic avatar Jan 06 '20 21:01 rogalmic