Skip to content

lldb-server fails to connect on version 20.1+ #132024

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

Closed
azais-corentin opened this issue Mar 19, 2025 · 5 comments
Closed

lldb-server fails to connect on version 20.1+ #132024

azais-corentin opened this issue Mar 19, 2025 · 5 comments
Labels

Comments

@azais-corentin
Copy link

azais-corentin commented Mar 19, 2025

Hello,

Since LLVM 20, I'm not able to use remote debugging anymore.

I start the server on one terminal:

lldb-server-20 platform --server --listen *:1234 --min-gdbserver-port 31400 --max-gdbserver-port 31500

Then when I connect, I get the following errors:

> lldb-20
> (lldb) platform select remote-linux
> (lldb) platform connect connect://127.0.0.1:1234
> error: spawn_process failed: execve failed: No such file or directory
> error: Connection shut down by remote side while waiting for reply to initial handshake packet

The exact same steps on LLVM 19 work without any errors.

Please note that the issue seems to be specific to lldb-server since using lldb-20 with lldb-server-19 works.

@llvmbot
Copy link
Member

llvmbot commented Mar 19, 2025

@llvm/issue-subscribers-lldb

Author: Azais Corentin (azais-corentin)

Hello,

Since LLVM 20, I'm not able to use remote debugging anymore.

I start the server on one terminal:

lldb-server-20 platform --server --listen *:1234 --min-gdbserver-port 31400 --max-gdbserver-port 31500

Then when I connect, I get the following errors:

> lldb-20
> (lldb) platform select remote-linux
> (lldb) platform connect connect://127.0.0.1:1234
> error: spawn_process failed: execve failed: No such file or directory
> error: Connection shut down by remote side while waiting for reply to initial handshake packet

The exact same steps on LLVM 19 work without any errors.

Please note that the issue seems to be specific to lldb-server since using lldb-20 with lldb-server-19 works.

@DavidSpickett
Copy link
Collaborator

I think this may have been fixed by #131519.

This solves an issue where running lldb-server-20 with a non-absolute path (for example, when it's installed into /usr/bin and the user runs it as lldb-server-20 ... and not /usr/bin/lldb-server-20 ...) fails with error: spawn_process failed: execve failed: No such file or directory.

The issue fixed in the PR we're currently writing in is a regression introduced in LLVM 20 due to a fundamental change in how lldb-server platform mode works, and so it doesn't make sense to me that it existed 2 years ago.

So if you are able to build a new lldb from the main branch, you can check whether this is the case.

@DavidSpickett
Copy link
Collaborator

I think we should be backporting that change to the 20 branch anyway, so I've requested that. If it fixes this issue too, that's a bonus.

@azais-corentin
Copy link
Author

azais-corentin commented Apr 2, 2025

I tried on LLVM 20.1.1 and using it with an absolute path seems to fix the issue.

I will close this as the two issues are very likely to be the same.

Thanks for your help!

@DavidSpickett
Copy link
Collaborator

I reproduced the issue locally and confirmed that a combination of #131519 and #133093 fixes the problem.

How to reproduce:

  • Build lldb
  • ninja install
  • Make a symlink lldb-server-20 in the install dir
  • Make sure you are somewhere other than the install dir
  • Run the server command using the name lldb-server-20

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

No branches or pull requests

4 participants