New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: stack trace line number is wrong #25708

alexbrainman opened this Issue Jun 3, 2018 · 1 comment


None yet
2 participants

alexbrainman commented Jun 3, 2018

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


I then modified d20ef58a6d38 commit of like this:

diff --git a/shiny/driver/internal/win32/win32.go b/shiny/driver/internal/win32/win32.go
index 3fc939b..d611853 100644
--- a/shiny/driver/internal/win32/win32.go
+++ b/shiny/driver/internal/win32/win32.go
@@ -12,6 +12,7 @@ package win32 // import ""
 import (
+	"runtime/debug"
@@ -118,7 +119,9 @@ func Show(hwnd syscall.Handle) {
 func Release(hwnd syscall.Handle) {
 	// TODO(andlabs): check for errors from this?
 	// TODO(andlabs): remove unsafe
-	_DestroyWindow(hwnd)
+	err := _DestroyWindow(hwnd)
+	fmt.Printf("ALEX: %v\n", err)
+	debug.PrintStack()
 	// TODO(andlabs): what happens if we're still painting?

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:

2018/06/03 12:09:23 received lifecycle.Event{From:StageFocused, To:StageDead, DrawContext:<nil>}: window 0xc000092000 should be closing now
ALEX: Access is denied.
goroutine 18 [running]:
runtime/debug.Stack(0x9, 0xc00008dd30, 0x1)
        /home/a/go/src/runtime/debug/stack.go:24 +0xae
        /home/a/go/src/runtime/debug/stack.go:16 +0x29
        /home/a/src/ +0x95*windowImpl).Release(0xc000092000)
        /home/a/src/ +0x35
main.createWindow(0x510180, 0x5b9680, 0x0)
        /home/a/src/ +0x4d6
main.main.func1(0x510180, 0x5b9680)
        /home/a/src/ +0x41
        /home/a/src/ +0x44
        /home/a/src/ +0x30
created by
        /home/a/src/ +0x123


What did you expect to see?

I expect stack trace point to the line 48 with defer w.Release()

        /home/a/src/ ....

What did you see instead?

Stack trace points me to the line 63 with return

        /home/a/src/ +0x4d6

Thank you.



This comment has been minimized.


josharian commented Jun 3, 2018

cc @dr2chase for line numbers

@josharian josharian added this to the Go1.12 milestone Jun 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment