Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

go.tools/go/types: crash in type checker #8518

Closed
adonovan opened this issue Aug 12, 2014 · 6 comments
Closed

go.tools/go/types: crash in type checker #8518

adonovan opened this issue Aug 12, 2014 · 6 comments

Comments

@adonovan
Copy link
Member

Constants formed from qualified identifiers denoting entities in missing packages have
an invalid type, causing an assertion to fail.  This feels like a regression.

% export GOPATH=$(pwd)
% cat src/a/a.go
package a 

import "missing"

const C = 2 * missing.Minute

% cat src/b/main.go
package main

import "a"

var _ = a.C

% export GOPATH; ssadump b
/home/adonovan/got9/src/a/a.go:3:8: could not import missing (cannot find package
"missing" in any of:
        /home/adonovan/go/src/pkg/missing (from $GOROOT)
        /home/adonovan/got9/src/missing (from $GOPATH))
/home/adonovan/got9/src/a/a.go:5:15: undeclared name: missing
panic: assertion failed [recovered]
        panic: assertion failed

goroutine 1 [running]:
runtime.panic(0x65b960, 0xc208026a40)
        /home/adonovan/go/src/pkg/runtime/panic.c:278 +0xf5
code.google.com/p/go.tools/go/types.(*Checker).handleBailout(0xc20805a000, 0xc2080b7598)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/check.go:202 +0xcd
runtime.panic(0x65b960, 0xc208026a40)
        /home/adonovan/go/src/pkg/runtime/panic.c:247 +0x18d
code.google.com/p/go.tools/go/types.assert(0x7fe011707a00)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/errors.go:18 +0x68
code.google.com/p/go.tools/go/types.(*Checker).recordTypeAndValue(0xc20805a000,
0x7fe01170a2f8, 0xc20800a820, 0xc20800a804, 0x7fe011707a60, 0x8e49c0, 0x7fe01170a7b8,
0x0)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/check.go:256 +0xc2
code.google.com/p/go.tools/go/types.(*Checker).rawExpr(0xc20805a000, 0xc2080490c0,
0x7fe01170a2f8, 0xc20800a820, 0x0, 0x0, 0x0)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/expr.go:932 +0x343
code.google.com/p/go.tools/go/types.(*Checker).expr(0xc20805a000, 0xc2080490c0,
0x7fe01170a2f8, 0xc20800a820)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/expr.go:1426 +0x64
code.google.com/p/go.tools/go/types.(*Checker).varDecl(0xc20805a000, 0xc208042e10,
0xc208040198, 0x1, 0x1, 0x0, 0x0, 0x7fe01170a2f8, 0xc20800a820)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/decl.go:153 +0x2c2
code.google.com/p/go.tools/go/types.(*Checker).objDecl(0xc20805a000, 0x7fe01170a838,
0xc208042e10, 0x0, 0xc2080b74c0, 0x0, 0x8)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/decl.go:76 +0x3a5
code.google.com/p/go.tools/go/types.(*Checker).packageObjects(0xc20805a000,
0xc208026a30, 0x1, 0x1)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/resolver.go:365 +0x203
code.google.com/p/go.tools/go/types.(*Checker).Files(0xc20805a000, 0xc208040078, 0x1,
0x1, 0x0, 0x0)
        /home/adonovan/got2/src/code.google.com/p/go.tools/go/types/check.go:214 +0x100
...
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-tools, release-none.

@gopherbot
Copy link
Contributor

Comment 2:

CL https://golang.org/cl/132310043 mentions this issue.

@griesemer
Copy link
Contributor

Comment 3:

Issue #8169 has been merged into this issue.

@griesemer
Copy link
Contributor

Comment 4:

Status changed to Started.

@griesemer
Copy link
Contributor

Comment 5:

This issue was closed by revision golang/tools@87b4cd9.

Status changed to Fixed.

@griesemer
Copy link
Contributor

Comment 6:

Issue #8169 has been merged into this issue.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants