Skip to content

Embedded struct is created when necessary #28

@oschwald

Description

@oschwald

I think this is a new issue with the indirect() change.

2016/07/11 09:14:40 panic: reflect: reflect.Value.Set using unaddressable value
Stack trace:
goroutine 34 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x80
github.com/valyala/fasthttp.(*workerPool).workerFunc.func1(0xc820096280, 0xc820151ed0)
    /home/greg/MaxMind/go/src/github.com/valyala/fasthttp/workerpool.go:207 +0x53
panic(0x7a5a80, 0xc8201239f0)
    /usr/local/go/src/runtime/panic.go:426 +0x4e9
reflect.flag.mustBeAssignable(0x16)
    /usr/local/go/src/reflect/value.go:229 +0x221
reflect.Value.Set(0x8905e0, 0x0, 0x16, 0x8905e0, 0xc820132300, 0x16)
    /usr/local/go/src/reflect/value.go:1328 +0x25
github.com/oschwald/maxminddb-golang.(*decoder).indirect(0xc820012c00, 0x8905e0, 0x0, 0x16, 0x0, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.com/oschwald/maxminddb-golang/decoder.go:147 +0x176
github.com/oschwald/maxminddb-golang.(*decoder).decodeFromType(0xc820012c00, 0x7, 0x1, 0xe577, 0x785ba0, 0xc8201239e0, 0x16, 0x75f2d9c, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.com/oschwald/maxminddb-golang/decoder.go:87 +0x69
github.com/oschwald/maxminddb-golang.(*decoder).decode(0xc820012c00, 0xe576, 0x785ba0, 0xc8201239e0, 0x16, 0x10, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.com/oschwald/maxminddb-golang/decoder.go:43 +0x1c2
github.com/oschwald/maxminddb-golang.(*Reader).Decode(0xc820012be0, 0xe576, 0x785ba0, 0xc8201239e0, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.com/oschwald/maxminddb-golang/reader.go:152 +0x135
github.com/oschwald/maxminddb-golang.(*Reader).retrieveData(0xc820012be0, 0x1498ca, 0x785ba0, 0xc8201239e0, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.com/oschwald/maxminddb-golang/reader.go:236 +0x90
github.com/oschwald/maxminddb-golang.(*Reader).Lookup(0xc820012be0, 0xc820123290, 0x10, 0x10, 0x785ba0, 0xc8201239e0, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.com/oschwald/maxminddb-golang/reader.go:114 +0xa1
github.maxmind.com/maxmind/mm_website.git/go/geoip2-daemon/model.(*DbReader).lookupCity(0xc8200175f0, 0xc820123290, 0x10, 0x10, 0x7fe6fbc68340, 0xc820128230, 0x403d38, 0x0, 0x0)
    /home/greg/MaxMind/go/src/github.maxmind.com/maxmind/mm_website.git/go/geoip2-daemon/model/db.go:148 +0x19f
github.maxmind.com/maxmind/mm_website.git/go/geoip2-daemon/model.(*DbReader).CityV20(0xc8200175f0, 0xc820123290, 0x10, 0x10, 0xffffffffffffff01, 0xc820123290, 0x0, 0x0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions