FAQ
Hi, why the code leads to a runtime error?
go version devel +22318cd31d7d Thu Oct 09 17:24:34 2014 +1100 linux/amd64

package main

//
import "C"

func main() {
C.enum__
Error_test_example / Here
Here_ / Test
}

result:
# test
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x413662]

goroutine 1 [running]:
main.(*Package).rewriteRef(0xc208033d40, 0xc208072000)
         /home/mezencevrv/go/src/cmd/cgo/gcc.go:671 +0x2c02
main.(*Package).Translate(0xc208033d40, 0xc208072000)
         /home/mezencevrv/go/src/cmd/cgo/gcc.go:184 +0x229
main.main()
         /home/mezencevrv/go/src/cmd/cgo/main.go:259 +0x14fa
14-10-15 02:10:05 [ERRO] ============== Build failed =========

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Taylor at Oct 15, 2014 at 1:57 pm

    On Wed, Oct 15, 2014 at 1:16 AM, Runix wrote:
    Hi, why the code leads to a runtime error?
    It's a build time error. The cgo tool is crashing when bulding your
    (invalid) program.

    Please file an issue at http://golang.org/issue/new . Thanks.

    Ian
    go version devel +22318cd31d7d Thu Oct 09 17:24:34 2014 +1100 linux/amd64

    package main

    //
    import "C"

    func main() {
    C.enum__
    Error_test_example / Here
    Here_ / Test
    }

    result:
    # test
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal 0xb code=0x1 addr=0x0 pc=0x413662]

    goroutine 1 [running]:
    main.(*Package).rewriteRef(0xc208033d40, 0xc208072000)
    /home/mezencevrv/go/src/cmd/cgo/gcc.go:671 +0x2c02
    main.(*Package).Translate(0xc208033d40, 0xc208072000)
    /home/mezencevrv/go/src/cmd/cgo/gcc.go:184 +0x229
    main.main()
    /home/mezencevrv/go/src/cmd/cgo/main.go:259 +0x14fa
    14-10-15 02:10:05 [ERRO] ============== Build failed =========

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 15, '14 at 8:16a
activeOct 15, '14 at 1:57p
posts2
users2
websitegolang.org

2 users in discussion

Ian Taylor: 1 post Runix: 1 post

People

Translate

site design / logo © 2022 Grokbase