You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1, What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.9.1
Build: $Id: d81b9fd12bfa603f3cf7a4bc842398bd61c42940 $
2, What version of Go are you using? (go version)?
go version devel go1.20-75cdd2c75d Wed Aug 24 02:54:32 2022 +0000 linux/arm64
3, What operating system and processor architecture are you using?
linux arm64, kernel version: 5.15.52-051552-generic-64k
4, What did you do?
$ cat main.go
`package main
import(
"fmt"
)
func foo(a, b string) string {
var arr [10000]string
for i := 0; i < 10000; i++ {
arr[i] = a + b
}
return arr[90]
}
func main() {
s := ""
for i := 0; i < 1000; i++ {
s += foo("a", "b")
}
fmt.Println(s)
}
`
$ go build -o main main.go
$ dlv exec ./main
$ b morestack_noctxt
$ c
$ bt
5, What did you expect to see?
Normal stack tracing info
6, What did you see instead?
0 0x0000000000069d10 in runtime.morestack_noctxt
at ./go-master/src/runtime/asm_arm64.s:323
1 0x0000000000058ff0 in runtime.concatstring2
at :0
2 0x0000000000058ff0 in runtime.concatstring2
at :0
3 0x0000000000058ff0 in runtime.concatstring2
at :0
4 0x0000000000058ff0 in runtime.concatstring2
at :0
5 0x0000000000058ff0 in runtime.concatstring2
at :0
6 0x0000000000058ff0 in runtime.concatstring2
at :0
7 0x0000000000058ff0 in runtime.concatstring2
at :0
8 0x0000000000058ff0 in runtime.concatstring2
at :0
9 0x0000000000058ff0 in runtime.concatstring2
at :0
10 0x0000000000058ff0 in runtime.concatstring2
at :0
11 0x0000000000058ff0 in runtime.concatstring2
at :0
12 0x0000000000058ff0 in runtime.concatstring2
at :0
13 0x0000000000058ff0 in runtime.concatstring2
at :0
14 0x0000000000058ff0 in runtime.concatstring2
at :0
Sending output to pager...
0 0x0000000000069d10 in runtime.morestack_noctxt
at ./go-master/src/runtime/asm_arm64.s:323
1 0x0000000000058ff0 in runtime.concatstring2
at :0
2 0x0000000000058ff0 in runtime.concatstring2
at :0
3 0x0000000000058ff0 in runtime.concatstring2
at :0
4 0x0000000000058ff0 in runtime.concatstring2
at :0
5 0x0000000000058ff0 in runtime.concatstring2
at :0
6 0x0000000000058ff0 in runtime.concatstring2
at :0
7 0x0000000000058ff0 in runtime.concatstring2
at :0
8 0x0000000000058ff0 in runtime.concatstring2
at :0
9 0x0000000000058ff0 in runtime.concatstring2
at :0
10 0x0000000000058ff0 in runtime.concatstring2
at :0
11 0x0000000000058ff0 in runtime.concatstring2
at :0
The text was updated successfully, but these errors were encountered:
I don't think we should fix this. It is related to golang/go#54332 which is caused by the compiler emitting bad unwind information for that function. Adding a workaround specifically for runtime.morestack_noctxt to delve is easy but you will have the same problem for runtime.morestack only much more complicated because that function actually performs a stack switch.
In general all functions that perform a stack switch have places where stacktraces end up being wrong. The format of debug_frame is very flexible so in theory it would be possible to fix this but it would involve a lot of effort and it would have to be done in the compiler, not as a series of workarounds in the debugger.
Thus, I'm closing this as "won't fix". However if you believe that this function in particular deserves a workaround more than any other function that suffers from the same problem, please explain why and I will reconsider.
1, What version of Delve are you using (dlv version)?$Id: d81b9fd12bfa603f3cf7a4bc842398bd61c42940 $
Delve Debugger
Version: 1.9.1
Build:
2, What version of Go are you using? (go version)?
go version devel go1.20-75cdd2c75d Wed Aug 24 02:54:32 2022 +0000 linux/arm64
3, What operating system and processor architecture are you using?
linux arm64, kernel version: 5.15.52-051552-generic-64k
4, What did you do?
$ cat main.go
`package main
import(
"fmt"
)
func foo(a, b string) string {
var arr [10000]string
for i := 0; i < 10000; i++ {
arr[i] = a + b
}
return arr[90]
}
func main() {
s := ""
for i := 0; i < 1000; i++ {
s += foo("a", "b")
}
fmt.Println(s)
}
`
$ go build -o main main.go
$ dlv exec ./main
$ b morestack_noctxt
$ c
$ bt
5, What did you expect to see?
Normal stack tracing info
6, What did you see instead?
0 0x0000000000069d10 in runtime.morestack_noctxt
at ./go-master/src/runtime/asm_arm64.s:323
1 0x0000000000058ff0 in runtime.concatstring2
at :0
2 0x0000000000058ff0 in runtime.concatstring2
at :0
3 0x0000000000058ff0 in runtime.concatstring2
at :0
4 0x0000000000058ff0 in runtime.concatstring2
at :0
5 0x0000000000058ff0 in runtime.concatstring2
at :0
6 0x0000000000058ff0 in runtime.concatstring2
at :0
7 0x0000000000058ff0 in runtime.concatstring2
at :0
8 0x0000000000058ff0 in runtime.concatstring2
at :0
9 0x0000000000058ff0 in runtime.concatstring2
at :0
10 0x0000000000058ff0 in runtime.concatstring2
at :0
11 0x0000000000058ff0 in runtime.concatstring2
at :0
12 0x0000000000058ff0 in runtime.concatstring2
at :0
13 0x0000000000058ff0 in runtime.concatstring2
at :0
14 0x0000000000058ff0 in runtime.concatstring2
at :0
Sending output to pager...
0 0x0000000000069d10 in runtime.morestack_noctxt
at ./go-master/src/runtime/asm_arm64.s:323
1 0x0000000000058ff0 in runtime.concatstring2
at :0
2 0x0000000000058ff0 in runtime.concatstring2
at :0
3 0x0000000000058ff0 in runtime.concatstring2
at :0
4 0x0000000000058ff0 in runtime.concatstring2
at :0
5 0x0000000000058ff0 in runtime.concatstring2
at :0
6 0x0000000000058ff0 in runtime.concatstring2
at :0
7 0x0000000000058ff0 in runtime.concatstring2
at :0
8 0x0000000000058ff0 in runtime.concatstring2
at :0
9 0x0000000000058ff0 in runtime.concatstring2
at :0
10 0x0000000000058ff0 in runtime.concatstring2
at :0
11 0x0000000000058ff0 in runtime.concatstring2
at :0
The text was updated successfully, but these errors were encountered: