runtime: stack trace line number is wrong #25708
Closed
Labels
Milestone
Comments
cc @dr2chase for line numbers |
This is intentional. We chose to have defers appear to be called at the return from the function, not the place where they were deferred. |
Thanks for replying. But, if you point me to the return line, how would I know that the problem is in my defer that could be miles away? What happens if I have 2 defers in the function? Which of the 2 has the problem? Alex |
Let's discuss on #29797. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version devel +06b3260 Sat Jun 2 18:00:44 2018 +0000 linux/amd64
Does this issue reproduce with the latest release?
I do not know.
What operating system and processor architecture are you using (
go env
)?I use Linux, but I cross-compiled example for Windows.
What did you do?
While debugging #25671 I compiled this program
ktye/goissues@72c9933#diff-3ccd738cae05756fce2ac5ba10cc4800
I then modified d20ef58a6d38 commit of golang.org/x/exp like this:
Then I run the program and that brought main window up, and I clicked "close" button of the window. And I see this stack trace:
What did you expect to see?
I expect stack trace point to the line 48 with
defer w.Release()
What did you see instead?
Stack trace points me to the line 63 with
return
Thank you.
Alex
The text was updated successfully, but these errors were encountered: