Delve: Version on Homebrew (0.12.1) is currently broken when used with default golang (1.8)

Created on 7 Mar 2017  路  9Comments  路  Source: go-delve/delve

Thanks for Delve! The golang ecosystem really needs this package!

The purpose of this issue is to raise awareness that the current recommended installation method documented in the Delve MacOS install instructions leads to a broken install. This is because the fix for https://github.com/derekparker/delve/issues/664 (and perhaps others) has not yet been released to Homebrew since golang version 1.8 became the default version installed by running brew install go (a dependency of go-delve/delve/delve) on 2/17/2017.

Because issue https://github.com/derekparker/delve/issues/664 has been closed, but the fix has not been released in the month since it was confirmed, new users coming to Delve for the first time on the MacOS environment are treated to a broken install, followed by the wasted effort of trying to figure out why it doesn't work before discovering this fixed and closed, but unreleased, issue (assuming they don't give up before getting that far).

In the interim, installing Delve using brew install --HEAD go-delve/delve/delve seems to work as a stopgap, but being HEAD and not a tagged release, YMMV.

Boilerplate issue info below...

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

Version: 0.12.1 Installed using brew install go-delve/delve/delve as documented in the MacOS install instructions

  1. What version of Go are you using? (go version)?

go version go1.8 darwin/amd64 Installed using brew install go, which is a dependency of go-delve/delve/delve.

  1. What operating system and processor architecture are you using?

OS X 10.11.6 / AMD64

  1. What did you do?

Attempted to set a breakpoint and step through a trivially correct program using the delve CLI.

  1. What did you expect to see?

Correct basic operation (e.g. single stepping)

  1. What did you see instead?
(dlv) s
unexpected fault address 0x6e520050a80
fatal error: fault
> [unrecovered-panic] runtime.startpanic() /usr/local/Cellar/go/1.8/libexec/src/runtime/panic.go:568 (hits goroutine(1):1 total:1) (PC: 0x102a150)
   563:     }
   564:     return nil
   565: }
   566: 
   567: //go:nosplit
=> 568: func startpanic() {
   569:     systemstack(startpanic_m)
   570: }
   571: 
   572: //go:nosplit
   573: func dopanic(unused int) {
prioritP0

Most helpful comment

Will be cutting a new release tomorrow, should solve this issue. Apologies for the delay!

All 9 comments

I am still seeing a panic after using brew install --HEAD go-delve/delve/delve.

VS Code 1.10.2
Go 1.8
macOS 10.12.3

panic: 
runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x400b8a9]
goroutine 1 []:
unicode.init()
    /usr/local/Cellar/go/1.8/libexec/src/unicode/tables.go:3437 +0x2843
bytes.init()
    /usr/local/Cellar/go/1.8/libexec/src/bytes/reader.go:151 +0x50
bufio.init()
    /usr/local/Cellar/go/1.8/libexec/src/bufio/scan.go:409 +0x4b
main.init()
    /Users/nick/code/gopath/src/github.com/foo/bar/cmd/baz/cmd.go:45 +0x6c

VS Code launch config

        {
            "name": "Baz server",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceRoot}/cmd/baz/cmd.go",
            "env": {
                "LOGLEVEL": "debug"
            },
            "args": [
                "server",
                "-v",
                "run"
            ]
        }

@derekparker Any updates on this?

Will be cutting a new release tomorrow, should solve this issue. Apologies for the delay!

Update: the release slipped, current plan is to cut a release tomorrow. Following that, the next update will have a lot of big improvements, especially on OSX.

Homebrew formula has been updated for new release.

go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ahjesus/git/go:/Users/ahjesus/git/work"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/c_/z3wg1g3j4vb48n6vr8t2sv6c0000gp/T/go-build533462621=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

go version
go version go1.8.1 darwin/amd64

vscode
1.11.2 Update

delve
/usr/local/Cellar/delve/0.12.2

vscode-go-debug
Verbose logs are written to:
/var/folders/c_/z3wg1g3j4vb48n6vr8t2sv6c0000gp/T/vscode-go-debug.txt
6:28:52 PM, 4/29/2017
InitializeRequest
InitializeResponse
Using dlv at: /usr/local/bin/dlv
InitializeEvent
SetBreakPointsRequest
SetBreakPointsRequest
All cleared
Creating on: /Users/ahjesus/Git/work/src/webapp/area/admin/controller/product.go:194
Creating on: /Users/ahjesus/Git/work/src/webapp/area/admin/controller/product.go:185
All cleared
Creating on: /Users/ahjesus/Git/work/src/webapp/area/admin/reg.go:31
Error on CreateBreakpoint
Error on CreateBreakpoint
Error on CreateBreakpoint
All set:[null,null]
All set:[null]
SetBreakPointsResponse
SetBreakPointsResponse
ConfigurationDoneRequest
ContinueRequest
ContinueResponse
ThreadsRequest

macOS Sierra 10.12.1 (16B2657)

thanks alot

Hello,
I have the same problem still with
delve 1.0.0.rc1
vscode 1.14.2
F10 step over, or F11 step into not working.
But continuing to next breakpoint with F5 is working.

@guyulmaz without reproduction steps for the command line client or a log from vscode we can't help you.

Was this page helpful?
0 / 5 - 0 ratings