Skip to content

cmd/compile: deadlock on syntax error #52127

@tdegris

Description

@tdegris

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

$ go version
go version go1.18 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/opt/go/bin"
GOCACHE="/Users/some_user/Library/Caches/go-build"
GOENV="/Users/some_user/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/opt/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/opt/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/some_user/Temp/base16-go/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cz/mpwjzvhs2s5dfkk3nzj_m8b40000gn/T/go-build187003372=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.18 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.18
uname -v: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
ProductName:	macOS
ProductVersion:	12.2.1
BuildVersion:	21D62
lldb --version: lldb-1316.0.9.41
Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)

What did you do?

Compiling github.com/tdegris/base16-go crashes the compiler. Instructions to reproduce the bug:

$ git clone https://github.com/tdegris/base16-go.git
$ cd base16-go/themes
$ git checkout a21c6cb
$ go build ...

What did you expect to see?

A compile error or a successful compilation. Sometimes, the compilation does return the following (correct) syntax errors:

$ go build ...
# github.com/tdegris/base16-go/themes
./base16-3024.go:23:3: syntax error: unexpected ) at end of statement
./base16-apathy.go:23:3: syntax error: unexpected ) at end of statement
./base16-apprentice.go:23:3: syntax error: unexpected ) at end of statement
./base16-ashes.go:23:3: syntax error: unexpected ) at end of statement
./base16-atelier-cave-light.go:23:3: syntax error: unexpected ) at end of stateme
./base16-atelier-cave.go:23:3: syntax error: unexpected ) at end of statement
./base16-atelier-dune-light.go:23:3: syntax error: unexpected ) at end of stateme
./base16-atelier-dune.go:23:3: syntax error: unexpected ) at end of statement
./base16-atelier-estuary-light.go:23:3: syntax error: unexpected ) at end of stat
./base16-atelier-estuary.go:23:3: syntax error: unexpected ) at end of statement
./base16-atelier-estuary.go:23:3: too many errors

What did you see instead?

# github.com/tdegris/base16-go/themes
fatal error: all goroutines are asleep - deadlock!

See the full stack trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions