Golang 堆栈跟踪详细信息
Golang stack trace details
我希望有人能向我解释 Golang 堆栈跟踪的一个小细节,我读过的教程大多忽略了这一点。
我得到的堆栈跟踪示例:
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc42005ad00)
/usr/local/go/src/net/http/server.go:1491 +0x12a
panic(0x8079e0, 0xc42000c0c0)
/usr/local/go/src/runtime/panic.go:458 +0x243
usos-shop-back/usosapi.GetJson(0x0, 0x7d7820, 0xc4202f6d00, 0x0, 0x0)
/root/go/src/usos-shop-back/usosapi/usos-hackery.go:20 +0x38
...
...
...
所以我很好奇代码中出现错误的行号后面的+0x12a
、+0x243
、+0x38
是什么意思
谢谢,
R.C.
P.S.: 恐慌是由指向 func GetJson(*http.Response, interface{}) error
的空指针引起的
It's the difference between the stack frame PC and the function entry PC.
感谢JimB
我希望有人能向我解释 Golang 堆栈跟踪的一个小细节,我读过的教程大多忽略了这一点。 我得到的堆栈跟踪示例:
goroutine 6 [running]: net/http.(*conn).serve.func1(0xc42005ad00) /usr/local/go/src/net/http/server.go:1491 +0x12a panic(0x8079e0, 0xc42000c0c0) /usr/local/go/src/runtime/panic.go:458 +0x243 usos-shop-back/usosapi.GetJson(0x0, 0x7d7820, 0xc4202f6d00, 0x0, 0x0) /root/go/src/usos-shop-back/usosapi/usos-hackery.go:20 +0x38 ... ... ...
所以我很好奇代码中出现错误的行号后面的+0x12a
、+0x243
、+0x38
是什么意思
谢谢, R.C.
P.S.: 恐慌是由指向 func GetJson(*http.Response, interface{}) error
It's the difference between the stack frame PC and the function entry PC.感谢JimB