fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x7f73ec663614 pc=0x7f73eb6bf010]
runtime stack:
runtime.throw(0x537da0, 0x2a)
/usr/lib/go/src/runtime/panic.go:527 +0x90
runtime.sigpanic()
/usr/lib/go/src/runtime/sigpanic_unix.go:12 +0x5a
goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x401b90, 0xc820053d20, 0x0)
/usr/lib/go/src/runtime/cgocall.go:120 +0x11b fp=0xc820053cf0 sp=0xc820053cc0
github.com/abh/geoip._Cfunc_GeoIP_country_code_by_addr(0x13b13e0, 0x13b1010, 0x0)
??:0 +0x36 fp=0xc820053d20 sp=0xc820053cf0
github.com/abh/geoip.(*GeoIP).GetCountry(0xc820074000, 0x5136a0, 0xc, 0x0, 0x0, 0x0)
/home/v/go/src/github.com/abh/geoip/geoip.go:311 +0x110 fp=0xc820053d48 sp=0xc820053d20
main.test4.func1(0x5136a0, 0xc, 0x0, 0x0, 0xc820074000)
/home/v/go/src/github.com/vikstrous/tox-crawler/test.go:25 +0x40 fp=0xc820053d80 sp=0xc820053d48
main.test(0xc820053e78, 0x5136a0, 0xc)
/home/v/go/src/github.com/vikstrous/tox-crawler/test.go:29 +0x45 fp=0xc820053e58 sp=0xc820053d80
main.test4(0x13b13e0, 0x0, 0x5136a0, 0xc)
/home/v/go/src/github.com/vikstrous/tox-crawler/test.go:25 +0x81 fp=0xc820053e90 sp=0xc820053e58
main.main()
/home/v/go/src/github.com/vikstrous/tox-crawler/test.go:19 +0x1dd fp=0xc820053f50 sp=0xc820053e90
runtime.main()
/usr/lib/go/src/runtime/proc.go:111 +0x2b0 fp=0xc820053fa0 sp=0xc820053f50
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc820053fa8 sp=0xc820053fa0
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1696 +0x1
exit status 2
package main
import (
"fmt"
"github.com/abh/geoip"
)
func main() {
file6 := "GeoIP.dat"
gi, err := geoip.Open(file6)
if err != nil {
fmt.Printf("Could not open GeoIPv6 database: %s\n", err)
}
if gi != nil {
test4(*gi, "207.171.7.51")
test4(*gi, "127.0.0.1")
}
}
func test4(g geoip.GeoIP, ip string) {
test(func(s string) (string, int) { return g.GetCountry(s) }, ip)
}
func test(f func(string) (string, int), ip string) {
country, netmask := f(ip)
fmt.Printf("ip: %s is [%s] (netmask %d)\n", ip, country, netmask)
}