gdb调试go生成的core文件栈信息为??

highfly43 · · 4465 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

写了个很常见的能导致core的go程序 ```go package main func main() { var a map[int]int a[0] = 0 return } ``` 设置环境变量 export GOTRACEBACK=crash 然后使用go build -gcflags "-N -l" 进行编译,运行程序,会生成core文件,然后我使用gdb main core.16996 查看 core文件,但是看到栈信息看不到自己的代码部分,无法定位哪里core了,请问下是我编译参数有问题还是怎么的呢? GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /data/sx/interface/src/BrokerGateway/main/main...done. [New Thread 16996] [New Thread 16997] [New Thread 16999] [New Thread 16998] [New Thread 17000] Core was generated by `./main'. Program terminated with signal 6, Aborted. #0 runtime.raise () at /data/sx/interface/3party/go/go安装包/go/src/runtime/sys_linux_amd64.s:110 110 RET (gdb) bt #0 runtime.raise () at /data/sx/interface/3party/go/go安装包/go/src/runtime/sys_linux_amd64.s:110 #1 0x0000000000433228 in runtime.dieFromSignal (sig=6) at /data/sx/interface/3party/go/go安装包/go/src/runtime/signal1_unix.go:192 #2 0x000000000043334f in runtime.crash () at /data/sx/interface/3party/go/go安装包/go/src/runtime/signal1_unix.go:247 #3 0x000000000042421e in runtime.dopanic_m (gp=0xc820000180, pc=4339638, sp=859530599912) at /data/sx/interface/3party/go/go安装包/go/src/runtime/panic.go:642 #4 0x00000000004442f2 in runtime.dopanic.func1 () at /data/sx/interface/3party/go/go安装包/go/src/runtime/panic.go:517 #5 0x000000000044c4c9 in runtime.systemstack () at /data/sx/interface/3party/go/go安装包/go/src/runtime/asm_amd64.s:291 #6 0x0000000000427f70 in runtime.startTheWorldWithSema () at /data/sx/interface/3party/go/go安装包/go/src/runtime/proc.go:983 #7 0x00000000004b8500 in runtime.g0 () #8 0x00007fffb8538340 in ?? () #9 0x00000000004b84c0 in runtime.work () #10 0x0000000000427fe2 in runtime.mstart () at /data/sx/interface/3party/go/go安装包/go/src/runtime/proc.go:1065 #11 0x000000000044c2c8 in runtime.rt0_go () at /data/sx/interface/3party/go/go安装包/go/src/runtime/asm_amd64.s:149 #12 0x0000000000000001 in ?? () #13 0x00007fffb8538388 in ?? () #14 0x0000000000000001 in ?? () #15 0x00007fffb8538388 in ?? () #16 0x0000000000000000 in ?? () (gdb)

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

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

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