Skip to content

Debugger doesn't stop at breakpoints in VSCode but goes into proc.go gopark() #3747

@DennisMatveyev

Description

@DennisMatveyev

go version - go1.24.2 darwin/amd64 (Sequoia 15.4)
golang.org/x/tools/gopls - v0.18.1
VSCode version - 1.99.0 (but also tried 1.98)
Go extension version - 0.46.1

Tools Configuration

Environment

GOBIN: undefined
toolsGopath:
gopath: /HOME/go
GOROOT: /usr/local/opt/go/libexec
PATH: /usr/local/opt/go/libexec/bin:/usr/local/sbin:/HOME/.local/bin:/usr/local/bin:/HOME/.pyenv/shims:/HOME/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/HOME/go/bin
PATH (vscode launched with): /usr/local/sbin:/HOME/.local/bin:/usr/local/bin:/HOME/.pyenv/shims:/HOME/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/HOME/go/bin

Tools

go:	/usr/local/opt/go/libexec/bin/go: go version go1.24.2 darwin/amd64
gopls:	/HOME/go/bin/gopls	(version: v0.18.1 built with go: go1.24.2)
gotests:	/HOME/go/bin/gotests	(version: v1.6.0 built with go: go1.24.2)
gomodifytags:	/HOME/go/bin/gomodifytags	(version: v1.17.0 built with go: go1.24.2)
impl:	/HOME/go/bin/impl	(version: v1.4.0 built with go: go1.24.2)
goplay:	/HOME/go/bin/goplay	(version: v1.0.0 built with go: go1.24.2)
dlv:	/HOME/go/bin/dlv	(version: v1.24.1 built with go: go1.24.2)
staticcheck:	/HOME/go/bin/staticcheck	(version: v0.6.1 built with go: go1.24.2)

Go env

Workspace Folder (go-url-shortener): /HOME/Projects/golang/go-url-shortener

AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/HOME/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/HOME/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/h5/fp56j4x122x873fpx1gcfs6r0000gn/T/go-build3072058090=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/HOME/Projects/golang/go-url-shortener/go.mod'
GOMODCACHE='/HOME/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/HOME/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/opt/go/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/HOME/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/opt/go/libexec/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.24.2'
GOWORK=''
PKG_CONFIG='pkg-config'

Describe the bug

Actual:
When I set a breakpoint in VSCode and run the debugger, the app starts, but the debugger doesn't stop at the breakpoint at all. Instead, execution lands inside proc.go gopark(), and then continues when I press Continue.
Expected:
Debugger stops at the breakpoint and allows to start debugging.

NOTIONS

  • NO special settings.json editing (just enlarged font size)
  • The app is just simple REST API built with chi router
  • I tried to debug manually with dlv debug, it seems to be working OK (I am novice in Go, maybe something missed)
  • Maybe I am wrong but it seems to me that the crash happened right after MacOS update up to Sequoia 15.4 (it was related with Xcode tools)
  • tried earlier version of VSCode as well, result is the same
  • my launch.json:
    {
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Debug",
    "type": "go",
    "request": "launch",
    "mode": "debug", // tried "auto" as well
    "program": "${workspaceFolder}"
    }
    ]
    }

Steps to reproduce the behavior:

  1. Open a Go project in VSCode
  2. Set a breakpoint where you wish
  3. Start debugger (Launch Package)
  4. Breakpoint is shown as active, but not hit
  5. Execution lands in proc.go:gopark()

What I tried:

Reinstalling VSCode and Go from scratch
Downgrading VSCode to 1.89
dlv debug from terminal → works
Verified which go → /usr/local/bin/go
Verified dlv path → $HOME/go/bin/dlv
Restarted Go Language Server

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions