<p dir="auto">by <strong>mdwhatcott</strong>:</p>
<pre class="notranslate">What does 'go version' print?

go version go1.3.3 darwin/amd64

What steps reproduce the problem?

1. go get github.com/mdwhatcott/cycle
2. cd $GOPATH/src/github.com/mdwhatcott/cycle
3. go test -cover

What happened? The go test command hangs indefinitely.

What should have happened instead? It should report a build failure due to an import
cycle.

Please provide any additional information below.

See the README.md file in the "github.com/mdwhatcott/cycle" package for more
details.

I understand that coverage information is only useful when the tests successfully
compile and execute, but in every other failure to compile, the command in step 3 above
reports the problem and exits with a non-zero return status. Why should an import cycle
not cause the same behavior?</pre>
<pre class="notranslate">Present on:

go version devel +52e26bb34741 Sun Aug 04 23:32:40 2013 +0400 freebsd/amd64

and

go version go1.1.1 freebsd/amd64

What steps will reproduce the problem?
This doesn't run on the playground as it is a go tool issue; the input source is:
<a href="http://play.golang.org/p/eZMYWmns3n" rel="nofollow">http://play.golang.org/p/eZMYWmns3n</a>
1. Run go tool cgo -godefs types_freebsd.go


What is the expected output?
Sometimes this output (which I think is correct) is produced:

// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_freebsd.go

package main

type Xtcpcb struct {
        Len     uint64
        Inp     Inpcb
        Tp      _Ctype_struct_tcpcb
        Socket  _Ctype_struct_xsocket
        Alignment_hack  uint64
}
type Inpcb struct {
        Hash    _Ctype_struct___4
        List    _Ctype_struct___5
        Ppcb    *byte
        Pcbinfo *Inpcbinfo
        Socket  *Socket
        Cred    *Ucred
        Flow    uint32
        Flags   int32
        Flags2  int32
        Vflag   uint8
        Ip_ttl  uint8
        Ip_p    uint8
        Ip_minttl       uint8
        Flowid  uint32
        Refcount        uint32
        Pspare  [4]unsafe.Pointer
        Ispare  [4]uint32
        Inc     InConninfo
        Label   *[0]byte
        Sp      *[0]byte
        Depend4 _Ctype_struct___9
        Depend6 _Ctype_struct___10
        Portlist        _Ctype_struct___11
        Phd     *_Ctype_struct_inpcbport
        Gencnt  uint64
        Lle     *[0]byte
        Rt      *[0]byte
        Lock    Rwlock
}
type Inpcbinfo struct {
        Listhead        *_Ctype_struct_inpcbhead
        Count   uint32
        Pad_cgo_0       [4]byte
        Hashbase        *_Ctype_struct_inpcbhead
        Hashmask        uint64
        Porthashbase    *_Ctype_struct_inpcbporthead
        Porthashmask    uint64
        Lastport        uint16
        Lastlow uint16
        Lasthi  uint16
        Pad_cgo_1       [2]byte
        Zone    *[0]byte
        Gencnt  uint64
        Lock    Rwlock
        Vnet    *[0]byte
        Pspare  [2]unsafe.Pointer
}
 
type InConninfo struct {
        Flags   uint8
        Len     uint8
        Fibnum  uint16
        Ie      InEndpoints
}
type InEndpoints struct {
        Fport   uint16
        Lport   uint16
        Dependfaddr     [16]byte
        Dependladdr     [16]byte
}
type Socket struct {
        Count   int32
        Type    int16
        Options int16
        Linger  int16
        State   int16
        Qstate  int32
        Pcb     *byte
        Vnet    *[0]byte
        Proto   *[0]byte
        Head    *Socket
        Incomp  _Ctype_struct___2
        Comp    _Ctype_struct___3
        List    _Ctype_struct___4
        Qlen    uint16
        Incqlen uint16
        Qlimit  uint16
        Timeo   int16
        Error   uint16
        Pad_cgo_0       [6]byte
        Sigio   *[0]byte
        Oobmark uint64
        Aiojobq _Ctype_struct___5
        Rcv     _Ctype_struct_sockbuf
        Snd     _Ctype_struct_sockbuf
        Cred    *Ucred
        Label   *[0]byte
        Peerlabel       *[0]byte
        Gencnt  uint64
        Emuldata        *byte
        Accf    *_Ctype_struct_so_accf
        Fibnum  int32
        Pad_cgo_1       [4]byte
}
type Ucred struct {
        Ref     uint32
        Uid     uint32
        Ruid    uint32
        Svuid   uint32
        Ngroups int32
        Rgid    uint32
        Svgid   uint32
        Pad_cgo_0       [4]byte
        Uidinfo *[0]byte
        Ruidinfo        *[0]byte
        Prison  *[0]byte
        Pspare  *byte
        Flags   uint32
        Pad_cgo_1       [4]byte
        Pspare2 [2]unsafe.Pointer
        Label   *[0]byte
        Audit   AuditinfoAddr
        Groups  *uint32
        Agroups int32
        Pad_cgo_2       [4]byte
}
type Rwlock struct {
        Lock_object     LockObject
        Rw_lock uint64
}
type LockObject struct {
        Name    *int8
        Flags   uint32
        Data    uint32
        Witness *[0]byte
}
type AuditinfoAddr struct {
        Auid    uint32
        Mask    AuMask
        Termid  AuTidAddr
        Asid    int32
        Flags   uint64
}
type AuMask struct {
        Success uint32
        Failure uint32
}
type AuTidAddr struct {
        Port    uint32
        Type    uint32
        Addr    [4]uint32
}

const SizeofXtcpcb = 0x448
const SizeofInpcb = 0x150
const SizeofInpcbinfo = 0x80
const SizeofUcred = 0xa0




What do you see instead?
Sometimes I get:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x28 pc=0x4c73f3]

goroutine 1 [running]:
go/printer.(*printer).expr1(0xc200197780, 0x0, 0x0, 0x0, 0x1, ...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:676 +0x33
go/printer.(*printer).expr(0xc200197780, 0x0, 0x0)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:883 +0x4b
go/printer.(*printer).expr1(0xc200197780, 0xc200178240, 0xc200182e80, 0x0, 0x1, ...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:708 +0x2771
go/printer.(*printer).expr(0xc200197780, 0xc200178240, 0xc200182e80)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:883 +0x4b
go/printer.(*printer).fieldList(0xc200197780, 0xc2001839c0, 0x1)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:442 +0xb11
go/printer.(*printer).expr1(0xc200197780, 0xc200178600, 0xc200182f60, 0x0, 0x1, ...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:842 +0x2bf3
go/printer.(*printer).expr(0xc200197780, 0xc200178600, 0xc200182f60)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:883 +0x4b
go/printer.(*printer).spec(0xc200197780, 0xc200077f00, 0xc200061bd0, 0x1, 0x810719101,
...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:1349 +0x862
go/printer.(*printer).genDecl(0xc200197780, 0xc2000a26c0)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:1394 +0x820
go/printer.(*printer).decl(0xc200197780, 0xc200077e40, 0xc2000a26c0)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:1522 +0xf8
go/printer.(*printer).declList(0xc200197780, 0xc2000a3600, 0x10, 0x20)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:1565 +0x172
go/printer.(*printer).file(0xc200197780, 0xc20009c500)
        /home/wathiede/Downloads/go/src/pkg/go/printer/nodes.go:1573 +0x16d
go/printer.(*printer).printNode(0xc200197780, 0x582340, 0xc20009c500, 0xc2001a9800,
0x43ac9f, ...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/printer.go:1026 +0x7b2
go/printer.(*Config).fprint(0x69e5b0, 0xc2000ab2a0, 0xc20018ec40, 0xc200077480,
0x582340, ...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/printer.go:1165 +0xa6
go/printer.(*Config).Fprint(0x69e5b0, 0xc2000ab2a0, 0xc20018ec40, 0xc200077480,
0x582340, ...)
        /home/wathiede/Downloads/go/src/pkg/go/printer/printer.go:1223 +0x7c
main.(*Package).godefs(0xc20007e750, 0xc20009c000, 0x7fffffffea24, 0x10, 0x0, ...)
        /home/wathiede/Downloads/go/src/cmd/cgo/godefs.go:112 +0xd81
main.main()
        /home/wathiede/Downloads/go/src/cmd/cgo/main.go:274 +0x10dc



Which compiler are you using (5g, 6g, 8g, gccgo)?
cgo built for FreeBSD/amd64

Which operating system are you using?
$  uname -a 
FreeBSD sagan.sf.xinu.tv 8.3-RELEASE-p9 FreeBSD 8.3-RELEASE-p9 #0: Fri Jul 26 23:07:20
UTC 2013     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64



Which version are you using?  (run 'go version')
Present in:

 go version devel +52e26bb34741 Sun Aug 04 23:32:40 2013 +0400 freebsd/amd64

and

  go version go1.1.1 freebsd/amd64

Please provide any additional information below.</pre>