Skip to content

cmd/gc: empty slices and strings on stack can cause memory leak #7543

@dvyukov

Description

@dvyukov
This is only a mental experiment.
Empty strings and slices that point after the last element (e.g s2 := s1[len(s1):]) can
produce a pointer to the next memory block. If scanned w/o rich type info, such pointers
will pin the next memory block.
Such scanning happens for stacks (and some runtime frames, e.g. concatstring).
Probably we want set such pointers to nil.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions