-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
[Go 1.25.3, macOS+Linux]
Found while debugging a production memory ~leak....
https://go.dev/play/p/dQaXA0miYoX
If you make a time.AfterFunc and Stop it, it doesn't zero out its runtime.timer.arg any interface value because you might Reset it later. But if it's Stopped and the P-heaped timer entry is zombied and the *time.Timer is no longer GC-reachable, that zombied heap entry still has that non-zero arg interface until the timer fires. (or until it becomes the min/max in the heap and cleaned)
In the repro above, it puts it in the middle of the heap, so it's not cleaned.
Can we make runtime.newTimer use AddCleanup or something (on the timeTimer wrapper around the runtime.timer) to zero out the arg field for stopped zombie timers?
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Todo