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

"no process found with process ID" when trying to debug on Android with 1.11.2 #1220

Open
nisargjhaveri opened this issue Jan 22, 2025 · 4 comments
Labels
platform:android The issue concerns debugging Android applications

Comments

@nisargjhaveri
Copy link
Contributor

OS: Mac/Windows
VSCode version: 1.96.4
CodeLLDB version: 1.11.2
Compiler:
Debuggee: Android app using lldb-server

New issue in 1.11.2. Works fine with 1.11.1 with the same setup.

When trying to debug on Android, it now fails with "Could not attach: no process found with process ID ".

I'm using Android Debug extension to provide the wrapper over CodeLLDB for Android. Here is the effective launch config that should be prepared at the end:

{
    "type": "lldb",
    "name": "Native",
    "request": "attach",
    "pid": "6959",
    "androidTarget": {
        "udid": "RZCX50ZN23H",
        "state": "device",
        "usb": "339738624X",
        "product": "e1sxins",
        "model": "SM_S921B",
        "device": "e1s",
        "transport_id": "1"
    },
    "androidAbi": "arm64-v8a",
    "androidPackageName": "com.example.sampleapplication",
    "symbolSearchPaths": [
        "/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/"
    ],
    "relativePathBase": "/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication",
    "_adapterSettings": {
        "displayFormat": "auto",
        "showDisassembly": "auto",
        "dereferencePointers": true,
        "suppressMissingSourceFiles": true,
        "evaluationTimeout": 5,
        "consoleMode": "commands",
        "sourceLanguages": null,
        "scriptConfig": {},
        "terminalPromptClear": null,
        "evaluateForHovers": true,
        "commandCompletions": true,
        "reproducer": false
    },
    "androidAbiSupported": [
        "armeabi-v7a",
        "arm64-v8a",
        "x86",
        "x86_64"
    ],
    "androidAbiMap": {
        "x86": "droidx86"
    },
    "androidLldbServerSocket": "/com.example.sampleapplication/platform-26049f6d6aa2d77ee7aac4f5b37d8ec0.sock",
    "initCommands": [
        "platform select remote-android",
        "platform connect unix-abstract-connect://[RZCX50ZN23H]/com.example.sampleapplication/platform-26049f6d6aa2d77ee7aac4f5b37d8ec0.sock",
        "process handle SIGBUS SIGSEGV --pass true --stop false --notify false",
        "settings set plugin.jit-loader.gdb.enable off",
        "settings append target.exec-search-paths '/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/'"
    ]
}
Verbose log
Initial debug configuration: {
  type: 'lldb',
  name: 'Native',
  request: 'attach',
  pid: '6959',
  androidTarget: 'RZCX50ZN23H',
  androidAbi: 'arm64-v8a',
  androidPackageName: 'com.example.sampleapplication',
  symbolSearchPaths: [
    '/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/'
  ]
}
Resolved debug configuration: {
  type: 'lldb',
  name: 'Native',
  request: 'attach',
  pid: '6959',
  androidTarget: 'RZCX50ZN23H',
  androidAbi: 'arm64-v8a',
  androidPackageName: 'com.example.sampleapplication',
  symbolSearchPaths: [
    '/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/'
  ],
  relativePathBase: '/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    scriptConfig: {},
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
liblldb: /Users/nisarg/.vscode/extensions/vadimcn.vscode-lldb-1.11.2/lldb/lib/liblldb.dylib
environment: {}
settings: { evaluateForHovers: true, commandCompletions: true }
[DEBUG codelldb] Connecting to 127.0.0.1:59228
[DEBUG codelldb] New debug session
[DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsANSIStyling":true},"type":"request","seq":1}
[DEBUG codelldb::dap_codec] <-- {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"cpp_throw","label":"C++: on throw","supportsCondition":true},{"default":false,"filter":"cpp_catch","label":"C++: on catch","supportsCondition":true}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsClipboardContext":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpointBytes":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsDisassembleRequest":true,"supportsEvaluateForHovers":true,"supportsExceptionFilterOptions":true,"supportsExceptionInfoRequest":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsInstructionBreakpoints":true,"supportsLogPoints":true,"supportsModulesRequest":true,"supportsReadMemoryRequest":true,"supportsRestartRequest":true,"supportsSetVariable":true,"supportsStepInTargetsRequest":true,"supportsSteppingGranularity":true,"supportsWriteMemoryRequest":true}}
[DEBUG codelldb::dap_codec] --> {"command":"attach","arguments":{"type":"lldb","name":"Native","request":"attach","pid":"6959","androidTarget":{"udid":"RZCX50ZN23H","state":"device","usb":"339738624X","product":"e1sxins","model":"SM_S921B","device":"e1s","transport_id":"1"},"androidAbi":"arm64-v8a","androidPackageName":"com.example.sampleapplication","symbolSearchPaths":["/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/"],"relativePathBase":"/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication","_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"scriptConfig":{},"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true,"reproducer":false},"androidAbiSupported":["armeabi-v7a","arm64-v8a","x86","x86_64"],"androidAbiMap":{"x86":"droidx86"},"androidLldbServerSocket":"/com.example.sampleapplication/platform-26049f6d6aa2d77ee7aac4f5b37d8ec0.sock","initCommands":["platform select remote-android","platform connect unix-abstract-connect://[RZCX50ZN23H]/com.example.sampleapplication/platform-26049f6d6aa2d77ee7aac4f5b37d8ec0.sock","process handle SIGBUS SIGSEGV --pass true --stop false --notify false","settings set plugin.jit-loader.gdb.enable off","settings append target.exec-search-paths '/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/'"],"__sessionId":"b2bce951-41ca-4774-a05b-e616c0230b1d"},"type":"request","seq":2}
[DEBUG codelldb::dap_codec] <-- {"seq":2,"type":"event","event":"output","body":{"category":"console","output":"Console is in 'commands' mode, prefix expressions with '?'.\n"}}
[DEBUG codelldb::dap_codec] <-- {"seq":3,"type":"event","event":"output","body":{"category":"console","output":"Executing script: initCommands\n"}}
[DEBUG codelldb::debug_session] platform select remote-android -> SuccessFinishResult, Error:  Success
    Output Message:
      Platform: remote-android
     Connected: no

[DEBUG codelldb::dap_codec] <-- {"seq":4,"type":"event","event":"output","body":{"category":"console","output":" Platform: remote-android\n Connected: no\n\n"}}
[DEBUG codelldb::debug_session] platform connect unix-abstract-connect://[RZCX50ZN23H]/com.example.sampleapplication/platform-26049f6d6aa2d77ee7aac4f5b37d8ec0.sock -> SuccessFinishResult, Error: Success
Output Message:
Platform: remote-android
Triple: aarch64-unknown-linux-android
OS Version: 34 (6.1.75-android14-11)
Hostname: localhost
Connected: yes
WorkingDir: /data/user/0/com.example.sampleapplication
Kernel: #1 SMP PREEMPT Fri Aug 16 09:24:51 UTC 2024

[DEBUG codelldb::dap_codec] <-- {"seq":5,"type":"event","event":"output","body":{"category":"console","output":" Platform: remote-android\n Triple: aarch64-unknown-linux-android\nOS Version: 34 (6.1.75-android14-11)\n Hostname: localhost\n Connected: yes\nWorkingDir: /data/user/0/com.example.sampleapplication\n Kernel: #1 SMP PREEMPT Fri Aug 16 09:24:51 UTC 2024\n\n"}}
[DEBUG codelldb::debug_session] process handle SIGBUS SIGSEGV --pass true --stop false --notify false -> SuccessFinishResult, Error: Success
Output Message:
NAME PASS STOP NOTIFY
=========== ======= ======= =======
SIGBUS true false false
SIGSEGV true false false

[DEBUG codelldb::dap_codec] <-- {"seq":6,"type":"event","event":"output","body":{"category":"console","output":"NAME PASS STOP NOTIFY\n=========== ======= ======= =======\nSIGBUS true false false \nSIGSEGV true false false \n\n"}}
[DEBUG codelldb::debug_session] settings set plugin.jit-loader.gdb.enable off -> SuccessFinishResult, Error: Success
[DEBUG codelldb::debug_session] settings append target.exec-search-paths '/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/build/intermediates/cmake/debug/obj/arm64-v8a/' -> SuccessFinishNoResult, Error: Success
INFO(Python) 13:13:44 lang_support: languages: set()
[DEBUG codelldb::dap_codec] <-- {"seq":7,"type":"event","event":"initialized"}
[DEBUG codelldb::dap_codec] --> {"command":"setBreakpoints","arguments":{"source":{"name":"native-lib.cpp","path":"/Users/nisarg/Projects/vscode-android-debug/examples/SampleApplication/app/src/main/cpp/native-lib.cpp"},"lines":[14],"breakpoints":[{"line":14}],"sourceModified":false},"type":"request","seq":3}
[DEBUG codelldb::dap_codec] <-- {"seq":8,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"message":"Resolved locations: 0","verified":false}]}}
[DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
[DEBUG codelldb::dap_codec] <-- {"seq":9,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
[DEBUG codelldb::dap_codec] --> {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
[DEBUG codelldb::dap_codec] <-- {"seq":10,"type":"response","request_seq":5,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]}}
[DEBUG codelldb::dap_codec] --> {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":6}
[DEBUG codelldb::dap_codec] <-- {"seq":11,"type":"response","request_seq":6,"success":true,"command":"setExceptionBreakpoints"}
[DEBUG codelldb::dap_codec] --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":7}
[DEBUG codelldb::dap_codec] <-- {"seq":12,"type":"response","request_seq":7,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]}}
[DEBUG codelldb::dap_codec] --> {"command":"configurationDone","type":"request","seq":8}
[ERROR codelldb::debug_session] Could not attach: no process found with process ID 6959
[DEBUG codelldb::dap_codec] <-- {"seq":13,"type":"response","request_seq":2,"success":false,"command":"","message":"Could not attach: no process found with process ID 6959","show_user":true}
[DEBUG codelldb::dap_codec] <-- {"seq":14,"type":"response","request_seq":8,"success":true,"command":"configurationDone"}
[DEBUG codelldb::dap_codec] --> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":9}
[DEBUG codelldb::dap_codec] <-- {"seq":15,"type":"response","request_seq":9,"success":true,"command":"disconnect"}
[DEBUG codelldb::dap_session] The client has disconnected
[DEBUG codelldb::debug_session] End of the requests stream
[DEBUG codelldb::debug_session] DebugSession::drop()
[DEBUG codelldb] End of the debug session
[DEBUG codelldb] Exiting
Debug adapter exit code=0 (0x0), signal=null.

@vadimcn
Copy link
Owner

vadimcn commented Jan 22, 2025

Well, the log looks normal, as far as I can tell. I am not familiar with the Android Debug extension though.
Are you sure that process 6959 actually existed?

@nisargjhaveri
Copy link
Contributor Author

Yes, the logs looks very normal. But, the process exists.

Affecting multiple users/machines and downgrading to 1.11.1 works well for all, with everything else intact. I did not see any LLDB version change in changelog as well. Any other recent change that could impact?

@vadimcn vadimcn added the platform:android The issue concerns debugging Android applications label Jan 23, 2025
@weinixuehao
Copy link

weinixuehao commented Jan 24, 2025

  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    scriptConfig: {},
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
[ERROR codelldb::debug_session] Could not attach: no process found with process ID 15240
Debug adapter exit code=0 (0x0), signal=null.

1.11.1 works
latest version(1.11.2) not working

@vadimcn
Copy link
Owner

vadimcn commented Jan 27, 2025

Can you please try adding this to your launch config:

"preRunCommands": [
    "platform process list", 
    "platform process info <pid of the process you want to attach to>",  // If you know it ahead of time
]

See if that clarifies anything...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:android The issue concerns debugging Android applications
Projects
None yet
Development

No branches or pull requests

3 participants