Skip to content

runtime: gcAssistAlloc can call itself recursively #12894

@deft-code

Description

@deft-code

This occurs in Go 1.5.1 possibly 1.5.0 as well.
gcAssistAlloc may decide to sleep for 200us. This results in allocating a timer object and eventually ending up in gcAssistAlloc again.

gcAssistAlloc -> time.Sleep -> builtin.new -> mallocgc -> gcAssistAlloc -> ...

sanitized snippet from debug/pprof/heap?debug=1
# 0x123456 time.Sleep+0x37 go/gc/src/runtime/time.go:53
# 0x123456 runtime.gcAssistAlloc+0x23e go/gc/src/runtime/mgcmark.go:295
# 0x123456 runtime.mallocgc+0x535 go/gc/src/runtime/malloc.go:711
# 0x123456 runtime.newobject+0x42 go/gc/src/runtime/malloc.go:760
# 0x123456 time.Sleep+0x37 go/gc/src/runtime/time.go:53
# 0x123456 runtime.gcAssistAlloc+0x23e go/gc/src/runtime/mgcmark.go:295
# 0x123456 runtime.mallocgc+0x535 go/gc/src/runtime/malloc.go:711
# 0x123456 runtime.newobject+0x42 go/gc/src/runtime/malloc.go:760

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions