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

DLV not starting with: "Could not launch process: fork/exec: function not implemented" #2910

Closed
Bibob7 opened this issue Feb 21, 2022 · 3 comments

Comments

@Bibob7
Copy link

Bibob7 commented Feb 21, 2022

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output,
stacktraces, etc) as linked gists.

  1. What version of Delve are you using (dlv version)?

Delve Debugger
Version: 1.8.1
Build: $Id: d85f1f6b736db99a1c239c34fd4a081dcff08a3c $

  1. What version of Go are you using? (go version)?
    go version go1.17.7 linux/amd64

  2. What operating system and processor architecture are you using?
    Host system:

  • MacOS Monterey 12.2.1
  • Docker Desktop 4.5.0 (74594)
  • M1 Pro (arm64)

Docker Container

  • build with platform: linux/amd64
  • Base Image: golang:1.17-alpine3.15
  1. What did you do?

In the container I build my binary with:

  • go build -gcflags "all=-N -l" -o tapi cmd/tapi/main.go

Then I ran:

  • dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./tapi
  1. What did you expect to see?
  • dlv server is running and I'm able to debug my application
  1. What did you see instead?
API server listening at: [::]:2345
2022-02-21T14:05:02Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
could not launch process: fork/exec ./tapi: function not implemented

I also installed the same dlv and go version directly on my host system and there it is working with the same commands. There is can see:

API server listening at: [::]:2345
2022-02-21T15:08:54+01:00 warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1300.0.42.3
 for arm64.
Got a connection, launched process ./tapi (pid = 14857).
@aarzilli
Copy link
Member

This is a duplicate of docker/for-mac#5191 or something very similar. Nothing we can do anything about.

@aarzilli
Copy link
Member

PS. it looks like qemu has an option to act like a gdbserver; delve also implements the gdb remote server protocol (although it is not directly accessible through the command line) so it should be possible, with some work, to get docker to start qemu in gdbserver mode and then tell delve to connect to it. I don't know the extent to which this would work, delve's gdb server backend does assume that it is running on the same os and architecture as the gdbserver it is connecting to and that would certainly have to be changed.

@M1ddlzh
Copy link

M1ddlzh commented Aug 27, 2022

same issue, wish to find solution😭

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

No branches or pull requests

3 participants