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(一)">&larr; 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-概念篇">&larr; 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> &raquo; <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> &raquo; <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> &raquo; <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> &raquo; <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&#39;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 &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>
+

+    <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-解析篇">&larr; 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 &rarr;</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>&copy; 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&#39;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 &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>
+

+    <hr>

+    <div class="pagination">

+      <ul>

+        <ul>

+          

+          

+            <li class="prev disabled"><a>&larr; 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 &rarr;</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>&copy; 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&#39;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>&lt;h3&gt;Core dump如何解析?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;man 7 signal&lt;/code&gt;的结果给了我们一些提示,不妨我们来验证一下。&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SIGQUIT信号下的Core dump解析&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SIGABRT&lt;/code&gt;信号表示用户在终端上按了退出键(一般采用Ctrl-\);使用之前用的helloworld程序,运行以后输入Ctrl+\;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:~$ ./hello &#xA;Hello World!&#xA;Hello World!&#xA;Hello World!&#xA;Hello World!&#xA;^\Quit (core dumped)&#xA;archerding@ubuntu:~$ ls /tmp/core/&#xA;core-hello.2213&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;接下来开始解析这个core文件;错误提示非常明显&lt;code&gt;Program terminated with signal SIGQUIT, Quit.&lt;/code&gt;;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:/tmp/core$ gdb ~/hello core-hello.2213&#xA;GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&#xA;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&#xA;This is free software: you are free to change and redistribute it.&#xA;There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&#xA;and &amp;quot;show warranty&amp;quot; for details.&#xA;This GDB was configured as &amp;quot;x86_64-linux-gnu&amp;quot;.&#xA;Type &amp;quot;show configuration&amp;quot; for configuration details.&#xA;For bug reporting instructions, please see:&#xA;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&#xA;Find the GDB manual and other documentation resources online at:&#xA;&amp;lt;http://www.gnu.org/software/gdb/documentation/&amp;gt;.&#xA;For help, type &amp;quot;help&amp;quot;.&#xA;Type &amp;quot;apropos word&amp;quot; to search for commands related to &amp;quot;word&amp;quot;...&#xA;Reading symbols from /home/archerding/hello...(no debugging symbols found)...done.&#xA;[New LWP 2213]&#xA;Core was generated by `./hello&#39;.&#xA;Program terminated with signal SIGQUIT, Quit.&#xA;#0  0x00007f4e7d2a2c30 in __nanosleep_nocancel ()&#xA;    at ../sysdeps/unix/syscall-template.S:81&#xA;81&#x9;../sysdeps/unix/syscall-template.S: No such file or directory.&#xA;(gdb) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SIGABRT信号下的Core dump解析&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SIGABRT&lt;/code&gt;信号表示调用abort函数;编写新的测试程序,尝试调用一下&lt;code&gt;abort()&lt;/code&gt;函数验证一下;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;&#xA;&#xA;int main()&#xA;{&#xA;    abort();&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;编译执行,果真产生了core文件;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:~$ gcc sigabort.c -o sigabort&#xA;archerding@ubuntu:~$ ./sigabort &#xA;Aborted (core dumped)&#xA;archerding@ubuntu:~$ ls /tmp/core/&#xA;core-sigabort.2594&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;接下来开始解析这个core文件;错误提示非常明显&lt;code&gt;Program terminated with signal SIGABRT, Aborted.&lt;/code&gt;;&#xA;使用&lt;code&gt;bt&lt;/code&gt;打印栈信息,定位错误调用了&lt;code&gt;abort()&lt;/code&gt;函数。&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:/tmp/core$ gdb ~/sigabort core-sigabort.2594&#xA;GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&#xA;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&#xA;This is free software: you are free to change and redistribute it.&#xA;There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&#xA;and &amp;quot;show warranty&amp;quot; for details.&#xA;This GDB was configured as &amp;quot;x86_64-linux-gnu&amp;quot;.&#xA;Type &amp;quot;show configuration&amp;quot; for configuration details.&#xA;For bug reporting instructions, please see:&#xA;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&#xA;Find the GDB manual and other documentation resources online at:&#xA;&amp;lt;http://www.gnu.org/software/gdb/documentation/&amp;gt;.&#xA;For help, type &amp;quot;help&amp;quot;.&#xA;Type &amp;quot;apropos word&amp;quot; to search for commands related to &amp;quot;word&amp;quot;...&#xA;Reading symbols from /home/archerding/sigabort...(no debugging symbols found)...done.&#xA;&#xA;warning: exec file is newer than core file.&#xA;[New LWP 2594]&#xA;Core was generated by `./sigabort&#39;.&#xA;Program terminated with signal SIGABRT, Aborted.&#xA;#0  0x00007ff6657bd267 in __GI_raise (sig=sig@entry=6)&#xA;    at ../sysdeps/unix/sysv/linux/raise.c:55&#xA;55&#x9;../sysdeps/unix/sysv/linux/raise.c: No such file or directory.&#xA;(gdb) bt&#xA;#0  0x00007ff6657bd267 in __GI_raise (sig=sig@entry=6)&#xA;    at ../sysdeps/unix/sysv/linux/raise.c:55&#xA;#1  0x00007ff6657beeca in __GI_abort () at abort.c:89&#xA;#2  0x000000000040053f in main ()&#xA;Print backtrace of all stack frames, or innermost COUNT frames.&#xA;With a negative argument, print outermost -COUNT frames.&#xA;Use of the &#39;full&#39; qualifier also prints the values of the local variables.&#xA;Use of the &#39;no-filters&#39; qualifier prohibits frame filters from executing&#xA;on this backtrace.&#xA;&#xA;(gdb) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SIGFPE信号下的Core dump解析&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SIGFPE&lt;/code&gt;信号表示一个算术运算异常,例如除以0,浮点溢出等;编写新的测试程序,尝试产生&lt;code&gt;SIGFPE&lt;/code&gt;信号;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;&#xA;&#xA;int calc(int num)&#xA;{&#xA;    int divider = 0;&#xA;    int result = 0;&#xA;    result = num / divider;&#xA;    return result;&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    calc(10);&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;编译执行,果真产生了core文件;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:~$ gcc sigfpe.c -o sigfpe&#xA;archerding@ubuntu:~$ ./sigfpe &#xA;Floating point exception (core dumped)&#xA;archerding@ubuntu:~$ ls /tmp/core/&#xA;core-sigfpe.2722&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;接下来开始解析这个core文件;错误提示&lt;code&gt;Program terminated with signal SIGFPE, Arithmetic exception.&lt;/code&gt;;&#xA;使用&lt;code&gt;bt&lt;/code&gt;打印栈信息,定位错误函数是&lt;code&gt;calc ()&lt;/code&gt;函数;&#xA;使用&lt;code&gt;i r&lt;/code&gt;打印寄存器信息,发现在调用到汇编指令地址&lt;code&gt;rip            0x40050f 0x40050f &amp;lt;calc+25&amp;gt;&lt;/code&gt;时出现异常;&#xA;使用&lt;code&gt;disas&lt;/code&gt;反汇编问题函数,发现在调用&lt;code&gt;idivl  -0x8(%rbp)&lt;/code&gt;时出错,该汇编指令是做除法运算;&#xA;使用&lt;code&gt;x $rbp-0x8&lt;/code&gt;打印除数,发现除数为0。&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:/tmp/core$ gdb ~/sigfpe core-sigfpe.2722&#xA;GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&#xA;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&#xA;This is free software: you are free to change and redistribute it.&#xA;There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&#xA;and &amp;quot;show warranty&amp;quot; for details.&#xA;This GDB was configured as &amp;quot;x86_64-linux-gnu&amp;quot;.&#xA;Type &amp;quot;show configuration&amp;quot; for configuration details.&#xA;For bug reporting instructions, please see:&#xA;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&#xA;Find the GDB manual and other documentation resources online at:&#xA;&amp;lt;http://www.gnu.org/software/gdb/documentation/&amp;gt;.&#xA;For help, type &amp;quot;help&amp;quot;.&#xA;Type &amp;quot;apropos word&amp;quot; to search for commands related to &amp;quot;word&amp;quot;...&#xA;Reading symbols from /home/archerding/sigfpe...(no debugging symbols found)...done.&#xA;[New LWP 2722]&#xA;Core was generated by `./sigfpe&#39;.&#xA;Program terminated with signal SIGFPE, Arithmetic exception.&#xA;#0  0x000000000040050f in calc ()&#xA;(gdb) bt&#xA;#0  0x000000000040050f in calc ()&#xA;#1  0x0000000000400528 in main ()&#xA;(gdb) i r&#xA;rax            0xa&#x9;10&#xA;rbx            0x0&#x9;0&#xA;rcx            0x0&#x9;0&#xA;rdx            0x0&#x9;0&#xA;rsi            0x7ffcb45b2198&#x9;140723334357400&#xA;rdi            0xa&#x9;10&#xA;rbp            0x7ffcb45b20a0&#x9;0x7ffcb45b20a0&#xA;rsp            0x7ffcb45b20a0&#x9;0x7ffcb45b20a0&#xA;r8             0x7ff8d052ddd0&#x9;140706623708624&#xA;r9             0x7ff8d05489d0&#x9;140706623818192&#xA;r10            0x833&#x9;2099&#xA;r11            0x7ff8d0188950&#x9;140706619885904&#xA;r12            0x400400&#x9;4195328&#xA;r13            0x7ffcb45b2190&#x9;140723334357392&#xA;r14            0x0&#x9;0&#xA;r15            0x0&#x9;0&#xA;rip            0x40050f&#x9;0x40050f &amp;lt;calc+25&amp;gt;&#xA;eflags         0x10246&#x9;[ PF ZF IF RF ]&#xA;cs             0x33&#x9;51&#xA;ss             0x2b&#x9;43&#xA;ds             0x0&#x9;0&#xA;es             0x0&#x9;0&#xA;fs             0x0&#x9;0&#xA;---Type &amp;lt;return&amp;gt; to continue, or q &amp;lt;return&amp;gt; to quit---&#xA;gs             0x0&#x9;0&#xA;(gdb) disas&#xA;Dump of assembler code for function calc:&#xA;   0x00000000004004f6 &amp;lt;+0&amp;gt;:&#x9;push   %rbp&#xA;   0x00000000004004f7 &amp;lt;+1&amp;gt;:&#x9;mov    %rsp,%rbp&#xA;   0x00000000004004fa &amp;lt;+4&amp;gt;:&#x9;mov    %edi,-0x14(%rbp)&#xA;   0x00000000004004fd &amp;lt;+7&amp;gt;:&#x9;movl   $0x0,-0x8(%rbp)&#xA;   0x0000000000400504 &amp;lt;+14&amp;gt;:&#x9;movl   $0x0,-0x4(%rbp)&#xA;   0x000000000040050b &amp;lt;+21&amp;gt;:&#x9;mov    -0x14(%rbp),%eax&#xA;   0x000000000040050e &amp;lt;+24&amp;gt;:&#x9;cltd   &#xA;=&amp;gt; 0x000000000040050f &amp;lt;+25&amp;gt;:&#x9;idivl  -0x8(%rbp)&#xA;   0x0000000000400512 &amp;lt;+28&amp;gt;:&#x9;mov    %eax,-0x4(%rbp)&#xA;   0x0000000000400515 &amp;lt;+31&amp;gt;:&#x9;mov    -0x4(%rbp),%eax&#xA;   0x0000000000400518 &amp;lt;+34&amp;gt;:&#x9;pop    %rbp&#xA;   0x0000000000400519 &amp;lt;+35&amp;gt;:&#x9;retq   &#xA;End of assembler dump.&#xA;(gdb) x $rbp-0x8&#xA;0x7ffcb45b2098:&#x9;0x00000000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SIGSEGV信号下的Core dump解析&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SIGSEGV&lt;/code&gt;信号表示进程进行了一次无效的存储访问,EGV表示段违例(segmentation violation);编写新的测试程序,尝试产生&lt;code&gt;SIGSEGV&lt;/code&gt;信号;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;&#xA;&#xA;const char *str = &amp;quot;hello World!&amp;quot;;&#xA; &#xA;void mod_str()&#xA;{&#xA;    str[0] = &#39;H&#39;;&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    mod_str();&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;编译执行,果真产生了core文件;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:~$ gcc sigsegv.c -o sigsegv&#xA;archerding@ubuntu:~$ ./sigsegv &#xA;Segmentation fault (core dumped)&#xA;archerding@ubuntu:~$ ls /tmp/core/&#xA;core-sigsegv.2856&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;接下来开始解析这个core文件;错误提示&lt;code&gt;Program terminated with signal SIGSEGV, Segmentation fault.&lt;/code&gt;;&#xA;使用&lt;code&gt;bt&lt;/code&gt;打印栈信息,定位错误函数是&lt;code&gt;mod_str()&lt;/code&gt;函数;&#xA;使用&lt;code&gt;i r&lt;/code&gt;打印寄存器信息,发现在调用到汇编指令地址&lt;code&gt;rip           0x400509  0x400509 &amp;lt;mod_str+19&amp;gt;&lt;/code&gt;时出现异常;&#xA;使用&lt;code&gt;disas&lt;/code&gt;反汇编问题函数,发现在调用&lt;code&gt;movb   $0x48,(%rax)&lt;/code&gt;时出错;&#xA;使用&lt;code&gt;x /16s $rax&lt;/code&gt;打印错误地址指向的内存,发现改地址是&lt;code&gt;0x4005b4&lt;/code&gt;指向了字符串&lt;code&gt;hello World!&lt;/code&gt;;&#xA;使用&lt;code&gt;info proc map&lt;/code&gt;查看内存映射,处于第一个区域内。&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:/tmp/core$ gdb ~/sigsegv core-sigsegv.2856&#xA;GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&#xA;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&#xA;This is free software: you are free to change and redistribute it.&#xA;There is NO WARRANTY, to the extent permitted by law.  Type &amp;quot;show copying&amp;quot;&#xA;and &amp;quot;show warranty&amp;quot; for details.&#xA;This GDB was configured as &amp;quot;x86_64-linux-gnu&amp;quot;.&#xA;Type &amp;quot;show configuration&amp;quot; for configuration details.&#xA;For bug reporting instructions, please see:&#xA;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&#xA;Find the GDB manual and other documentation resources online at:&#xA;&amp;lt;http://www.gnu.org/software/gdb/documentation/&amp;gt;.&#xA;For help, type &amp;quot;help&amp;quot;.&#xA;Type &amp;quot;apropos word&amp;quot; to search for commands related to &amp;quot;word&amp;quot;...&#xA;Reading symbols from /home/archerding/sigsegv...(no debugging symbols found)...done.&#xA;[New LWP 2856]&#xA;Core was generated by `./sigsegv&#39;.&#xA;Program terminated with signal SIGSEGV, Segmentation fault.&#xA;#0  0x0000000000400509 in mod_str ()&#xA;(gdb) bt&#xA;#0  0x0000000000400509 in mod_str ()&#xA;#1  0x000000000040051c in main ()&#xA;(gdb) i r&#xA;rax            0x4005b4&#x9;4195764&#xA;rbx            0x0&#x9;0&#xA;rcx            0x0&#x9;0&#xA;rdx            0x7fff284dc488&#x9;140733869573256&#xA;rsi            0x7fff284dc478&#x9;140733869573240&#xA;rdi            0x1&#x9;1&#xA;rbp            0x7fff284dc380&#x9;0x7fff284dc380&#xA;rsp            0x7fff284dc380&#x9;0x7fff284dc380&#xA;r8             0x7f590a295dd0&#x9;140020399300048&#xA;r9             0x7f590a2b09d0&#x9;140020399409616&#xA;r10            0x833&#x9;2099&#xA;r11            0x7f5909ef0950&#x9;140020395477328&#xA;r12            0x400400&#x9;4195328&#xA;r13            0x7fff284dc470&#x9;140733869573232&#xA;r14            0x0&#x9;0&#xA;r15            0x0&#x9;0&#xA;rip            0x400509&#x9;0x400509 &amp;lt;mod_str+19&amp;gt;&#xA;eflags         0x10246&#x9;[ PF ZF IF RF ]&#xA;cs             0x33&#x9;51&#xA;ss             0x2b&#x9;43&#xA;ds             0x0&#x9;0&#xA;es             0x0&#x9;0&#xA;fs             0x0&#x9;0&#xA;---Type &amp;lt;return&amp;gt; to continue, or q &amp;lt;return&amp;gt; to quit---&#xA;gs             0x0&#x9;0&#xA;(gdb) disas&#xA;Dump of assembler code for function mod_str:&#xA;   0x00000000004004f6 &amp;lt;+0&amp;gt;:&#x9;push   %rbp&#xA;   0x00000000004004f7 &amp;lt;+1&amp;gt;:&#x9;mov    %rsp,%rbp&#xA;   0x00000000004004fa &amp;lt;+4&amp;gt;:&#x9;mov    0x200b37(%rip),%rax        # 0x601038 &amp;lt;str&amp;gt;&#xA;   0x0000000000400501 &amp;lt;+11&amp;gt;:&#x9;mov    %rax,-0x8(%rbp)&#xA;   0x0000000000400505 &amp;lt;+15&amp;gt;:&#x9;mov    -0x8(%rbp),%rax&#xA;=&amp;gt; 0x0000000000400509 &amp;lt;+19&amp;gt;:&#x9;movb   $0x48,(%rax)&#xA;   0x000000000040050c &amp;lt;+22&amp;gt;:&#x9;pop    %rbp&#xA;   0x000000000040050d &amp;lt;+23&amp;gt;:&#x9;retq   &#xA;End of assembler dump.&#xA;(gdb) x /16s $rax&#xA;0x4005b4:&#x9;&amp;quot;hello World!&amp;quot;&#xA;0x4005c1:&#x9;&amp;quot;&amp;quot;&#xA;0x4005c2:&#x9;&amp;quot;&amp;quot;&#xA;0x4005c3:&#x9;&amp;quot;&amp;quot;&#xA;0x4005c4:&#x9;&amp;quot;\001\033\003;8&amp;quot;&#xA;0x4005ca:&#x9;&amp;quot;&amp;quot;&#xA;0x4005cb:&#x9;&amp;quot;&amp;quot;&#xA;0x4005cc:&#x9;&amp;quot;\006&amp;quot;&#xA;0x4005ce:&#x9;&amp;quot;&amp;quot;&#xA;0x4005cf:&#x9;&amp;quot;&amp;quot;&#xA;0x4005d0:&#x9;&amp;quot;\f\376\377\377\204&amp;quot;&#xA;0x4005d6:&#x9;&amp;quot;&amp;quot;&#xA;0x4005d7:&#x9;&amp;quot;&amp;quot;&#xA;0x4005d8:&#x9;&amp;quot;&amp;lt;\376\377\377T&amp;quot;&#xA;0x4005de:&#x9;&amp;quot;&amp;quot;&#xA;0x4005df:&#x9;&amp;quot;&amp;quot;&#xA;(gdb) info proc map&#xA;Mapped address spaces:&#xA;&#xA;          Start Addr           End Addr       Size     Offset objfile&#xA;            0x400000           0x401000     0x1000        0x0 /home/archerding/sigsegv&#xA;            0x600000           0x601000     0x1000        0x0 /home/archerding/sigsegv&#xA;            0x601000           0x602000     0x1000     0x1000 /home/archerding/sigsegv&#xA;      0x7f5909ed0000     0x7f590a090000   0x1c0000        0x0 /lib/x86_64-linux-gnu/libc-2.21.so&#xA;      0x7f590a090000     0x7f590a290000   0x200000   0x1c0000 /lib/x86_64-linux-gnu/libc-2.21.so&#xA;      0x7f590a290000     0x7f590a294000     0x4000   0x1c0000 /lib/x86_64-linux-gnu/libc-2.21.so&#xA;      0x7f590a294000     0x7f590a296000     0x2000   0x1c4000 /lib/x86_64-linux-gnu/libc-2.21.so&#xA;      0x7f590a2a0000     0x7f590a2c4000    0x24000        0x0 /lib/x86_64-linux-gnu/ld-2.21.so&#xA;      0x7f590a4c3000     0x7f590a4c4000     0x1000    0x23000 /lib/x86_64-linux-gnu/ld-2.21.so&#xA;(gdb) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;接下来使用&lt;code&gt;objdump -t ~/sigsegv&lt;/code&gt;进一步确认,发现在修改&lt;code&gt;.rodata&lt;/code&gt;段时出错,该段用来保存常量。&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archerding@ubuntu:/tmp/core$ objdump -t ~/sigsegv&#xA;&#xA;/home/archerding/sigsegv:     file format elf64-x86-64&#xA;&#xA;SYMBOL TABLE:&#xA;0000000000400238 l    d  .interp    0000000000000000              .interp&#xA;0000000000400254 l    d  .note.ABI-tag  0000000000000000              .note.ABI-tag&#xA;0000000000400274 l    d  .note.gnu.build-id 0000000000000000              .note.gnu.build-id&#xA;0000000000400298 l    d  .gnu.hash  0000000000000000              .gnu.hash&#xA;00000000004002b8 l    d  .dynsym    0000000000000000              .dynsym&#xA;0000000000400300 l    d  .dynstr    0000000000000000              .dynstr&#xA;0000000000400338 l    d  .gnu.version   0000000000000000              .gnu.version&#xA;0000000000400340 l    d  .gnu.version_r 0000000000000000              .gnu.version_r&#xA;0000000000400360 l    d  .rela.dyn  0000000000000000              .rela.dyn&#xA;0000000000400378 l    d  .rela.plt  0000000000000000              .rela.plt&#xA;00000000004003a8 l    d  .init  0000000000000000              .init&#xA;00000000004003d0 l    d  .plt   0000000000000000              .plt&#xA;0000000000400400 l    d  .text  0000000000000000              .text&#xA;00000000004005a4 l    d  .fini  0000000000000000              .fini&#xA;00000000004005b0 l    d  .rodata    0000000000000000              .rodata&#xA;00000000004005c4 l    d  .eh_frame_hdr  0000000000000000              .eh_frame_hdr&#xA;0000000000400600 l    d  .eh_frame  0000000000000000              .eh_frame&#xA;0000000000600e10 l    d  .init_array    0000000000000000              .init_array&#xA;0000000000600e18 l    d  .fini_array    0000000000000000              .fini_array&#xA;0000000000600e20 l    d  .jcr   0000000000000000              .jcr&#xA;0000000000600e28 l    d  .dynamic   0000000000000000              .dynamic&#xA;0000000000600ff8 l    d  .got   0000000000000000              .got&#xA;0000000000601000 l    d  .got.plt   0000000000000000              .got.plt&#xA;0000000000601028 l    d  .data  0000000000000000              .data&#xA;0000000000601040 l    d  .bss   0000000000000000              .bss&#xA;0000000000000000 l    d  .comment   0000000000000000              .comment&#xA;0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c&#xA;0000000000600e20 l     O .jcr   0000000000000000              __JCR_LIST__&#xA;0000000000400430 l     F .text  0000000000000000              deregister_tm_clones&#xA;0000000000400470 l     F .text  0000000000000000              register_tm_clones&#xA;00000000004004b0 l     F .text  0000000000000000              __do_global_dtors_aux&#xA;0000000000601040 l     O .bss   0000000000000001              completed.7291&#xA;0000000000600e18 l     O .fini_array    0000000000000000              __do_global_dtors_aux_fini_array_entry&#xA;00000000004004d0 l     F .text  0000000000000000              frame_dummy&#xA;0000000000600e10 l     O .init_array    0000000000000000              __frame_dummy_init_array_entry&#xA;0000000000000000 l    df *ABS*  0000000000000000              sigsegv.c&#xA;0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c&#xA;0000000000400710 l     O .eh_frame  0000000000000000              __FRAME_END__&#xA;0000000000600e20 l     O .jcr   0000000000000000              __JCR_END__&#xA;0000000000000000 l    df *ABS*  0000000000000000              &#xA;0000000000600e18 l       .init_array    0000000000000000              __init_array_end&#xA;0000000000600e28 l     O .dynamic   0000000000000000              _DYNAMIC&#xA;0000000000600e10 l       .init_array    0000000000000000              __init_array_start&#xA;0000000000601000 l     O .got.plt   0000000000000000              _GLOBAL_OFFSET_TABLE_&#xA;00000000004005a0 g     F .text  0000000000000002              __libc_csu_fini&#xA;0000000000000000  w      *UND*  0000000000000000              _ITM_deregisterTMCloneTable&#xA;0000000000601028  w      .data  0000000000000000              data_start&#xA;0000000000601040 g       .data  0000000000000000              _edata&#xA;00000000004005a4 g     F .fini  0000000000000000              _fini&#xA;0000000000000000       F *UND*  0000000000000000              __libc_start_main@@GLIBC_2.2.5&#xA;0000000000601028 g       .data  0000000000000000              __data_start&#xA;0000000000000000  w      *UND*  0000000000000000              __gmon_start__&#xA;0000000000601030 g     O .data  0000000000000000              .hidden __dso_handle&#xA;00000000004004f6 g     F .text  0000000000000018              mod_str&#xA;00000000004005b0 g     O .rodata    0000000000000004              _IO_stdin_used&#xA;0000000000400530 g     F .text  0000000000000065              __libc_csu_init&#xA;0000000000601048 g       .bss   0000000000000000              _end&#xA;0000000000400400 g     F .text  000000000000002a              _start&#xA;0000000000601038 g     O .data  0000000000000008              str&#xA;0000000000601040 g       .bss   0000000000000000              __bss_start&#xA;000000000040050e g     F .text  0000000000000015              main&#xA;0000000000000000  w      *UND*  0000000000000000              _Jv_RegisterClasses&#xA;0000000000601040 g     O .data  0000000000000000              .hidden __TMC_END__&#xA;0000000000000000  w      *UND*  0000000000000000              _ITM_registerTMCloneTable&#xA;00000000004003a8 g     F .init  0000000000000000              _init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</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>&lt;h3&gt;Core dump是什么?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;当一个程序在运行的过程中发生了错误,导致&lt;strong&gt;程序崩溃&lt;/strong&gt;或者&lt;strong&gt;异常终止&lt;/strong&gt;的时候,操作系统会将这个程序在问题发生时的一些信息以文件的形式保存起来,以便维护人员进行调查,解析问题发生的原因,这个文件就是Core dump文件。&#xA;从字面上理解,Core dump(核心转储)就是将core信息以dump格式保存在文件中。&#xA;Core信息包括了进程信息、内存信息、寄存器信息、堆栈信息等。&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Core dump保存在哪里?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;开启core dump功能&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;要想获得Coredump文件就必须先开启保存该文件的功能。&#xA;使用&lt;code&gt;ulimit -c&lt;/code&gt;可以查看是否开启。如果输出0说明没有开启,使用&lt;code&gt;ulimit -c unlimited&lt;/code&gt;可以开启,这种方式不会限制core文件的大小;使用&lt;code&gt;ulimit -c  size&lt;/code&gt;可以设置core文件大小,单位是KB。但是这种方式只能设置当前终端有效,如果希望永久开启,可以在&lt;code&gt;/etc/profile&lt;/code&gt;中追加&lt;code&gt;ulimit -c unlimited&lt;/code&gt;。&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;修改core文件位置&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;默认情况下会在程序所在目录生成文件名为&lt;code&gt;core&lt;/code&gt;的core文件;&#xA;使用&lt;code&gt;echo 1 &amp;gt; /proc/sys/kernel/core_uses_pid&lt;/code&gt;可以在生成带进程PID的core文件,文件形式为&lt;code&gt;core.pid&lt;/code&gt;;&#xA;使用&lt;code&gt;echo &amp;quot;/tmp/core/core-%e.%p&amp;quot; &amp;gt; /proc/sys/kernel/core_pattern&lt;/code&gt;可以在&lt;code&gt;/tmp/core&lt;/code&gt;中生成格式为&lt;code&gt;core-程序名.pid&lt;/code&gt;的core文件。&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Core dump如何产生?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;我们知道了程序在&lt;strong&gt;程序崩溃&lt;/strong&gt;或者&lt;strong&gt;异常终止&lt;/strong&gt;的时候会产生core文件呢?那么使用&lt;code&gt;kill -9&lt;/code&gt;会产生core文件吗?&#xA;我们不妨做个试验。我们给helloword程序加上死循环来进行测试。&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;&#xA;int main(int argc, char **argv)&#xA;{&#xA;    while(1){&#xA;        fprintf(stdout,&amp;quot;Hello World!\n&amp;quot;);&#xA;        fflush(stdout);&#xA;        sleep(5);&#xA;    }&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ gcc hello.c -o hello&#xA;$ ./hello&#xA;Hello World!&#xA;Hello World!&#xA;$ ps -ef | grep hello&#xA;archerd+  2890  2044  0 20:55 pts/1    00:00:00 ./hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;接下来我们使用下面的命令结束进程,发现没有生成core文件。&#xA;&amp;gt; pkill -9 hello&lt;/p&gt;&#xA;&#xA;&lt;p&gt;我们继续使用下面的命令结束进程,发现产生core文件。&#xA;&amp;gt; kill -s 11 `pgrep hello`&lt;/p&gt;&#xA;&#xA;&lt;p&gt;我们可以得出一个结论,并非所有的中断信号都产生core文件。那么什么信号会产生core文件呢??&#xA;我们使用&lt;code&gt;man 7 signal&lt;/code&gt;来查看一下,原来下表中Action为core的信号才会产生core文件。&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Signal     Value     Action   Comment&#xA;──────────────────────────────────────────────────────────────────────&#xA;SIGHUP        1       Term    Hangup detected on controlling terminal&#xA;                              or death of controlling process&#xA;SIGINT        2       Term    Interrupt from keyboard&#xA;SIGQUIT       3       Core    Quit from keyboard&#xA;SIGILL        4       Core    Illegal Instruction&#xA;SIGABRT       6       Core    Abort signal from abort(3)&#xA;SIGFPE        8       Core    Floating point exception&#xA;SIGKILL       9       Term    Kill signal&#xA;SIGSEGV      11       Core    Invalid memory reference&#xA;SIGPIPE      13       Term    Broken pipe: write to pipe with no&#xA;                              readers&#xA;SIGALRM      14       Term    Timer signal from alarm(2)&#xA;SIGTERM      15       Term    Termination signal&#xA;SIGUSR1   30,10,16    Term    User-defined signal 1&#xA;SIGUSR2   31,12,17    Term    User-defined signal 2&#xA;SIGCHLD   20,17,18    Ign     Child stopped or terminated&#xA;SIGCONT   19,18,25    Cont    Continue if stopped&#xA;SIGSTOP   17,19,23    Stop    Stop process&#xA;SIGTSTP   18,20,24    Stop    Stop typed at terminal&#xA;SIGTTIN   21,21,26    Stop    Terminal input for background process&#xA;SIGTTOU   22,22,27    Stop    Terminal output for background process&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</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>