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
What version of Go are you using? (go version)? go version go1.20.10 linux/arm64
What operating system and processor architecture are you using?
cat /etc/redhat-release
CentOS Linux release 7.9.2009 (AltArch)
What did you do?
package main
func main() {
map_value := make(map[string]*int)
var value_1 int = 1
var value_2 int = 2
map_value["a"] = &value_1
map_value["b"] = &value_2
mod_map(map_value)
}
func mod_map(map_value map[string]*int) {
p_value := map_value["c"]
*p_value = 3
}
step 1: Compile the demo.go with debug information (go build -gcflags=all="-N -l" demo.go)
step 2: export GOTRACEBACK=crash, then run the executable file. Now wen can get the coredump file and the information of the program.
step 3: Compare the information of the program and dlv coredump information.
What did you expect to see?
When dlv core demo core_demo_xx,we expect to get the right SP for the coredump function. SP=0x4000192dc0 is printed for the function mod_map which contains nil pointer dereference.
The following is the inforamtion of the program. The inforamtion contain the SP for each frame stack.
What did you see instead?
Dlv get the wrong SP information for the function mod_map which contains nil pointer dereference. Dlv get he wrong SP = 0x4000192db0. The right SP is 0x4000192dc0. We guess the wrong SP is the root cuase of the problem that the print commands for input parameter and local variable is wrong.
Type 'help' for list of commands.
(dlv) bt
0 0x00000000000673d8 in runtime.raise
at /home/wsl/go/go1.20.10/src/runtime/sys_linux_arm64.s:158
1 0x0000000000053474 in runtime.dieFromSignal
at /home/wsl/go/go1.20.10/src/runtime/signal_unix.go:883
2 0x000000000005395c in runtime.sigfwdgo
at /home/wsl/go/go1.20.10/src/runtime/signal_unix.go:1096
3 0x00000000000526ac in runtime.sigtrampgo
at /home/wsl/go/go1.20.10/src/runtime/signal_unix.go:432
4 0x00000000000673d8 in runtime.raise
at /home/wsl/go/go1.20.10/src/runtime/sys_linux_arm64.s:157
5 0x0000000000053474 in runtime.dieFromSignal
at /home/wsl/go/go1.20.10/src/runtime/signal_unix.go:883
6 0x00000000000535e4 in runtime.crash
at /home/wsl/go/go1.20.10/src/runtime/signal_unix.go:975
7 0x000000000003f5a0 in runtime.fatalpanic
at /home/wsl/go/go1.20.10/src/runtime/panic.go:1172
8 0x000000000003ee44 in runtime.gopanic
at /home/wsl/go/go1.20.10/src/runtime/panic.go:987
9 0x000000000003da78 in runtime.panicmem
at /home/wsl/go/go1.20.10/src/runtime/panic.go:260
10 0x00000000000533f0 in runtime.sigpanic
at /home/wsl/go/go1.20.10/src/runtime/signal_unix.go:841
11 0x0000000000068bc0 in main.mod_map
at ./demo_2.go:15
12 0x0000000000068bc0 in main.mod_map
at ./demo_2.go:15
13 0x0000000000068bb8 in main.mod_map
at ./demo_2.go:15
14 0x0000000000000000 in ???
at :0
error: NULL address
(truncated)
(dlv) frame 11
> runtime.raise() /home/wsl/go/go1.20.10/src/runtime/sys_linux_arm64.s:158 (PC: 0x673d8)
Warning: debugging optimized function
Frame 11: ./demo_2.go:15 (PC: 68bc0)
10:
11: mod_map(map_value)
12: }
13:
14: func mod_map(map_value map[string]*int) {
=> 15: p_value := map_value["c"]
16: *p_value = 3
17: }
(dlv) regs
PC = 0x0000000000068bc0
SP = 0x0000004000192db0
X29 = 0x00000040001605f8
X30 = 0x0000000000068bc0
The text was updated successfully, but these errors were encountered:
I have rebuild delve from the master. The problem still exists.
GO111MODULE=off
We use the following command to rebuild dlv.
go install github.com/go-delve/delve/cmd/dlv
dlv version
)?What version of Go are you using? (
go version
)?go version go1.20.10 linux/arm64
What operating system and processor architecture are you using?
When
dlv core demo core_demo_xx
,we expect to get the right SP for the coredump function.SP=0x4000192dc0 is printed for the function mod_map which contains nil pointer dereference.
The following is the inforamtion of the program. The inforamtion contain the SP for each frame stack.
Dlv get the wrong SP information for the function mod_map which contains nil pointer dereference.
Dlv get he wrong SP = 0x4000192db0. The right SP is 0x4000192dc0.
We guess the wrong SP is the root cuase of the problem that the print commands for input parameter and local variable is wrong.
The text was updated successfully, but these errors were encountered: