Skip to content
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

[BUG]: Cannot find any debuggable program #1388

Closed
owl-from-hogvarts opened this issue Sep 5, 2023 · 1 comment · Fixed by #1389
Closed

[BUG]: Cannot find any debuggable program #1388

owl-from-hogvarts opened this issue Sep 5, 2023 · 1 comment · Fixed by #1389

Comments

@owl-from-hogvarts
Copy link
Contributor

owl-from-hogvarts commented Sep 5, 2023

I run a program by next command line:

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=54583 -jar ./target/cli-0.1.3-jar-with-dependencies.jar

as error message suggests:
image

Environment
  • Operating System: Arch Linux
  • JDK version: 17.0.8.1
  • Visual Studio Code version: 1.81.1
  • Java extension version: v1.21
  • Java Debugger extension version: v0.54,0
Steps To Reproduce
  1. Setup simple maven program. Add next configuration to .vscode/launch.json:
    {
      "type": "java",
      "request": "attach",
      "name": "Attach by Process ID",
      "processId": "${command:PickJavaProcess}", // notice this line
    },
  1. launch java in terminal (external or internal does not metter) with command like from above (suspend flag also does not change anything)
  2. try launch "Attach by Process ID" configuration

[attach a sample project reproducing the error]
attach logs
client.log.2023-09-05.log
vscode-app-1693937515156.log

Sample project with built java classes

Current Result

Selecting process for debugging by processId can't find debuggable process.
Connection via hostname+port works well. processId does not work even if pid number is provided.

Expected Result

Selecting process by java process picker or pid works

Additional Informations

VScode is installed via snapd
Node js and other debuggers works well.

@owl-from-hogvarts
Copy link
Contributor Author

So, I have debugged issue a little bit. It seems that at least on Arch Linux output format of ps command has slightly changed. Since processTree.ts:132 just substrs each line of ps's output, it miss-interprets information due to whitespaces offsets:
image

On line 137:

let pos = args.indexOf(command);

script does this check which obviously fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant