请教一个关于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`
但是我没办法找到我的代码中哪个部分触发了这个函数,请问有方法再增加报错堆栈的层数吗?
```
unexpected fault address 0xa31800
fatal 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=0xc4200a2cb8
runtime.sigpanic()
/paic/dev/oracle/11g/odsz11g/go/src/runtime/sigpanic_unix.go:27 +0x288 fp=0xc4200a2d30 sp=0xc4200a2cd8
github.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=0xc4200a2d30
github.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=0xc4200a2d50
github.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=0xc4200a2d78
github.com/Shopify/sarama.(*Broker).responseReceiver(0xc4201582c0)
/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:514 +0x77a fp=0xc4200a2f70 sp=0xc4200a2d98
github.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=0xc4200a2f70
github.com/Shopify/sarama.withRecover(0xc4201d60d0)
/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/utils.go:46 +0x43 fp=0xc4200a2fa8 sp=0xc4200a2f88
runtime.goexit()
/paic/dev/oracle/11g/odsz11g/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc4200a2fb0 sp=0xc4200a2fa8
created by github.com/Shopify/sarama.(*Broker).Open.func1
/paic/dev/oracle/11g/odsz11g/mygo/src/github.com/Shopify/sarama/broker.go:148 +0x8ae
```
有疑问加站长微信联系(非本文作者))