-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge
Milestone
Description
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version
)?
go version go1.6.2 darwin/amd64 - What operating system and processor architecture are you using (
go env
)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/michaelwalker/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
- What did you do?
package main
import (
"go/parser"
)
func main() {
// This file must exist, or you get an `open` error before the issue happens.
_, _ = parser.ParseFile(nil, "foo.go", nil, 0)
panic("Aha!")
}
- What did you expect to see?
A panic - What did you see instead?
The program terminates with no output.
After putting this through gdb, there's a segfault happening because the first parameter I am passing in to parser.ParseFile
is nil
. This surprises me in two ways: firstly, I generally expect to see "Program terminated due to SIGSEGV" or something when there's a segfault, without needing to resort to a debugger; and secondly the documentation doesn't say that this is invalid.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge