debug/dwarf: memory leak in dwarf parsing, entries remain on heap #72007
Labels
BugReport
Issues describing a possible bug in the Go implementation.
compiler/runtime
Issues related to the Go compiler and/or runtime.
Go version
1.24.0
Output of
go env
in your module/workspace:I also tried downgrading to go 1.23.6 and the same results occur.
What did you do?
Iterating over entries of DWARF using
Reader.Next()
causes a memory leak where entries remain on the heap even after the returned entry falls out of scope. We've created a simplified test that reproduces this issue. In the test we print memory statistics and show that entry objects remain on the heap.Run command in README:
https://gist.github.com/grantseltzer/74bb893c51b49647cc5315e04b34c381
(Sorry - would put it in go playground but it wasn't working well for it)
Sample output:
What did you see happen?
dwarf.Entry objects remaining on heap after falling out of scope.
What did you expect to see?
GC to clear these objects off the heap.
The text was updated successfully, but these errors were encountered: