'go vet' falls over on expressions like C.f(*p(**q))

Bug #1541014 reported by John Lenton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Medium
Unassigned
golang (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

This file is enough to cause it: http://pastebin.ubuntu.com/14858123/
And this is the result:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x28 pc=0x40b5a3]

goroutine 1 [running]:
main.cgoBaseType(0xc8200cc000, 0x7f5b327dec58, 0xc8200c63e0, 0x0, 0x0)
 /usr/lib/go/src/cmd/vet/cgo.go:75 +0x2d3
main.checkCgoCall(0xc8200cc000, 0x7f5b327de930, 0xc820013300)
 /usr/lib/go/src/cmd/vet/cgo.go:42 +0x1ad
main.(*File).Visit(0xc8200cc000, 0x7f5b327de930, 0xc820013300, 0x0, 0x0)
 /usr/lib/go/src/cmd/vet/main.go:485 +0x1ba
go/ast.Walk(0x7f5b327defd0, 0xc8200cc000, 0x7f5b327de930, 0xc820013300)
 /usr/lib/go/src/go/ast/walk.go:52 +0x56
go/ast.walkExprList(0x7f5b327defd0, 0xc8200cc000, 0xc8200c4380, 0x1, 0x1)
 /usr/lib/go/src/go/ast/walk.go:26 +0xd5
go/ast.Walk(0x7f5b327defd0, 0xc8200cc000, 0x7f5b327df028, 0xc8200c3a90)
 /usr/lib/go/src/go/ast/walk.go:308 +0xf63
go/ast.Walk(0x7f5b327defd0, 0xc8200cc000, 0x7f5b327dea50, 0xc820013340)
 /usr/lib/go/src/go/ast/walk.go:331 +0x1f7d
go/ast.walkDeclList(0x7f5b327defd0, 0xc8200cc000, 0xc8200c43b0, 0x1, 0x1)
 /usr/lib/go/src/go/ast/walk.go:38 +0xd5
go/ast.Walk(0x7f5b327defd0, 0xc8200cc000, 0x7f5b327ded70, 0xc820018600)
 /usr/lib/go/src/go/ast/walk.go:353 +0x29b9
main.(*File).walkFile(0xc8200cc000, 0x7ffc85f63ec0, 0x9, 0xc820018600)
 /usr/lib/go/src/cmd/vet/main.go:454 +0x1f5
main.doPackage(0x7a0178, 0x1, 0xc82000a490, 0x1, 0x1, 0x0)
 /usr/lib/go/src/cmd/vet/main.go:353 +0xd97
main.main()
 /usr/lib/go/src/cmd/vet/main.go:243 +0x420
exit status 2

adding parentheses to that, i.e. C.f((*p(**q))), is enough to make go vet happy again.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: golang-go 2:1.6~beta2-0ubuntu1
ProcVersionSignature: Ubuntu 4.3.0-5.16-generic 4.3.3
Uname: Linux 4.3.0-5-generic x86_64
ApportVersion: 2.19.4-0ubuntu1
Architecture: amd64
Date: Tue Feb 2 16:38:20 2016
InstallationDate: Installed on 2014-04-27 (645 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: golang
SystemImageInfo: Error: command ['system-image-cli', '-i'] failed with exit code 2:
UpgradeStatus: Upgraded to xenial on 2015-06-18 (228 days ago)

Revision history for this message
John Lenton (chipaca) wrote :
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Reproduced. Filed upstream: https://github.com/golang/go/issues/14201. I guess it's very late to get fixed for 1.6 but we'll see...

Changed in golang (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I think this should be fixed in the golang 1.6~rc2 package, can you confirm?

Changed in hundredpapercuts:
status: New → Confirmed
Changed in golang (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
importance: Undecided → Medium
Changed in golang (Ubuntu):
status: Confirmed → Fix Released
Changed in hundredpapercuts:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.