[求助] golang 報錯堆棧資訊
來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。請教一個關於golang debug的問題。我在使用Shopify/sarama這個庫去串連kafka時,運行程式報錯,一般這種報錯如何查看?可以看到,我這個報錯堆棧資訊只能回溯10層,到sarama的Open.func1這裡。`created by github.com/Shopify/sarama.(*Broker).Open.func1``/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:148`但是我沒辦法找到My Code中哪個部分觸發了這個函數,請問有方法再增加報錯堆棧的層數嗎?```unexpected fault address 0xa31800fatal error: fault[signal SIGSEGV: segmentation violation code=0x2 addr=0xa31800 pc=0xa31800]goroutine 34 [running]:runtime.throw(0x6ea68e, 0x5)/paic/dev/oracle/11g/odsz11g/go/src/runtime/panic.go:566 +0x95 fp=0xc4200a2cd8 sp=0xc4200a2cb8runtime.sigpanic()/paic/dev/oracle/11g/odsz11g/go/src/runtime/sigpanic_unix.go:27 +0x288 fp=0xc4200a2d30 sp=0xc4200a2cd8github.com/rcrowley/go-metrics.(*StandardHistogram).Update(0xc4201d6060, 0x1)/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/rcrowley/go-metrics/histogram.go:199 +0x3d fp=0xc4200a2d50 sp=0xc4200a2d30github.com/Shopify/sarama.(*Broker).updateRequestLatencyMetrics(0xc4201582c0, 0x166b87)/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:656 +0x9b fp=0xc4200a2d78 sp=0xc4200a2d50github.com/Shopify/sarama.(*Broker).updateIncomingCommunicationMetrics(0xc4201582c0, 0x24, 0x166b87)/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:636 +0x39 fp=0xc4200a2d98 sp=0xc4200a2d78github.com/Shopify/sarama.(*Broker).responseReceiver(0xc4201582c0)/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:514 +0x77a fp=0xc4200a2f70 sp=0xc4200a2d98github.com/Shopify/sarama.(*Broker).(github.com/Shopify/sarama.responseReceiver)-fm()/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:148 +0x2a fp=0xc4200a2f88 sp=0xc4200a2f70github.com/Shopify/sarama.withRecover(0xc4201d60d0)/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/utils.go:46 +0x43 fp=0xc4200a2fa8 sp=0xc4200a2f88runtime.goexit()/paic/dev/oracle/11g/odsz11g/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc4200a2fb0 sp=0xc4200a2fa8created by github.com/Shopify/sarama.(*Broker).Open.func1/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:148 +0x8ae```284 次點擊