We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create a package named "asmcrash" with the following two files:
proc.go
package asmcrash func B() uintptr
proc.s
#include "textflag.h" TEXT @B(SB),NOSPLIT,$0 MOVQ (TLS), AX MOVQ AX, ret+0(FP) RET
(You can replace the @ with other non-alphanumeric characters other than U+00B7 MIDDLE DOT. I originally encountered the bug with U+2022 BULLET.)
Then try to go build the package.
go build
A syntax error message, followed by the go tool exiting cleanly.
# github.com/dpinela/asmcrash ./proc.s:3: expected '(', found B panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x1153970] goroutine 1 [running]: cmd/asm/internal/asm.(*Parser).asmText(0xc420045e98, 0xc420014254, 0x4, 0xc420045c58, 0x3, 0x3) /usr/local/go/src/cmd/asm/internal/asm/asm.go:176 +0x5d0 cmd/asm/internal/asm.(*Parser).pseudo(0xc420045e98, 0xc420014254, 0x4, 0xc420045c58, 0x3, 0x3, 0x3) /usr/local/go/src/cmd/asm/internal/asm/parse.go:230 +0x9a cmd/asm/internal/asm.(*Parser).line(0xc420045e98, 0xc42004e390) /usr/local/go/src/cmd/asm/internal/asm/parse.go:190 +0xa04 cmd/asm/internal/asm.(*Parser).Parse(0xc420045e98, 0xc42004e390, 0x11d7080) /usr/local/go/src/cmd/asm/internal/asm/parse.go:93 +0x2b main.main() /usr/local/go/src/cmd/asm/main.go:69 +0x6ef
Yes. It also reproduces with 1.10rc1. (The error and stack trace are identical on both versions)
go version go1.10rc1 darwin/amd64 GOARCH="amd64" GOBIN="" GOCACHE="/Users/dpinela/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/dpinela/dev/go" GORACE="" GOROOT="/Users/dpinela/sdk/go1.10rc1" GOTMPDIR="" GOTOOLDIR="/Users/dpinela/sdk/go1.10rc1/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/41/2xpv_r1j5n5bnflwb7s1hv580000gp/T/go-build994132333=/tmp/go-build -gno-record-gcc-switches -fno-common" GOROOT/bin/go version: go version go1.10rc1 darwin/amd64 GOROOT/bin/go tool compile -V: compile version go1.10rc1 uname -v: Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 ProductName: Mac OS X ProductVersion: 10.13.2 BuildVersion: 17C88 lldb --version: lldb-900.0.64 Swift-4.0
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/90398 mentions this issue: cmd/asm: fix crash on bad symbol for TEXT
cmd/asm: fix crash on bad symbol for TEXT
Sorry, something went wrong.
8c8bb96
No branches or pull requests
What did you do?
Create a package named "asmcrash" with the following two files:
proc.go
proc.s
(You can replace the @ with other non-alphanumeric characters other than U+00B7 MIDDLE DOT. I originally encountered the bug with U+2022 BULLET.)
Then try to
go build
the package.What did you expect to see?
A syntax error message, followed by the go tool exiting cleanly.
What did you see instead?
Does this issue reproduce with the latest release (go1.9.3)?
Yes. It also reproduces with 1.10rc1. (The error and stack trace are identical on both versions)
System details
The text was updated successfully, but these errors were encountered: