[求助] golang 报错堆栈信息

LIYAOZONG700 · · 2647 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

请教一个关于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 ```

有疑问加站长微信联系(非本文作者))

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

2647 次点击  
加入收藏 微博
3 回复  |  直到 2017-12-14 10:06:41
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传