mod coredump2
diff --git "a/Golang/\345\210\206\345\270\203\345\274\217\347\253\257\345\217\243\346\230\240\345\260\204NetMapping\347\232\204\350\256\276\350\256\241\344\270\216\345\256\236\347\216\260/index.html" "b/Golang/\345\210\206\345\270\203\345\274\217\347\253\257\345\217\243\346\230\240\345\260\204NetMapping\347\232\204\350\256\276\350\256\241\344\270\216\345\256\236\347\216\260/index.html"
index 6efb146..f396979 100644
--- "a/Golang/\345\210\206\345\270\203\345\274\217\347\253\257\345\217\243\346\230\240\345\260\204NetMapping\347\232\204\350\256\276\350\256\241\344\270\216\345\256\236\347\216\260/index.html"
+++ "b/Golang/\345\210\206\345\270\203\345\274\217\347\253\257\345\217\243\346\230\240\345\260\204NetMapping\347\232\204\350\256\276\350\256\241\344\270\216\345\256\236\347\216\260/index.html"
@@ -93,7 +93,7 @@
<ul>
<ul>
- <li class="prev"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/" title="使用gdb解析core dump(一)">← Previous</a></li>
+ <li class="prev"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/" title="使用gdb解析core dump-概念篇">← Previous</a></li>
diff --git a/archive/index.html b/archive/index.html
index 5bcb4b2..43616de 100644
--- a/archive/index.html
+++ b/archive/index.html
@@ -91,9 +91,9 @@
<h3>June</h3>
<ul>
- <li><span>2015-06-11</span> » <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/">使用gdb解析core dump(二)</a></li>
+ <li><span>2015-06-11</span> » <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/">使用gdb解析core dump-解析篇</a></li>
- <li><span>2015-06-06</span> » <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/">使用gdb解析core dump(一)</a></li>
+ <li><span>2015-06-06</span> » <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/">使用gdb解析core dump-概念篇</a></li>
</ul>
diff --git a/categories/index.html b/categories/index.html
index f52e7e7..52d6ae6 100644
--- a/categories/index.html
+++ b/categories/index.html
@@ -120,9 +120,9 @@
<h2>CoreDump (2)</h2>
<ul>
- <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/">使用gdb解析core dump(二)</a></li>
+ <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/">使用gdb解析core dump-解析篇</a></li>
- <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/">使用gdb解析core dump(一)</a></li>
+ <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/">使用gdb解析core dump-概念篇</a></li>
</ul>
diff --git "a/coredump/\344\275\277\347\224\250gdb\350\247\243\346\236\220core-dump-\346\246\202\345\277\265\347\257\207/index.html" "b/coredump/\344\275\277\347\224\250gdb\350\247\243\346\236\220core-dump-\346\246\202\345\277\265\347\257\207/index.html"
new file mode 100644
index 0000000..daa5e89
--- /dev/null
+++ "b/coredump/\344\275\277\347\224\250gdb\350\247\243\346\236\220core-dump-\346\246\202\345\277\265\347\257\207/index.html"
@@ -0,0 +1,264 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>使用gdb解析core dump-概念篇</title>
+
+ <meta name="author" content="Archer Ding">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="/assets/twitter/stylesheets/bootstrap.min.css" type="text/css" rel="stylesheet" media="all">
+<link href="/assets/twitter/stylesheets/style.css" type="text/css" rel="stylesheet" media="all">
+<link href="/assets/twitter/widgets/google_prettify/stylesheets/twitter-bootstrap.css" type="text/css" rel="stylesheet" media="all">
+
+
+ <!-- Le fav and touch icons -->
+ <!-- Update these with your own images
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ -->
+ </head>
+
+ <body>
+
+ <div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand" href="/">ArcherDing's Blog</a>
+ <ul class="nav">
+
+
+
+
+ <li><a href="/archive">Archive</a></li>
+
+
+
+
+
+
+ <li><a href="/tags">Tags</a></li>
+
+
+
+
+
+
+ <li><a href="/categories">Categories</a></li>
+
+
+
+
+
+
+ <li><a href="/pages">Pages</a></li>
+
+
+
+
+
+
+ <li><a href="/about">About Me</a></li>
+
+
+
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+ <div class="content">
+ <div class="page-header">
+ <h1>使用gdb解析core dump-概念篇 </h1>
+</div>
+
+<div class="row">
+ <div class="span8">
+ <h3>Core dump是什么?</h3>
+
+<p>当一个程序在运行的过程中发生了错误,导致<strong>程序崩溃</strong>或者<strong>异常终止</strong>的时候,操作系统会将这个程序在问题发生时的一些信息以文件的形式保存起来,以便维护人员进行调查,解析问题发生的原因,这个文件就是Core dump文件。
+从字面上理解,Core dump(核心转储)就是将core信息以dump格式保存在文件中。
+Core信息包括了进程信息、内存信息、寄存器信息、堆栈信息等。</p>
+
+<h3>Core dump保存在哪里?</h3>
+
+<p><strong>开启core dump功能</strong></p>
+
+<p>要想获得Coredump文件就必须先开启保存该文件的功能。
+使用<code>ulimit -c</code>可以查看是否开启。如果输出0说明没有开启,使用<code>ulimit -c unlimited</code>可以开启,这种方式不会限制core文件的大小;使用<code>ulimit -c size</code>可以设置core文件大小,单位是KB。但是这种方式只能设置当前终端有效,如果希望永久开启,可以在<code>/etc/profile</code>中追加<code>ulimit -c unlimited</code>。</p>
+
+<p><strong>修改core文件位置</strong></p>
+
+<p>默认情况下会在程序所在目录生成文件名为<code>core</code>的core文件;
+使用<code>echo 1 > /proc/sys/kernel/core_uses_pid</code>可以在生成带进程PID的core文件,文件形式为<code>core.pid</code>;
+使用<code>echo "/tmp/core/core-%e.%p" > /proc/sys/kernel/core_pattern</code>可以在<code>/tmp/core</code>中生成格式为<code>core-程序名.pid</code>的core文件。</p>
+
+<h3>Core dump如何产生?</h3>
+
+<p>我们知道了程序在<strong>程序崩溃</strong>或者<strong>异常终止</strong>的时候会产生core文件呢?那么使用<code>kill -9</code>会产生core文件吗?
+我们不妨做个试验。我们给helloword程序加上死循环来进行测试。</p>
+
+<pre><code>#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ while(1){
+ fprintf(stdout,"Hello World!\n");
+ fflush(stdout);
+ sleep(5);
+ }
+ return 0;
+}
+</code></pre>
+
+<pre><code>$ gcc hello.c -o hello
+$ ./hello
+Hello World!
+Hello World!
+$ ps -ef | grep hello
+archerd+ 2890 2044 0 20:55 pts/1 00:00:00 ./hello
+</code></pre>
+
+<p>接下来我们使用下面的命令结束进程,发现没有生成core文件。
+> pkill -9 hello</p>
+
+<p>我们继续使用下面的命令结束进程,发现产生core文件。
+> kill -s 11 `pgrep hello`</p>
+
+<p>我们可以得出一个结论,并非所有的中断信号都产生core文件。那么什么信号会产生core文件呢??
+我们使用<code>man 7 signal</code>来查看一下,原来下表中Action为core的信号才会产生core文件。</p>
+
+<pre><code>Signal Value Action Comment
+──────────────────────────────────────────────────────────────────────
+SIGHUP 1 Term Hangup detected on controlling terminal
+ or death of controlling process
+SIGINT 2 Term Interrupt from keyboard
+SIGQUIT 3 Core Quit from keyboard
+SIGILL 4 Core Illegal Instruction
+SIGABRT 6 Core Abort signal from abort(3)
+SIGFPE 8 Core Floating point exception
+SIGKILL 9 Term Kill signal
+SIGSEGV 11 Core Invalid memory reference
+SIGPIPE 13 Term Broken pipe: write to pipe with no
+ readers
+SIGALRM 14 Term Timer signal from alarm(2)
+SIGTERM 15 Term Termination signal
+SIGUSR1 30,10,16 Term User-defined signal 1
+SIGUSR2 31,12,17 Term User-defined signal 2
+SIGCHLD 20,17,18 Ign Child stopped or terminated
+SIGCONT 19,18,25 Cont Continue if stopped
+SIGSTOP 17,19,23 Stop Stop process
+SIGTSTP 18,20,24 Stop Stop typed at terminal
+SIGTTIN 21,21,26 Stop Terminal input for background process
+SIGTTOU 22,22,27 Stop Terminal output for background process
+</code></pre>
+
+ <hr>
+ <div class="pagination">
+ <ul>
+ <ul>
+
+ <li class="prev"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/" title="使用gdb解析core dump-解析篇">← Previous</a></li>
+
+
+
+ <li><a href="/archive">Archive</a></li>
+
+
+ <li class="next"><a href="/Golang/%E5%88%86%E5%B8%83%E5%BC%8F%E7%AB%AF%E5%8F%A3%E6%98%A0%E5%B0%84NetMapping%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0/" title="分布式端口映射NetMapping的设计与实现">Next →</a></li>
+
+
+ </ul>
+ </ul>
+ </div>
+ <hr>
+
+<div id="disqus_thread"></div>
+<script>
+ var disqus_developer = 1;
+ var disqus_shortname = 'jekyllbootstrap'; // required: replace example with your forum shortname
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+
+ </div>
+
+ <div class="span4">
+ <h4>Published</h4>
+ <div class="date"><span>2015-06-06</span></div>
+ <br>
+ <h4>Categories</h4>
+ <ul class="tag_box">
+
+ <li>
+ <a href="/categories/#CoreDump-ref">CoreDump <span>2</span></a>
+</li>
+
+ </ul>
+ <br>
+ <h4>Tags</h4>
+ <ul class="tag_box">
+
+ <li>
+ <a href="/tags/#CoreDump-ref">CoreDump <span>2</span></a>
+</li>
+
+ </ul>
+ </div>
+</div>
+
+ </div>
+
+ <footer>
+ <p>© Archer Ding 2013
+ with help from <a href="http://github.com/wendal/gor" target="_blank" title="Gor -- Fast Blog">Gor</a>
+ and <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>
+ and Idea from <a href="http://ruhoh.com" target="_blank" title="The Definitive Technical Blogging Framework">ruhoh</a>
+ </p>
+ </footer>
+
+ </div> <!-- /container -->
+
+
+<script src="//cdnjscn.b0.upaiyun.com/libs/prettify/r298/prettify.min.js"></script>
+<script>
+ var pres = document.getElementsByTagName("pre");
+ for (var i=0; i < pres.length; ++i) {
+ pres[i].className = "prettyprint linenums";
+ }
+ prettyPrint();
+</script>
+
+
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
+ _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
+ _gaq.push(['_setAccount', 'UA-123-12']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script>
+ </body>
+</html>
diff --git "a/coredump/\344\275\277\347\224\250gdb\350\247\243\346\236\220core-dump-\350\247\243\346\236\220\347\257\207/index.html" "b/coredump/\344\275\277\347\224\250gdb\350\247\243\346\236\220core-dump-\350\247\243\346\236\220\347\257\207/index.html"
new file mode 100644
index 0000000..f1816e0
--- /dev/null
+++ "b/coredump/\344\275\277\347\224\250gdb\350\247\243\346\236\220core-dump-\350\247\243\346\236\220\347\257\207/index.html"
@@ -0,0 +1,600 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>使用gdb解析core dump-解析篇</title>
+
+ <meta name="author" content="Archer Ding">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="/assets/twitter/stylesheets/bootstrap.min.css" type="text/css" rel="stylesheet" media="all">
+<link href="/assets/twitter/stylesheets/style.css" type="text/css" rel="stylesheet" media="all">
+<link href="/assets/twitter/widgets/google_prettify/stylesheets/twitter-bootstrap.css" type="text/css" rel="stylesheet" media="all">
+
+
+ <!-- Le fav and touch icons -->
+ <!-- Update these with your own images
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ -->
+ </head>
+
+ <body>
+
+ <div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand" href="/">ArcherDing's Blog</a>
+ <ul class="nav">
+
+
+
+
+ <li><a href="/archive">Archive</a></li>
+
+
+
+
+
+
+ <li><a href="/tags">Tags</a></li>
+
+
+
+
+
+
+ <li><a href="/categories">Categories</a></li>
+
+
+
+
+
+
+ <li><a href="/pages">Pages</a></li>
+
+
+
+
+
+
+ <li><a href="/about">About Me</a></li>
+
+
+
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+
+ <div class="content">
+ <div class="page-header">
+ <h1>使用gdb解析core dump-解析篇 </h1>
+</div>
+
+<div class="row">
+ <div class="span8">
+ <h3>Core dump如何解析?</h3>
+
+<p><code>man 7 signal</code>的结果给了我们一些提示,不妨我们来验证一下。</p>
+
+<p><strong>SIGQUIT信号下的Core dump解析</strong></p>
+
+<p><code>SIGABRT</code>信号表示用户在终端上按了退出键(一般采用Ctrl-\);使用之前用的helloworld程序,运行以后输入Ctrl+\;</p>
+
+<pre><code>archerding@ubuntu:~$ ./hello
+Hello World!
+Hello World!
+Hello World!
+Hello World!
+^\Quit (core dumped)
+archerding@ubuntu:~$ ls /tmp/core/
+core-hello.2213
+</code></pre>
+
+<p>接下来开始解析这个core文件;错误提示非常明显<code>Program terminated with signal SIGQUIT, Quit.</code>;</p>
+
+<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/hello core-hello.2213
+GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
+Copyright (C) 2015 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-linux-gnu".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<http://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+<http://www.gnu.org/software/gdb/documentation/>.
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from /home/archerding/hello...(no debugging symbols found)...done.
+[New LWP 2213]
+Core was generated by `./hello'.
+Program terminated with signal SIGQUIT, Quit.
+#0 0x00007f4e7d2a2c30 in __nanosleep_nocancel ()
+ at ../sysdeps/unix/syscall-template.S:81
+81 ../sysdeps/unix/syscall-template.S: No such file or directory.
+(gdb)
+</code></pre>
+
+<p><strong>SIGABRT信号下的Core dump解析</strong></p>
+
+<p><code>SIGABRT</code>信号表示调用abort函数;编写新的测试程序,尝试调用一下<code>abort()</code>函数验证一下;</p>
+
+<pre><code>#include <stdlib.h>
+
+int main()
+{
+ abort();
+ return 0;
+}
+</code></pre>
+
+<p>编译执行,果真产生了core文件;</p>
+
+<pre><code>archerding@ubuntu:~$ gcc sigabort.c -o sigabort
+archerding@ubuntu:~$ ./sigabort
+Aborted (core dumped)
+archerding@ubuntu:~$ ls /tmp/core/
+core-sigabort.2594
+</code></pre>
+
+<p>接下来开始解析这个core文件;错误提示非常明显<code>Program terminated with signal SIGABRT, Aborted.</code>;
+使用<code>bt</code>打印栈信息,定位错误调用了<code>abort()</code>函数。</p>
+
+<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/sigabort core-sigabort.2594
+GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
+Copyright (C) 2015 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-linux-gnu".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<http://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+<http://www.gnu.org/software/gdb/documentation/>.
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from /home/archerding/sigabort...(no debugging symbols found)...done.
+
+warning: exec file is newer than core file.
+[New LWP 2594]
+Core was generated by `./sigabort'.
+Program terminated with signal SIGABRT, Aborted.
+#0 0x00007ff6657bd267 in __GI_raise (sig=sig@entry=6)
+ at ../sysdeps/unix/sysv/linux/raise.c:55
+55 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
+(gdb) bt
+#0 0x00007ff6657bd267 in __GI_raise (sig=sig@entry=6)
+ at ../sysdeps/unix/sysv/linux/raise.c:55
+#1 0x00007ff6657beeca in __GI_abort () at abort.c:89
+#2 0x000000000040053f in main ()
+Print backtrace of all stack frames, or innermost COUNT frames.
+With a negative argument, print outermost -COUNT frames.
+Use of the 'full' qualifier also prints the values of the local variables.
+Use of the 'no-filters' qualifier prohibits frame filters from executing
+on this backtrace.
+
+(gdb)
+</code></pre>
+
+<p><strong>SIGFPE信号下的Core dump解析</strong></p>
+
+<p><code>SIGFPE</code>信号表示一个算术运算异常,例如除以0,浮点溢出等;编写新的测试程序,尝试产生<code>SIGFPE</code>信号;</p>
+
+<pre><code>#include <stdlib.h>
+
+int calc(int num)
+{
+ int divider = 0;
+ int result = 0;
+ result = num / divider;
+ return result;
+}
+
+int main()
+{
+ calc(10);
+ return 0;
+}
+</code></pre>
+
+<p>编译执行,果真产生了core文件;</p>
+
+<pre><code>archerding@ubuntu:~$ gcc sigfpe.c -o sigfpe
+archerding@ubuntu:~$ ./sigfpe
+Floating point exception (core dumped)
+archerding@ubuntu:~$ ls /tmp/core/
+core-sigfpe.2722
+</code></pre>
+
+<p>接下来开始解析这个core文件;错误提示<code>Program terminated with signal SIGFPE, Arithmetic exception.</code>;
+使用<code>bt</code>打印栈信息,定位错误函数是<code>calc ()</code>函数;
+使用<code>i r</code>打印寄存器信息,发现在调用到汇编指令地址<code>rip 0x40050f 0x40050f <calc+25></code>时出现异常;
+使用<code>disas</code>反汇编问题函数,发现在调用<code>idivl -0x8(%rbp)</code>时出错,该汇编指令是做除法运算;
+使用<code>x $rbp-0x8</code>打印除数,发现除数为0。</p>
+
+<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/sigfpe core-sigfpe.2722
+GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
+Copyright (C) 2015 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-linux-gnu".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<http://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+<http://www.gnu.org/software/gdb/documentation/>.
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from /home/archerding/sigfpe...(no debugging symbols found)...done.
+[New LWP 2722]
+Core was generated by `./sigfpe'.
+Program terminated with signal SIGFPE, Arithmetic exception.
+#0 0x000000000040050f in calc ()
+(gdb) bt
+#0 0x000000000040050f in calc ()
+#1 0x0000000000400528 in main ()
+(gdb) i r
+rax 0xa 10
+rbx 0x0 0
+rcx 0x0 0
+rdx 0x0 0
+rsi 0x7ffcb45b2198 140723334357400
+rdi 0xa 10
+rbp 0x7ffcb45b20a0 0x7ffcb45b20a0
+rsp 0x7ffcb45b20a0 0x7ffcb45b20a0
+r8 0x7ff8d052ddd0 140706623708624
+r9 0x7ff8d05489d0 140706623818192
+r10 0x833 2099
+r11 0x7ff8d0188950 140706619885904
+r12 0x400400 4195328
+r13 0x7ffcb45b2190 140723334357392
+r14 0x0 0
+r15 0x0 0
+rip 0x40050f 0x40050f <calc+25>
+eflags 0x10246 [ PF ZF IF RF ]
+cs 0x33 51
+ss 0x2b 43
+ds 0x0 0
+es 0x0 0
+fs 0x0 0
+---Type <return> to continue, or q <return> to quit---
+gs 0x0 0
+(gdb) disas
+Dump of assembler code for function calc:
+ 0x00000000004004f6 <+0>: push %rbp
+ 0x00000000004004f7 <+1>: mov %rsp,%rbp
+ 0x00000000004004fa <+4>: mov %edi,-0x14(%rbp)
+ 0x00000000004004fd <+7>: movl $0x0,-0x8(%rbp)
+ 0x0000000000400504 <+14>: movl $0x0,-0x4(%rbp)
+ 0x000000000040050b <+21>: mov -0x14(%rbp),%eax
+ 0x000000000040050e <+24>: cltd
+=> 0x000000000040050f <+25>: idivl -0x8(%rbp)
+ 0x0000000000400512 <+28>: mov %eax,-0x4(%rbp)
+ 0x0000000000400515 <+31>: mov -0x4(%rbp),%eax
+ 0x0000000000400518 <+34>: pop %rbp
+ 0x0000000000400519 <+35>: retq
+End of assembler dump.
+(gdb) x $rbp-0x8
+0x7ffcb45b2098: 0x00000000
+</code></pre>
+
+<p><strong>SIGSEGV信号下的Core dump解析</strong></p>
+
+<p><code>SIGSEGV</code>信号表示进程进行了一次无效的存储访问,EGV表示段违例(segmentation violation);编写新的测试程序,尝试产生<code>SIGSEGV</code>信号;</p>
+
+<pre><code>#include <stdlib.h>
+
+const char *str = "hello World!";
+
+void mod_str()
+{
+ str[0] = 'H';
+}
+
+int main()
+{
+ mod_str();
+ return 0;
+}
+</code></pre>
+
+<p>编译执行,果真产生了core文件;</p>
+
+<pre><code>archerding@ubuntu:~$ gcc sigsegv.c -o sigsegv
+archerding@ubuntu:~$ ./sigsegv
+Segmentation fault (core dumped)
+archerding@ubuntu:~$ ls /tmp/core/
+core-sigsegv.2856
+</code></pre>
+
+<p>接下来开始解析这个core文件;错误提示<code>Program terminated with signal SIGSEGV, Segmentation fault.</code>;
+使用<code>bt</code>打印栈信息,定位错误函数是<code>mod_str()</code>函数;
+使用<code>i r</code>打印寄存器信息,发现在调用到汇编指令地址<code>rip 0x400509 0x400509 <mod_str+19></code>时出现异常;
+使用<code>disas</code>反汇编问题函数,发现在调用<code>movb $0x48,(%rax)</code>时出错;
+使用<code>x /16s $rax</code>打印错误地址指向的内存,发现改地址是<code>0x4005b4</code>指向了字符串<code>hello World!</code>;
+使用<code>info proc map</code>查看内存映射,处于第一个区域内。</p>
+
+<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/sigsegv core-sigsegv.2856
+GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
+Copyright (C) 2015 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-linux-gnu".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<http://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+<http://www.gnu.org/software/gdb/documentation/>.
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from /home/archerding/sigsegv...(no debugging symbols found)...done.
+[New LWP 2856]
+Core was generated by `./sigsegv'.
+Program terminated with signal SIGSEGV, Segmentation fault.
+#0 0x0000000000400509 in mod_str ()
+(gdb) bt
+#0 0x0000000000400509 in mod_str ()
+#1 0x000000000040051c in main ()
+(gdb) i r
+rax 0x4005b4 4195764
+rbx 0x0 0
+rcx 0x0 0
+rdx 0x7fff284dc488 140733869573256
+rsi 0x7fff284dc478 140733869573240
+rdi 0x1 1
+rbp 0x7fff284dc380 0x7fff284dc380
+rsp 0x7fff284dc380 0x7fff284dc380
+r8 0x7f590a295dd0 140020399300048
+r9 0x7f590a2b09d0 140020399409616
+r10 0x833 2099
+r11 0x7f5909ef0950 140020395477328
+r12 0x400400 4195328
+r13 0x7fff284dc470 140733869573232
+r14 0x0 0
+r15 0x0 0
+rip 0x400509 0x400509 <mod_str+19>
+eflags 0x10246 [ PF ZF IF RF ]
+cs 0x33 51
+ss 0x2b 43
+ds 0x0 0
+es 0x0 0
+fs 0x0 0
+---Type <return> to continue, or q <return> to quit---
+gs 0x0 0
+(gdb) disas
+Dump of assembler code for function mod_str:
+ 0x00000000004004f6 <+0>: push %rbp
+ 0x00000000004004f7 <+1>: mov %rsp,%rbp
+ 0x00000000004004fa <+4>: mov 0x200b37(%rip),%rax # 0x601038 <str>
+ 0x0000000000400501 <+11>: mov %rax,-0x8(%rbp)
+ 0x0000000000400505 <+15>: mov -0x8(%rbp),%rax
+=> 0x0000000000400509 <+19>: movb $0x48,(%rax)
+ 0x000000000040050c <+22>: pop %rbp
+ 0x000000000040050d <+23>: retq
+End of assembler dump.
+(gdb) x /16s $rax
+0x4005b4: "hello World!"
+0x4005c1: ""
+0x4005c2: ""
+0x4005c3: ""
+0x4005c4: "\001\033\003;8"
+0x4005ca: ""
+0x4005cb: ""
+0x4005cc: "\006"
+0x4005ce: ""
+0x4005cf: ""
+0x4005d0: "\f\376\377\377\204"
+0x4005d6: ""
+0x4005d7: ""
+0x4005d8: "<\376\377\377T"
+0x4005de: ""
+0x4005df: ""
+(gdb) info proc map
+Mapped address spaces:
+
+ Start Addr End Addr Size Offset objfile
+ 0x400000 0x401000 0x1000 0x0 /home/archerding/sigsegv
+ 0x600000 0x601000 0x1000 0x0 /home/archerding/sigsegv
+ 0x601000 0x602000 0x1000 0x1000 /home/archerding/sigsegv
+ 0x7f5909ed0000 0x7f590a090000 0x1c0000 0x0 /lib/x86_64-linux-gnu/libc-2.21.so
+ 0x7f590a090000 0x7f590a290000 0x200000 0x1c0000 /lib/x86_64-linux-gnu/libc-2.21.so
+ 0x7f590a290000 0x7f590a294000 0x4000 0x1c0000 /lib/x86_64-linux-gnu/libc-2.21.so
+ 0x7f590a294000 0x7f590a296000 0x2000 0x1c4000 /lib/x86_64-linux-gnu/libc-2.21.so
+ 0x7f590a2a0000 0x7f590a2c4000 0x24000 0x0 /lib/x86_64-linux-gnu/ld-2.21.so
+ 0x7f590a4c3000 0x7f590a4c4000 0x1000 0x23000 /lib/x86_64-linux-gnu/ld-2.21.so
+(gdb)
+</code></pre>
+
+<p>接下来使用<code>objdump -t ~/sigsegv</code>进一步确认,发现在修改<code>.rodata</code>段时出错,该段用来保存常量。</p>
+
+<pre><code>archerding@ubuntu:/tmp/core$ objdump -t ~/sigsegv
+
+/home/archerding/sigsegv: file format elf64-x86-64
+
+SYMBOL TABLE:
+0000000000400238 l d .interp 0000000000000000 .interp
+0000000000400254 l d .note.ABI-tag 0000000000000000 .note.ABI-tag
+0000000000400274 l d .note.gnu.build-id 0000000000000000 .note.gnu.build-id
+0000000000400298 l d .gnu.hash 0000000000000000 .gnu.hash
+00000000004002b8 l d .dynsym 0000000000000000 .dynsym
+0000000000400300 l d .dynstr 0000000000000000 .dynstr
+0000000000400338 l d .gnu.version 0000000000000000 .gnu.version
+0000000000400340 l d .gnu.version_r 0000000000000000 .gnu.version_r
+0000000000400360 l d .rela.dyn 0000000000000000 .rela.dyn
+0000000000400378 l d .rela.plt 0000000000000000 .rela.plt
+00000000004003a8 l d .init 0000000000000000 .init
+00000000004003d0 l d .plt 0000000000000000 .plt
+0000000000400400 l d .text 0000000000000000 .text
+00000000004005a4 l d .fini 0000000000000000 .fini
+00000000004005b0 l d .rodata 0000000000000000 .rodata
+00000000004005c4 l d .eh_frame_hdr 0000000000000000 .eh_frame_hdr
+0000000000400600 l d .eh_frame 0000000000000000 .eh_frame
+0000000000600e10 l d .init_array 0000000000000000 .init_array
+0000000000600e18 l d .fini_array 0000000000000000 .fini_array
+0000000000600e20 l d .jcr 0000000000000000 .jcr
+0000000000600e28 l d .dynamic 0000000000000000 .dynamic
+0000000000600ff8 l d .got 0000000000000000 .got
+0000000000601000 l d .got.plt 0000000000000000 .got.plt
+0000000000601028 l d .data 0000000000000000 .data
+0000000000601040 l d .bss 0000000000000000 .bss
+0000000000000000 l d .comment 0000000000000000 .comment
+0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
+0000000000600e20 l O .jcr 0000000000000000 __JCR_LIST__
+0000000000400430 l F .text 0000000000000000 deregister_tm_clones
+0000000000400470 l F .text 0000000000000000 register_tm_clones
+00000000004004b0 l F .text 0000000000000000 __do_global_dtors_aux
+0000000000601040 l O .bss 0000000000000001 completed.7291
+0000000000600e18 l O .fini_array 0000000000000000 __do_global_dtors_aux_fini_array_entry
+00000000004004d0 l F .text 0000000000000000 frame_dummy
+0000000000600e10 l O .init_array 0000000000000000 __frame_dummy_init_array_entry
+0000000000000000 l df *ABS* 0000000000000000 sigsegv.c
+0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
+0000000000400710 l O .eh_frame 0000000000000000 __FRAME_END__
+0000000000600e20 l O .jcr 0000000000000000 __JCR_END__
+0000000000000000 l df *ABS* 0000000000000000
+0000000000600e18 l .init_array 0000000000000000 __init_array_end
+0000000000600e28 l O .dynamic 0000000000000000 _DYNAMIC
+0000000000600e10 l .init_array 0000000000000000 __init_array_start
+0000000000601000 l O .got.plt 0000000000000000 _GLOBAL_OFFSET_TABLE_
+00000000004005a0 g F .text 0000000000000002 __libc_csu_fini
+0000000000000000 w *UND* 0000000000000000 _ITM_deregisterTMCloneTable
+0000000000601028 w .data 0000000000000000 data_start
+0000000000601040 g .data 0000000000000000 _edata
+00000000004005a4 g F .fini 0000000000000000 _fini
+0000000000000000 F *UND* 0000000000000000 __libc_start_main@@GLIBC_2.2.5
+0000000000601028 g .data 0000000000000000 __data_start
+0000000000000000 w *UND* 0000000000000000 __gmon_start__
+0000000000601030 g O .data 0000000000000000 .hidden __dso_handle
+00000000004004f6 g F .text 0000000000000018 mod_str
+00000000004005b0 g O .rodata 0000000000000004 _IO_stdin_used
+0000000000400530 g F .text 0000000000000065 __libc_csu_init
+0000000000601048 g .bss 0000000000000000 _end
+0000000000400400 g F .text 000000000000002a _start
+0000000000601038 g O .data 0000000000000008 str
+0000000000601040 g .bss 0000000000000000 __bss_start
+000000000040050e g F .text 0000000000000015 main
+0000000000000000 w *UND* 0000000000000000 _Jv_RegisterClasses
+0000000000601040 g O .data 0000000000000000 .hidden __TMC_END__
+0000000000000000 w *UND* 0000000000000000 _ITM_registerTMCloneTable
+00000000004003a8 g F .init 0000000000000000 _init
+</code></pre>
+
+ <hr>
+ <div class="pagination">
+ <ul>
+ <ul>
+
+
+ <li class="prev disabled"><a>← Previous</a></li>
+
+
+ <li><a href="/archive">Archive</a></li>
+
+
+ <li class="next"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/" title="使用gdb解析core dump-概念篇">Next →</a></li>
+
+
+ </ul>
+ </ul>
+ </div>
+ <hr>
+
+<div id="disqus_thread"></div>
+<script>
+ var disqus_developer = 1;
+ var disqus_shortname = 'jekyllbootstrap'; // required: replace example with your forum shortname
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+
+ </div>
+
+ <div class="span4">
+ <h4>Published</h4>
+ <div class="date"><span>2015-06-11</span></div>
+ <br>
+ <h4>Categories</h4>
+ <ul class="tag_box">
+
+ <li>
+ <a href="/categories/#CoreDump-ref">CoreDump <span>2</span></a>
+</li>
+
+ </ul>
+ <br>
+ <h4>Tags</h4>
+ <ul class="tag_box">
+
+ <li>
+ <a href="/tags/#CoreDump-ref">CoreDump <span>2</span></a>
+</li>
+
+ </ul>
+ </div>
+</div>
+
+ </div>
+
+ <footer>
+ <p>© Archer Ding 2013
+ with help from <a href="http://github.com/wendal/gor" target="_blank" title="Gor -- Fast Blog">Gor</a>
+ and <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>
+ and Idea from <a href="http://ruhoh.com" target="_blank" title="The Definitive Technical Blogging Framework">ruhoh</a>
+ </p>
+ </footer>
+
+ </div> <!-- /container -->
+
+
+<script src="//cdnjscn.b0.upaiyun.com/libs/prettify/r298/prettify.min.js"></script>
+<script>
+ var pres = document.getElementsByTagName("pre");
+ for (var i=0; i < pres.length; ++i) {
+ pres[i].className = "prettyprint linenums";
+ }
+ prettyPrint();
+</script>
+
+
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
+ _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
+ _gaq.push(['_setAccount', 'UA-123-12']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script>
+ </body>
+</html>
diff --git a/index.html b/index.html
index 7e8d390..d2812ab 100644
--- a/index.html
+++ b/index.html
@@ -87,7 +87,7 @@
<div class="post">
- <h3 class="title"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/">使用gdb解析core dump(二)</a> <span class="date">2015-06-11</span></h3>
+ <h3 class="title"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/">使用gdb解析core dump-解析篇</a> <span class="date">2015-06-11</span></h3>
<h3>Core dump如何解析?</h3>
@@ -109,12 +109,12 @@
<div class="more">
- <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/" class="btn">read more..</a>
+ <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/" class="btn">read more..</a>
</div>
</div>
<div class="post">
- <h3 class="title"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/">使用gdb解析core dump(一)</a> <span class="date">2015-06-06</span></h3>
+ <h3 class="title"><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/">使用gdb解析core dump-概念篇</a> <span class="date">2015-06-06</span></h3>
<h3>Core dump是什么?</h3>
@@ -137,7 +137,7 @@
<div class="more">
- <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/" class="btn">read more..</a>
+ <a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/" class="btn">read more..</a>
</div>
</div>
diff --git a/rss.xml b/rss.xml
index 2804525..dba6ef8 100644
--- a/rss.xml
+++ b/rss.xml
@@ -2,16 +2,16 @@
<rss version="2.0"> <channel>
<title>ArcherDing's Blog</title>
<link>http://blog.ArcherDing.me</link>
- <pubDate>11 Jun 15 00:37 CST</pubDate>
+ <pubDate>11 Jun 15 00:46 CST</pubDate>
<item>
- <title>使用gdb解析core dump(二)</title>
- <link>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/</link>
+ <title>使用gdb解析core dump-解析篇</title>
+ <link>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/</link>
<pubDate>2015-06-11 12:00:00 +0800</pubDate>
<description><h3>Core dump如何解析?</h3>

<p><code>man 7 signal</code>的结果给了我们一些提示,不妨我们来验证一下。</p>

<p><strong>SIGQUIT信号下的Core dump解析</strong></p>

<p><code>SIGABRT</code>信号表示用户在终端上按了退出键(一般采用Ctrl-\);使用之前用的helloworld程序,运行以后输入Ctrl+\;</p>

<pre><code>archerding@ubuntu:~$ ./hello 
Hello World!
Hello World!
Hello World!
Hello World!
^\Quit (core dumped)
archerding@ubuntu:~$ ls /tmp/core/
core-hello.2213
</code></pre>

<p>接下来开始解析这个core文件;错误提示非常明显<code>Program terminated with signal SIGQUIT, Quit.</code>;</p>

<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/hello core-hello.2213
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-linux-gnu&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
Reading symbols from /home/archerding/hello...(no debugging symbols found)...done.
[New LWP 2213]
Core was generated by `./hello'.
Program terminated with signal SIGQUIT, Quit.
#0 0x00007f4e7d2a2c30 in __nanosleep_nocancel ()
 at ../sysdeps/unix/syscall-template.S:81
81	../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) 
</code></pre>

<p><strong>SIGABRT信号下的Core dump解析</strong></p>

<p><code>SIGABRT</code>信号表示调用abort函数;编写新的测试程序,尝试调用一下<code>abort()</code>函数验证一下;</p>

<pre><code>#include &lt;stdlib.h&gt;

int main()
{
 abort();
 return 0;
}
</code></pre>

<p>编译执行,果真产生了core文件;</p>

<pre><code>archerding@ubuntu:~$ gcc sigabort.c -o sigabort
archerding@ubuntu:~$ ./sigabort 
Aborted (core dumped)
archerding@ubuntu:~$ ls /tmp/core/
core-sigabort.2594
</code></pre>

<p>接下来开始解析这个core文件;错误提示非常明显<code>Program terminated with signal SIGABRT, Aborted.</code>;
使用<code>bt</code>打印栈信息,定位错误调用了<code>abort()</code>函数。</p>

<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/sigabort core-sigabort.2594
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-linux-gnu&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
Reading symbols from /home/archerding/sigabort...(no debugging symbols found)...done.

warning: exec file is newer than core file.
[New LWP 2594]
Core was generated by `./sigabort'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007ff6657bd267 in __GI_raise (sig=sig@entry=6)
 at ../sysdeps/unix/sysv/linux/raise.c:55
55	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ff6657bd267 in __GI_raise (sig=sig@entry=6)
 at ../sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007ff6657beeca in __GI_abort () at abort.c:89
#2 0x000000000040053f in main ()
Print backtrace of all stack frames, or innermost COUNT frames.
With a negative argument, print outermost -COUNT frames.
Use of the 'full' qualifier also prints the values of the local variables.
Use of the 'no-filters' qualifier prohibits frame filters from executing
on this backtrace.

(gdb) 
</code></pre>

<p><strong>SIGFPE信号下的Core dump解析</strong></p>

<p><code>SIGFPE</code>信号表示一个算术运算异常,例如除以0,浮点溢出等;编写新的测试程序,尝试产生<code>SIGFPE</code>信号;</p>

<pre><code>#include &lt;stdlib.h&gt;

int calc(int num)
{
 int divider = 0;
 int result = 0;
 result = num / divider;
 return result;
}

int main()
{
 calc(10);
 return 0;
}
</code></pre>

<p>编译执行,果真产生了core文件;</p>

<pre><code>archerding@ubuntu:~$ gcc sigfpe.c -o sigfpe
archerding@ubuntu:~$ ./sigfpe 
Floating point exception (core dumped)
archerding@ubuntu:~$ ls /tmp/core/
core-sigfpe.2722
</code></pre>

<p>接下来开始解析这个core文件;错误提示<code>Program terminated with signal SIGFPE, Arithmetic exception.</code>;
使用<code>bt</code>打印栈信息,定位错误函数是<code>calc ()</code>函数;
使用<code>i r</code>打印寄存器信息,发现在调用到汇编指令地址<code>rip 0x40050f 0x40050f &lt;calc+25&gt;</code>时出现异常;
使用<code>disas</code>反汇编问题函数,发现在调用<code>idivl -0x8(%rbp)</code>时出错,该汇编指令是做除法运算;
使用<code>x $rbp-0x8</code>打印除数,发现除数为0。</p>

<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/sigfpe core-sigfpe.2722
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-linux-gnu&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
Reading symbols from /home/archerding/sigfpe...(no debugging symbols found)...done.
[New LWP 2722]
Core was generated by `./sigfpe'.
Program terminated with signal SIGFPE, Arithmetic exception.
#0 0x000000000040050f in calc ()
(gdb) bt
#0 0x000000000040050f in calc ()
#1 0x0000000000400528 in main ()
(gdb) i r
rax 0xa	10
rbx 0x0	0
rcx 0x0	0
rdx 0x0	0
rsi 0x7ffcb45b2198	140723334357400
rdi 0xa	10
rbp 0x7ffcb45b20a0	0x7ffcb45b20a0
rsp 0x7ffcb45b20a0	0x7ffcb45b20a0
r8 0x7ff8d052ddd0	140706623708624
r9 0x7ff8d05489d0	140706623818192
r10 0x833	2099
r11 0x7ff8d0188950	140706619885904
r12 0x400400	4195328
r13 0x7ffcb45b2190	140723334357392
r14 0x0	0
r15 0x0	0
rip 0x40050f	0x40050f &lt;calc+25&gt;
eflags 0x10246	[ PF ZF IF RF ]
cs 0x33	51
ss 0x2b	43
ds 0x0	0
es 0x0	0
fs 0x0	0
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
gs 0x0	0
(gdb) disas
Dump of assembler code for function calc:
 0x00000000004004f6 &lt;+0&gt;:	push %rbp
 0x00000000004004f7 &lt;+1&gt;:	mov %rsp,%rbp
 0x00000000004004fa &lt;+4&gt;:	mov %edi,-0x14(%rbp)
 0x00000000004004fd &lt;+7&gt;:	movl $0x0,-0x8(%rbp)
 0x0000000000400504 &lt;+14&gt;:	movl $0x0,-0x4(%rbp)
 0x000000000040050b &lt;+21&gt;:	mov -0x14(%rbp),%eax
 0x000000000040050e &lt;+24&gt;:	cltd 
=&gt; 0x000000000040050f &lt;+25&gt;:	idivl -0x8(%rbp)
 0x0000000000400512 &lt;+28&gt;:	mov %eax,-0x4(%rbp)
 0x0000000000400515 &lt;+31&gt;:	mov -0x4(%rbp),%eax
 0x0000000000400518 &lt;+34&gt;:	pop %rbp
 0x0000000000400519 &lt;+35&gt;:	retq 
End of assembler dump.
(gdb) x $rbp-0x8
0x7ffcb45b2098:	0x00000000
</code></pre>

<p><strong>SIGSEGV信号下的Core dump解析</strong></p>

<p><code>SIGSEGV</code>信号表示进程进行了一次无效的存储访问,EGV表示段违例(segmentation violation);编写新的测试程序,尝试产生<code>SIGSEGV</code>信号;</p>

<pre><code>#include &lt;stdlib.h&gt;

const char *str = &quot;hello World!&quot;;
 
void mod_str()
{
 str[0] = 'H';
}

int main()
{
 mod_str();
 return 0;
}
</code></pre>

<p>编译执行,果真产生了core文件;</p>

<pre><code>archerding@ubuntu:~$ gcc sigsegv.c -o sigsegv
archerding@ubuntu:~$ ./sigsegv 
Segmentation fault (core dumped)
archerding@ubuntu:~$ ls /tmp/core/
core-sigsegv.2856
</code></pre>

<p>接下来开始解析这个core文件;错误提示<code>Program terminated with signal SIGSEGV, Segmentation fault.</code>;
使用<code>bt</code>打印栈信息,定位错误函数是<code>mod_str()</code>函数;
使用<code>i r</code>打印寄存器信息,发现在调用到汇编指令地址<code>rip 0x400509 0x400509 &lt;mod_str+19&gt;</code>时出现异常;
使用<code>disas</code>反汇编问题函数,发现在调用<code>movb $0x48,(%rax)</code>时出错;
使用<code>x /16s $rax</code>打印错误地址指向的内存,发现改地址是<code>0x4005b4</code>指向了字符串<code>hello World!</code>;
使用<code>info proc map</code>查看内存映射,处于第一个区域内。</p>

<pre><code>archerding@ubuntu:/tmp/core$ gdb ~/sigsegv core-sigsegv.2856
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-linux-gnu&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
Reading symbols from /home/archerding/sigsegv...(no debugging symbols found)...done.
[New LWP 2856]
Core was generated by `./sigsegv'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000400509 in mod_str ()
(gdb) bt
#0 0x0000000000400509 in mod_str ()
#1 0x000000000040051c in main ()
(gdb) i r
rax 0x4005b4	4195764
rbx 0x0	0
rcx 0x0	0
rdx 0x7fff284dc488	140733869573256
rsi 0x7fff284dc478	140733869573240
rdi 0x1	1
rbp 0x7fff284dc380	0x7fff284dc380
rsp 0x7fff284dc380	0x7fff284dc380
r8 0x7f590a295dd0	140020399300048
r9 0x7f590a2b09d0	140020399409616
r10 0x833	2099
r11 0x7f5909ef0950	140020395477328
r12 0x400400	4195328
r13 0x7fff284dc470	140733869573232
r14 0x0	0
r15 0x0	0
rip 0x400509	0x400509 &lt;mod_str+19&gt;
eflags 0x10246	[ PF ZF IF RF ]
cs 0x33	51
ss 0x2b	43
ds 0x0	0
es 0x0	0
fs 0x0	0
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
gs 0x0	0
(gdb) disas
Dump of assembler code for function mod_str:
 0x00000000004004f6 &lt;+0&gt;:	push %rbp
 0x00000000004004f7 &lt;+1&gt;:	mov %rsp,%rbp
 0x00000000004004fa &lt;+4&gt;:	mov 0x200b37(%rip),%rax # 0x601038 &lt;str&gt;
 0x0000000000400501 &lt;+11&gt;:	mov %rax,-0x8(%rbp)
 0x0000000000400505 &lt;+15&gt;:	mov -0x8(%rbp),%rax
=&gt; 0x0000000000400509 &lt;+19&gt;:	movb $0x48,(%rax)
 0x000000000040050c &lt;+22&gt;:	pop %rbp
 0x000000000040050d &lt;+23&gt;:	retq 
End of assembler dump.
(gdb) x /16s $rax
0x4005b4:	&quot;hello World!&quot;
0x4005c1:	&quot;&quot;
0x4005c2:	&quot;&quot;
0x4005c3:	&quot;&quot;
0x4005c4:	&quot;\001\033\003;8&quot;
0x4005ca:	&quot;&quot;
0x4005cb:	&quot;&quot;
0x4005cc:	&quot;\006&quot;
0x4005ce:	&quot;&quot;
0x4005cf:	&quot;&quot;
0x4005d0:	&quot;\f\376\377\377\204&quot;
0x4005d6:	&quot;&quot;
0x4005d7:	&quot;&quot;
0x4005d8:	&quot;&lt;\376\377\377T&quot;
0x4005de:	&quot;&quot;
0x4005df:	&quot;&quot;
(gdb) info proc map
Mapped address spaces:

 Start Addr End Addr Size Offset objfile
 0x400000 0x401000 0x1000 0x0 /home/archerding/sigsegv
 0x600000 0x601000 0x1000 0x0 /home/archerding/sigsegv
 0x601000 0x602000 0x1000 0x1000 /home/archerding/sigsegv
 0x7f5909ed0000 0x7f590a090000 0x1c0000 0x0 /lib/x86_64-linux-gnu/libc-2.21.so
 0x7f590a090000 0x7f590a290000 0x200000 0x1c0000 /lib/x86_64-linux-gnu/libc-2.21.so
 0x7f590a290000 0x7f590a294000 0x4000 0x1c0000 /lib/x86_64-linux-gnu/libc-2.21.so
 0x7f590a294000 0x7f590a296000 0x2000 0x1c4000 /lib/x86_64-linux-gnu/libc-2.21.so
 0x7f590a2a0000 0x7f590a2c4000 0x24000 0x0 /lib/x86_64-linux-gnu/ld-2.21.so
 0x7f590a4c3000 0x7f590a4c4000 0x1000 0x23000 /lib/x86_64-linux-gnu/ld-2.21.so
(gdb) 
</code></pre>

<p>接下来使用<code>objdump -t ~/sigsegv</code>进一步确认,发现在修改<code>.rodata</code>段时出错,该段用来保存常量。</p>

<pre><code>archerding@ubuntu:/tmp/core$ objdump -t ~/sigsegv

/home/archerding/sigsegv: file format elf64-x86-64

SYMBOL TABLE:
0000000000400238 l d .interp 0000000000000000 .interp
0000000000400254 l d .note.ABI-tag 0000000000000000 .note.ABI-tag
0000000000400274 l d .note.gnu.build-id 0000000000000000 .note.gnu.build-id
0000000000400298 l d .gnu.hash 0000000000000000 .gnu.hash
00000000004002b8 l d .dynsym 0000000000000000 .dynsym
0000000000400300 l d .dynstr 0000000000000000 .dynstr
0000000000400338 l d .gnu.version 0000000000000000 .gnu.version
0000000000400340 l d .gnu.version_r 0000000000000000 .gnu.version_r
0000000000400360 l d .rela.dyn 0000000000000000 .rela.dyn
0000000000400378 l d .rela.plt 0000000000000000 .rela.plt
00000000004003a8 l d .init 0000000000000000 .init
00000000004003d0 l d .plt 0000000000000000 .plt
0000000000400400 l d .text 0000000000000000 .text
00000000004005a4 l d .fini 0000000000000000 .fini
00000000004005b0 l d .rodata 0000000000000000 .rodata
00000000004005c4 l d .eh_frame_hdr 0000000000000000 .eh_frame_hdr
0000000000400600 l d .eh_frame 0000000000000000 .eh_frame
0000000000600e10 l d .init_array 0000000000000000 .init_array
0000000000600e18 l d .fini_array 0000000000000000 .fini_array
0000000000600e20 l d .jcr 0000000000000000 .jcr
0000000000600e28 l d .dynamic 0000000000000000 .dynamic
0000000000600ff8 l d .got 0000000000000000 .got
0000000000601000 l d .got.plt 0000000000000000 .got.plt
0000000000601028 l d .data 0000000000000000 .data
0000000000601040 l d .bss 0000000000000000 .bss
0000000000000000 l d .comment 0000000000000000 .comment
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
0000000000600e20 l O .jcr 0000000000000000 __JCR_LIST__
0000000000400430 l F .text 0000000000000000 deregister_tm_clones
0000000000400470 l F .text 0000000000000000 register_tm_clones
00000000004004b0 l F .text 0000000000000000 __do_global_dtors_aux
0000000000601040 l O .bss 0000000000000001 completed.7291
0000000000600e18 l O .fini_array 0000000000000000 __do_global_dtors_aux_fini_array_entry
00000000004004d0 l F .text 0000000000000000 frame_dummy
0000000000600e10 l O .init_array 0000000000000000 __frame_dummy_init_array_entry
0000000000000000 l df *ABS* 0000000000000000 sigsegv.c
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
0000000000400710 l O .eh_frame 0000000000000000 __FRAME_END__
0000000000600e20 l O .jcr 0000000000000000 __JCR_END__
0000000000000000 l df *ABS* 0000000000000000 
0000000000600e18 l .init_array 0000000000000000 __init_array_end
0000000000600e28 l O .dynamic 0000000000000000 _DYNAMIC
0000000000600e10 l .init_array 0000000000000000 __init_array_start
0000000000601000 l O .got.plt 0000000000000000 _GLOBAL_OFFSET_TABLE_
00000000004005a0 g F .text 0000000000000002 __libc_csu_fini
0000000000000000 w *UND* 0000000000000000 _ITM_deregisterTMCloneTable
0000000000601028 w .data 0000000000000000 data_start
0000000000601040 g .data 0000000000000000 _edata
00000000004005a4 g F .fini 0000000000000000 _fini
0000000000000000 F *UND* 0000000000000000 __libc_start_main@@GLIBC_2.2.5
0000000000601028 g .data 0000000000000000 __data_start
0000000000000000 w *UND* 0000000000000000 __gmon_start__
0000000000601030 g O .data 0000000000000000 .hidden __dso_handle
00000000004004f6 g F .text 0000000000000018 mod_str
00000000004005b0 g O .rodata 0000000000000004 _IO_stdin_used
0000000000400530 g F .text 0000000000000065 __libc_csu_init
0000000000601048 g .bss 0000000000000000 _end
0000000000400400 g F .text 000000000000002a _start
0000000000601038 g O .data 0000000000000008 str
0000000000601040 g .bss 0000000000000000 __bss_start
000000000040050e g F .text 0000000000000015 main
0000000000000000 w *UND* 0000000000000000 _Jv_RegisterClasses
0000000000601040 g O .data 0000000000000000 .hidden __TMC_END__
0000000000000000 w *UND* 0000000000000000 _ITM_registerTMCloneTable
00000000004003a8 g F .init 0000000000000000 _init
</code></pre>
</description>
</item>
<item>
- <title>使用gdb解析core dump(一)</title>
- <link>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/</link>
+ <title>使用gdb解析core dump-概念篇</title>
+ <link>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/</link>
<pubDate>2015-06-06 12:00:00 +0800</pubDate>
<description><h3>Core dump是什么?</h3>

<p>当一个程序在运行的过程中发生了错误,导致<strong>程序崩溃</strong>或者<strong>异常终止</strong>的时候,操作系统会将这个程序在问题发生时的一些信息以文件的形式保存起来,以便维护人员进行调查,解析问题发生的原因,这个文件就是Core dump文件。
从字面上理解,Core dump(核心转储)就是将core信息以dump格式保存在文件中。
Core信息包括了进程信息、内存信息、寄存器信息、堆栈信息等。</p>

<h3>Core dump保存在哪里?</h3>

<p><strong>开启core dump功能</strong></p>

<p>要想获得Coredump文件就必须先开启保存该文件的功能。
使用<code>ulimit -c</code>可以查看是否开启。如果输出0说明没有开启,使用<code>ulimit -c unlimited</code>可以开启,这种方式不会限制core文件的大小;使用<code>ulimit -c size</code>可以设置core文件大小,单位是KB。但是这种方式只能设置当前终端有效,如果希望永久开启,可以在<code>/etc/profile</code>中追加<code>ulimit -c unlimited</code>。</p>

<p><strong>修改core文件位置</strong></p>

<p>默认情况下会在程序所在目录生成文件名为<code>core</code>的core文件;
使用<code>echo 1 &gt; /proc/sys/kernel/core_uses_pid</code>可以在生成带进程PID的core文件,文件形式为<code>core.pid</code>;
使用<code>echo &quot;/tmp/core/core-%e.%p&quot; &gt; /proc/sys/kernel/core_pattern</code>可以在<code>/tmp/core</code>中生成格式为<code>core-程序名.pid</code>的core文件。</p>

<h3>Core dump如何产生?</h3>

<p>我们知道了程序在<strong>程序崩溃</strong>或者<strong>异常终止</strong>的时候会产生core文件呢?那么使用<code>kill -9</code>会产生core文件吗?
我们不妨做个试验。我们给helloword程序加上死循环来进行测试。</p>

<pre><code>#include &lt;stdio.h&gt;

int main(int argc, char **argv)
{
 while(1){
 fprintf(stdout,&quot;Hello World!\n&quot;);
 fflush(stdout);
 sleep(5);
 }
 return 0;
}
</code></pre>

<pre><code>$ gcc hello.c -o hello
$ ./hello
Hello World!
Hello World!
$ ps -ef | grep hello
archerd+ 2890 2044 0 20:55 pts/1 00:00:00 ./hello
</code></pre>

<p>接下来我们使用下面的命令结束进程,发现没有生成core文件。
&gt; pkill -9 hello</p>

<p>我们继续使用下面的命令结束进程,发现产生core文件。
&gt; kill -s 11 `pgrep hello`</p>

<p>我们可以得出一个结论,并非所有的中断信号都产生core文件。那么什么信号会产生core文件呢??
我们使用<code>man 7 signal</code>来查看一下,原来下表中Action为core的信号才会产生core文件。</p>

<pre><code>Signal Value Action Comment
──────────────────────────────────────────────────────────────────────
SIGHUP 1 Term Hangup detected on controlling terminal
 or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no
 readers
SIGALRM 14 Term Timer signal from alarm(2)
SIGTERM 15 Term Termination signal
SIGUSR1 30,10,16 Term User-defined signal 1
SIGUSR2 31,12,17 Term User-defined signal 2
SIGCHLD 20,17,18 Ign Child stopped or terminated
SIGCONT 19,18,25 Cont Continue if stopped
SIGSTOP 17,19,23 Stop Stop process
SIGTSTP 18,20,24 Stop Stop typed at terminal
SIGTTIN 21,21,26 Stop Terminal input for background process
SIGTTOU 22,22,27 Stop Terminal output for background process
</code></pre>
</description>
</item>
diff --git a/sitemap.xml b/sitemap.xml
index 6dc8533..83558ef 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -4,12 +4,12 @@
<loc>http://blog.ArcherDing.me/</loc>
</url>
<url>
- <loc>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/</loc>
+ <loc>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/</loc>
<lastmod>2015-06-11</lastmod>
<changefreq>weekly</changefreq>
</url>
<url>
- <loc>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/</loc>
+ <loc>http://blog.ArcherDing.me/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/</loc>
<lastmod>2015-06-06</lastmod>
<changefreq>weekly</changefreq>
</url>
diff --git a/tags/index.html b/tags/index.html
index 5daa203..06228e2 100644
--- a/tags/index.html
+++ b/tags/index.html
@@ -109,9 +109,9 @@
<h2 id="CoreDump-ref">CoreDump</h2>
- <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%BA%8C%29/">使用gdb解析core dump(二)</a></li>
+ <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E8%A7%A3%E6%9E%90%E7%AF%87/">使用gdb解析core dump-解析篇</a></li>
- <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump%28%E4%B8%80%29/">使用gdb解析core dump(一)</a></li>
+ <li><a href="/CoreDump/%E4%BD%BF%E7%94%A8gdb%E8%A7%A3%E6%9E%90core-dump-%E6%A6%82%E5%BF%B5%E7%AF%87/">使用gdb解析core dump-概念篇</a></li>
<h2 id="Golang-ref">Golang</h2>