delve: OS X: cannot get thread count
Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.
-
What version of Delve are you using (
dlv version
)? Delve Debugger Version: 0.11.0-alpha Build: fb8388ab2e50ca28ef9a83c73c329f8d0b6234d9 -
What version of Go are you using? (
go version
)? go version go1.7.1 darwin/amd64 -
What operating system and processor architecture are you using? OS X 10.12.1 Beta (16B2333a) (developer beta 2 Sept 28)
-
What did you do? Tried to debug my app from within Visual Studio Code and from the command line with the same results
-
What did you expect to see? Debugging goodness
-
What did you see instead? From VS Code: 2016/09/29 06:26:35 server.go:71: Using API v1 2016/09/29 06:26:35 debugger.go:61: launching process with args: [./debug -race -tags debug] could not launch process: could not get thread count
From terminal: joefrancia@iMac [6:17:20]: dlv debug could not launch process: could not get thread count
I believe it may be related to the upgrade from Sierra beta 1 to beta 2. I was debuggin a’plenty earlier in the afternoon on my MacBook which was still on beta 1, but when I tried on the iMac I got the above failure. The iMac is beta 2. I’ve since upgraded the MacBook to beta 2 (this was before I realized there may be a problem) and now I get the same error on the MacBook.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 32
- Comments: 82 (7 by maintainers)
Commits related to this issue
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X [WIP] Fixes #645 — committed to aarzilli/delve by deleted user 8 years ago
- proc: new fork_exec(#645) — committed to hydra-zim/delve by hydra-zim 8 years ago
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X [WIP] Fixes #645 — committed to aarzilli/delve by deleted user 8 years ago
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X [WIP] Fixes #645 — committed to aarzilli/delve by aarzilli 8 years ago
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X Fixes #645 — committed to aarzilli/delve by aarzilli 8 years ago
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X Fixes #645 — committed to aarzilli/delve by aarzilli 8 years ago
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X Fixes #645 — committed to aarzilli/delve by aarzilli 8 years ago
- proc: support for ver. 10.12.1 the OS formerly known as Mac OS X Fixes #645 — committed to aarzilli/delve by aarzilli 8 years ago
finally, it works; thanks @aarzilli .great work . My step:
GOPATH
$GOPATH/src/github.com/derekparker/
, and go into this folder.git clone https://github.com/derekparker/delve.git
cd delve
git fetch origin pull/665/head
git checkout FETCH_HEAD
CERT=dlv-cert make install
fuck osx
Just want to throw this in here as an alternative to manually checking out and installing the HEAD version. If you use Homebrew, you can use this to get the HEAD version and automatically generate the cert:
If you used Homebrew previously to install delve, I’d recommend running
brew uninstall delve
first before running the above command.Confirmed that update to 10.12.1 broke it. go version: go1.7.3 darwin/amd64, dlv version: Version: 0.11.0-alpha
Please stop reporting again and again. It is confirmed that delve is now broken on macOS 10.12.1.
两个多月了,已经熟练掌握printf调试
I have no problem on 10.12 at all, but after I updated to 10.12.1 today, the problem occurred.
So, can we get this merged and then we can send a message over to the go-lang-idea-plugin team so they can get this fix in?
I’ve had some luck using PR #665 from @aarzilli. It is still being worked on and you may experience some performance issues and random failures. I haven not had any issues yet but you should be aware of the risks. From a fresh install all you have to do is check out the PR and re-build.
git clone https://github.com/derekparker/delve.git && cd delve
git clone https://github.com/derekparker/delve.git && cd delve
check out the PR:git fetch origin pull/665/head
git checkout FETCH_HEAD
CERT=dlv-cert make install
.@aarzilli I have no time for debugging this issue but found Apple official hints.
Xcode 8.1 Release Notes - Debugging
Maybe
(28476369)
means<rdar://problem/28476369>
, same as LLDB’s commit message. I think we can solve this issue use<Availability.h>
and__MAC_10_12_1
macro, and fixfork_exec
behavior.For ALL This is caused by Security Update for execute arbitrary code with root privileges.
macOS Sierra 10.12.1, Security Update 2016-002 El Capitan, and Security Update 2016-006 Yosemite
It is unlikely that Apple will deal with backward compatibility in the future. We need to change the delve internal.
As @l2dy said, Really please stop short reporting again.
@bx-zhanjh thanks! Your branch works perfect, why not do a pull request? Initially installed Delve through brew and had this exact problem. Fixed it by then following the simple instructions to build his branch. Now I’ve got Webstorm perfectly working with Delve on go 1.7 👍
Just FYI for people who also use Webstorm as their IDE, make sure you symlink to the custom one you’ve built:
ln -s $GOPATH/bin/dlv ~/Library/Application Support/WebStorm2016.3/Go/lib/dlv/mac
because Webstorm sends along their own version of delve.I believe some are too lazy to build it themselves. So here is a zip file containing the executable which seems to work on Mac OS 10.21.1 using go version go1.7.3 darwin/amd64. I hope it helps some of you out there. EDIT: Yep, totally forgot the signature thing. Anyways, @amkoehler has outlined what you need to do to get it working.
Thank you!
@l2dy Thank you, this worked.
To get this working with intellij IDEA 2016.3
Here we backup the original dlv binary, then create a symlink to the newly built PR version. I expect this will also work for any derivitive of Intellij IDEA.
Still broken on 10.12.2, looks like the change might stick.
Updated to Mac OS X 10.12.1 and started seeing this problem.
“/Users/dieterlyd/Library/Application Support/IntelliJIdea2016.2/Go/lib/dlv/mac/dlv” --listen=localhost:50875 --headless=true exec “/private/var/folders/v9/04pc_rsn0gz47hd_ql7r78gm0000gn/T/Build main.go and rungo” – GOROOT=/usr/local/go GOPATH=/Users/dieterlyd/Documents/go /usr/local/go/bin/go build -o “/private/var/folders/v9/04pc_rsn0gz47hd_ql7r78gm0000gn/T/Build main.go and rungo” -gcflags “-N -l” /Users/dieterlyd/Documents/firstGoProject/main.go could not launch process: could not get thread count
@helyho, Great Work~ It can run with vscode and terminal.
go into your GOPATH create folder $GOPATH/src/github.com/derekparker/, and go into this folder. ‘cd $GOPATH/src/github.com/derekparker/’ git clone https://github.com/derekparker/delve.git cd delve git fetch origin pull/665/head git checkout FETCH_HEAD CERT=dlv-cert make install
@bx-zhanjh , Thank you very much!! you resolved my big problem! my step:
and run dlv debug, it’s run ok~
I have tried as @zchee wrote:
It works well!
please see this commit
For reference:
http://sourceware-org.1504.n7.nabble.com/gdb-on-macOS-10-12-quot-Sierra-quot-td415708.html http://llvm.org/viewvc/llvm-project?view=revision&revision=282632
same
Same here. 😦
update the MacOS to 10.12.1 cannot run again ,:)
I’m using IntelliJ IDEA 2016.3.1 These additional steps were required to make it work from IDE:
in your go project path, run follows command
ok, it’s works!
@helyho works on macOS 10.12.2 (16C67).
I think its still broken 😦 No luck
According to their guide the go-lang-idea-plugin state that you can use:
-Dorg.gradle.project.customDlvPath
to use a custom build of delve.
@willis7 Create a self-signed certificate first https://github.com/derekparker/delve/blob/master/Documentation/installation/osx/install.md
I just tried locally and @bx-zhanjh your branch works like expected. Thanks 👍
@aarzilli I understood why the behavior of the Mach task has been changed. It seems for the deal to the vulnerability(exploit).
I only make the kernel debug environment on vmware, not yet tried to fix the code. I do not know whether the same logic can be used. But there is a different method of obtaining the task state, I’ll try it.
I have the same issue with vs code, tried HEAD is not working
macOS Sierra (10.12.1)/IntelliJ Idea 2016.3 - having same issue: could not launch process: could not get thread count
@pangsscn @imnotanderson I got the same as @zuojinmin got: could not launch process: could not attach to 41423
Same Here.
Same here