Core dump for crashes, fatals and non-zero exit

agolangf · · 653 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>As the topic states I would like to be have a dump of the process for the following scenarios:</p> <ol> <li>when a crash happens</li> <li>when a fatal error is reported</li> <li>when <code>os.Exit</code> is called with a non-zero value</li> </ol> <p>These scenarios are the hardest to make sense of if they happen e.g. in production. I would like to get the time for analysis down. So in the end I want to be able to feed the dump to <em>dwelve</em> or <em>gdb</em>.</p> <p>The cases 2 and 3 I could easily catch by a, implementing my own fatal error reporting and b, wrapping os.Exit with some more logic. If push comes to shove I would have to call <code>gcore</code> myself.</p> <p>Now I am wondering whether there is a already working solution similar to breakpad and crashpad for Go. Especially whether there is something which would integrate already with <em>dwelve</em>.</p> <hr/>**评论:**<br/><br/>wheey: <pre><p>Are you maybe looking for this: <a href="https://github.com/golang/go/wiki/CoreDumpDebugging" rel="nofollow">https://github.com/golang/go/wiki/CoreDumpDebugging</a></p></pre>hell_0n_wheel: <pre><blockquote> <p>I would like to get the time for analysis down.</p> </blockquote> <p>I&#39;m being serious here: if your application doesn&#39;t crash, you spend less time analyzing it.</p> <p>Planning for failure is a good thing, but this reads more like you&#39;re designing for failure. That&#39;s... not the best design IMO.</p> <p>Yes, applications will do weird things, and you should program defensively and log verbosely when &#34;weird happens&#34;... but you shouldn&#39;t be crashing so much that you need such an elaborate design for debugging.</p></pre>

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

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