Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App panic on concurrent map writes (0aaacc2) #1094

Closed
errordeveloper opened this issue Mar 2, 2016 · 4 comments
Closed

App panic on concurrent map writes (0aaacc2) #1094

errordeveloper opened this issue Mar 2, 2016 · 4 comments
Assignees
Labels
bug Broken end user or developer functionality; not working as the developers intended it

Comments

@errordeveloper
Copy link
Contributor

goroutine 2010 [running]:
runtime.throw(0x18221a0, 0x15)
    /usr/local/go/src/runtime/panic.go:530 +0x90 fp=0xc824c05480 sp=0xc824c05468
runtime.mapassign1(0x15d4e00, 0xc824b52240, 0xc824c05638, 0xc824c05ac8)
    /usr/local/go/src/runtime/hashmap.go:445 +0xb1 fp=0xc824c05528 sp=0xc824c05480
github.com/weaveworks/scope/render.containerWithImageNameRenderer.Render(0x7f8e099a1830, 0xc820399910, 0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, ...)
    /go/src/github.com/weaveworks/scope/render/topologies.go:189 +0x3a8 fp=0xc824c05c30 sp=0xc824c05528
github.com/weaveworks/scope/render.(*containerWithImageNameRenderer).Render(0xc820384ce0, 0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, 0xc8223337a0, ...)
    <autogenerated>:68 +0xbb fp=0xc824c05d10 sp=0xc824c05c30
github.com/weaveworks/scope/render.(*Filter).render(0xc825a46020, 0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, 0xc8223337a0, ...)
    /go/src/github.com/weaveworks/scope/render/filters.go:78 +0xee fp=0xc824c069e0 sp=0xc824c05d10
github.com/weaveworks/scope/render.(*Filter).Render(0xc825a46020, 0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, 0xc8223337a0, ...)
    /go/src/github.com/weaveworks/scope/render/filters.go:70 +0x3e fp=0xc824c06ac0 sp=0xc824c069e0
github.com/weaveworks/scope/render.(*memoise).Render(0xc825a46060, 0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, 0xc8223337a0, ...)
    /go/src/github.com/weaveworks/scope/render/memoise.go:35 +0x2c4 fp=0xc824c06c40 sp=0xc824c06ac0
github.com/weaveworks/scope/app.decorateWithStats(0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, 0xc8223337a0, 0xc822bc4300, ...)
    /go/src/github.com/weaveworks/scope/app/api_topologies.go:223 +0x94 fp=0xc824c07050 sp=0xc824c06c40
github.com/weaveworks/scope/app.(*registry).renderTopologies.func1(0x174ed30, 0xa, 0x0, 0x0, 0x7f8e099a1908, 0xc820384ce0, 0x1740060, 0xa, 0x2, 0xc8202f7bc0, ...)
    /go/src/github.com/weaveworks/scope/app/api_topologies.go:207 +0xa8 fp=0xc824c071c0 sp=0xc824c07050
github.com/weaveworks/scope/app.(*registry).walk(0x23691c0, 0xc824c075a8)
    /go/src/github.com/weaveworks/scope/app/api_topologies.go:191 +0x2bc fp=0xc824c07580 sp=0xc824c071c0
github.com/weaveworks/scope/app.(*registry).renderTopologies(0x23691c0, 0xc8210f4090, 0xc82526dd40, 0xc82526dd70, 0xc824c295f0, 0xc824c29620, 0xc824c25bc0, 0xc824c25e00, 0xc82247fe60, 0xc8223337a0, ...)
    /go/src/github.com/weaveworks/scope/app/api_topologies.go:213 +0xa7 fp=0xc824c075d0 sp=0xc824c07580
github.com/weaveworks/scope/app.(*registry).makeTopologyList.func1(0x7f8e0812e410, 0xc821156450, 0x7f8e0812e398, 0xc822f38580, 0xc8201269a0)
    /go/src/github.com/weaveworks/scope/app/api_topologies.go:198 +0xb5 fp=0xc824c077c8 sp=0xc824c075d0
github.com/weaveworks/scope/app.requestContextDecorator.func1(0x7f8e0812e398, 0xc822f38580, 0xc8201269a0)
    /go/src/github.com/weaveworks/scope/app/router.go:37 +0x226 fp=0xc824c078b0 sp=0xc824c077c8
net/http.HandlerFunc.ServeHTTP(0xc820377270, 0x7f8e0812e398, 0xc822f38580, 0xc8201269a0)
    /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc824c078d0 sp=0xc824c078b0
github.com/weaveworks/scope/vendor/github.com/PuerkitoBio/ghost/handlers.GZIPHandler.func1(0x7f8e0812e280, 0xc8201a2270, 0xc8201269a0)
    /go/src/github.com/weaveworks/scope/vendor/github.com/PuerkitoBio/ghost/handlers/gzip.go:127 +0x330 fp=0xc824c07968 sp=0xc824c078d0
net/http.HandlerFunc.ServeHTTP(0xc8203dae40, 0x7f8e0812e280, 0xc8201a2270, 0xc8201269a0)
    /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc824c07988 sp=0xc824c07968
github.com/weaveworks/scope/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc8203d8280, 0x7f8e0812e280, 0xc8201a2270, 0xc8201269a0)
    /go/src/github.com/weaveworks/scope/vendor/github.com/gorilla/mux/mux.go:100 +0x29e fp=0xc824c07aa0 sp=0xc824c07988
github.com/weaveworks/scope/app.TopologyHandler.func1(0x7f8e0812e280, 0xc8201a2270, 0xc8201269a0)
    /go/src/github.com/weaveworks/scope/app/router.go:113 +0xa7 fp=0xc824c07b30 sp=0xc824c07aa0
net/http.HandlerFunc.ServeHTTP(0xc8203db660, 0x7f8e0812e280, 0xc8201a2270, 0xc8201269a0)
    /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc824c07b50 sp=0xc824c07b30
net/http.serverHandler.ServeHTTP(0xc820088c00, 0x7f8e0812e280, 0xc8201a2270, 0xc8201269a0)
    /usr/local/go/src/net/http/server.go:2081 +0x19e fp=0xc824c07bb0 sp=0xc824c07b50
net/http.(*conn).serve(0xc820088880)
    /usr/local/go/src/net/http/server.go:1472 +0xf2e fp=0xc824c07f78 sp=0xc824c07bb0
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc824c07f80 sp=0xc824c07f78
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e
@2opremio
Copy link
Contributor

2opremio commented Mar 2, 2016

It's crashing here

containers[id] = c

And it seems that Go 1.6 is panicking after detecting a race:

$ docker run golang:1.6.0 sed -n '445p' /usr/local/go/src/runtime/hashmap.go 
                throw("concurrent map writes")

Here's a longer excerpt of the code

func mapassign1(t *maptype, h *hmap, key unsafe.Pointer, val unsafe.Pointer) {
        if h == nil {
                panic("assignment to entry in nil map")
        }
        if raceenabled {
                callerpc := getcallerpc(unsafe.Pointer(&t))
                pc := funcPC(mapassign1)
                racewritepc(unsafe.Pointer(h), callerpc, pc)
                raceReadObjectPC(t.key, key, callerpc, pc)
                raceReadObjectPC(t.elem, val, callerpc, pc)
        }
        if msanenabled {
                msanread(key, t.key.size)
                msanread(val, t.elem.size)
        }
        if h.flags&hashWriting != 0 {
                throw("concurrent map writes")
        }
        h.flags |= hashWriting

        alg := t.key.alg
        hash := alg.hash(key, uintptr(h.hash0))

        if h.buckets == nil {
                h.buckets = newarray(t.bucket, 1)
        }

@2opremio 2opremio changed the title App version 0aaacc2 crashing App panic on concurrent map writes (0aaacc2) Mar 2, 2016
@2opremio 2opremio added the bug Broken end user or developer functionality; not working as the developers intended it label Mar 2, 2016
@2opremio
Copy link
Contributor

2opremio commented Mar 2, 2016

@errordeveloper Can you please paste a gist with the full backtrace (i.e. including all the goroutines). I believe it will reveal who is accessing the map concurrently.

@errordeveloper
Copy link
Contributor Author

Full logs.

@paulbellamy
Copy link
Contributor

Probably a duplicate of #1087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken end user or developer functionality; not working as the developers intended it
Projects
None yet
Development

No branches or pull requests

3 participants