runtime: panic stack trace includes closure from method value #24488
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
It's may also be reproduced by examining the call stack of a panic. For example:
https://play.golang.org/p/579SSX2Vx5t
What did you expect to see?
What did you see instead?
This is a problem for code that expects to reliably count frames on the stack based on the function calls actually made (e.g. logging modules that want to track file/line of the caller). When artificial frames are injected into the call stack (due to passing around a function reference and later invoking it) this becomes confusing and hard to deal with when attempting to determine the file/line of the caller. It also seems semantically incorrect: the assignment of func Bar to a variable IS NOT a call to the function, so it should not be in the caller stack.
The text was updated successfully, but these errors were encountered: