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

[OSX 10.8.5] Can't seem to be able to debug a program #160

Closed
hacpai opened this issue Jul 2, 2015 · 21 comments
Closed

[OSX 10.8.5] Can't seem to be able to debug a program #160

hacpai opened this issue Jul 2, 2015 · 21 comments

Comments

@hacpai
Copy link

hacpai commented Jul 2, 2015

Running a process

dlv run
could not launch process: could not fork/exec
[Hope I was of service hunting your bug!]
@hacpai hacpai changed the title OS [OSX 10.8.5] Can't seem to be able to debug a program Jul 2, 2015
@flike
Copy link

flike commented Jul 2, 2015

+1

@derekparker
Copy link
Member

Seems related to #159. Have you signed the binary as per: https://github.com/derekparker/delve/wiki/Building#os-x ?

@hacpai
Copy link
Author

hacpai commented Jul 3, 2015

@derekparker

Run the following: CERT=$mycert make install, which will install the binary and codesign it.

Does it mean enter codesign -s dlv-cert $(which dlv)?

@derekparker
Copy link
Member

@Henry-Zhuang yes, you must codesign the dlv binary before using it on OSX.

@hacpai
Copy link
Author

hacpai commented Jul 4, 2015

@derekparker

 ~/ codesign -s dlv-cert $(which dlv)
/Users/MasterMac/.gvm/pkgsets/system/global/bin/dlv: is already signed
 ~/ dlv run hello.go
Could not compile program: exit status 1
[Hope I was of service hunting your bug!]

@derekparker
Copy link
Member

Looks like go build is failing. Can you compile the program normally?
On Fri, Jul 3, 2015 at 8:14 PM henry-zhuang notifications@github.com
wrote:

@derekparker https://github.com/derekparker

 ~/ codesign -s dlv-cert $(which dlv)
/Users/MasterMac/.gvm/pkgsets/system/global/bin/dlv: is already signed
 ~/ dlv run hello.go
Could not compile program: exit status 1
[Hope I was of service hunting your bug!]


Reply to this email directly or view it on GitHub
https://github.com/derekparker/delve/issues/160#issuecomment-118447587.

@hacpai
Copy link
Author

hacpai commented Jul 4, 2015

@derekparker Yes, I enter go build hello.go

It succeed and run normally.

@derekparker
Copy link
Member

Hmmm, can you send a gist of hello.go? Also dlv run does not take
arguments.
On Fri, Jul 3, 2015 at 8:44 PM henry-zhuang notifications@github.com
wrote:

@derekparker https://github.com/derekparker Yes, I enter go build
hello.go

It succeed and run normally.


Reply to this email directly or view it on GitHub
https://github.com/derekparker/delve/issues/160#issuecomment-118449265.

@hacpai
Copy link
Author

hacpai commented Jul 4, 2015

@derekparker Thank you. It works.

It must run in the only hello.go folder.

@mikepc
Copy link

mikepc commented Jun 16, 2016

I'm on 10.9.5, I have followed all of the instructions and I'm still receiving this error. Looking for ideas. I signed dlv successfully but it is still giving me the same issue. Works fine on my later version mac at home, but at work (I work for Nordstrom corporate) we are locked on OS 10.9.5

I receive the same error when I run as root as well as sudo.

  • The private key is accessible by all applications (make install runs without an issue)
  • The certificate is set to "Always Trust" for everything.

What else can I try?

@britannic
Copy link

If you haven't already checked, make sure you don't have multiple versions of dlv installed, "which -a" is very useful, e.g.:

| => which -a dlv /usr/local/bin/dlv /usr/local/bin/dlv /usr/local/go/bin/dlv /usr/local/go/bin/dlv

@mikepc
Copy link

mikepc commented Jun 16, 2016

x74f@M00973121:$ source /.terminal_startup
x74f@M00973121:
$ cd $GOPATH/src/asf
x74f@M00973121:
/goapi/src/asf$ dlv debug
could not launch process: could not fork/exec
x74f@M00973121:/goapi/src/asf$ which -a dlv /usr/local/bin/dlv /usr/local/bin/dlv /usr/local/go/bin/dlv /usr/local/go/bin/dlv
/usr/local/bin/dlv
/usr/local/bin/dlv
/usr/local/bin/dlv
x74f@M00973121:
/goapi/src/asf$ codesign -s dlv-cert $(which dlv)
/usr/local/bin/dlv: is already signed

@britannic
Copy link

britannic commented Jun 16, 2016

Is " /usr/local/go/bin/dlv" signed also? Its possible that when you execute dlv, " /usr/local/go/bin/dlv" gets called before your signed version (if it isn't already signed the same as "/usr/local/bin/dlv").

@mikepc
Copy link

mikepc commented Jun 16, 2016

Sorry, there is only one, that was part of the other one

x74f@M00973121:/goapi/src/asf$ which -a dlv
/usr/local/bin/dlv
x74f@M00973121:
/goapi/src/asf$

@mikepc
Copy link

mikepc commented Jun 16, 2016

sudo GOPATH=/Users/x74f/goapi dlv debug
Password:
could not launch process: invalid magic number in record at byte 0x0

@mikepc
Copy link

mikepc commented Jun 16, 2016

@mikepc
Copy link

mikepc commented Jun 16, 2016

I uninstalled all versions of delve, and deleted the certificate starting over with a HomeBrew installation.

Now I get the could not launch process: invalid magic number in record at byte 0x0 error consistently.

@britannic
Copy link

Another question, are you compiling native Mac OS X executables or cross compiling for a different architecture?

@mikepc
Copy link

mikepc commented Jun 16, 2016

Native only.

@mikepc
Copy link

mikepc commented Jun 16, 2016

I am able to run dlv exec to get the (dlv) prompt, I just can't run dlv debug

This all started because I'm trying to get Delve to work with VSCode (a setup that works on my home machine)

This is the output from VSCode:
2016/06/16 10:41:08 debugger.go:55: launching process with args: [./debug]
could not launch process: invalid magic number in record at byte 0x0

This is with the homebrew installation of Delve, not a manual one.

go version go1.6.2 darwin/amd64

I believe the issue may be multiple versions of Go installed (manual vs. homebrew) since the homebrew installation is going to install into the homebrew Go etc. I'm working on getting the manual out of there now.

@mikepc
Copy link

mikepc commented Jun 16, 2016

Found it.. package main

I'm good to go. Thank you!

nclifton pushed a commit to nclifton/delve that referenced this issue Feb 24, 2021
…lve#160)

* proto file changes

* integration test

* implemented service method createSenders

* implemented the db sql for createSenders

* integration test assertdb

* db handles empty senders and uses db Sender struct

* can add multiple senders at once (sql statement construction problem)
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

5 participants