﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-天使的白骨-文章分类-Linux</title><link>http://www.cppblog.com/TianShiDeBaiGu/category/17189.html</link><description>给我一个EMACS，我不需要操作系统</description><language>zh-cn</language><lastBuildDate>Thu, 27 Dec 2018 17:35:09 GMT</lastBuildDate><pubDate>Thu, 27 Dec 2018 17:35:09 GMT</pubDate><ttl>60</ttl><item><title>sqlite错误列表</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/203297.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 18 Sep 2013 03:24:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/203297.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/203297.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/203297.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/203297.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/203297.html</trackback:ping><description><![CDATA[@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<div>#define SQLITE_OK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; /* 成功 | Successful result */</div>
<div>/* 错误码开始 */</div>
<div>#define SQLITE_ERROR &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; /* SQL错误 或 丢失数据库 | SQL error or missing database */</div>
<div>#define SQLITE_INTERNAL &nbsp; &nbsp; 2 &nbsp; /* SQLite 内部逻辑错误 | Internal logic error in SQLite */</div>
<div>#define SQLITE_PERM &nbsp; &nbsp; &nbsp; &nbsp; 3 &nbsp; /* 拒绝访问 | Access permission denied */</div>
<div>#define SQLITE_ABORT &nbsp; &nbsp; &nbsp; &nbsp;4 &nbsp; /* 回调函数请求取消操作 | Callback routine requested an abort */</div>
<div>#define SQLITE_BUSY &nbsp; &nbsp; &nbsp; &nbsp; 5 &nbsp; /* 数据库文件被锁定 | The database file is locked */</div>
<div>#define SQLITE_LOCKED &nbsp; &nbsp; &nbsp; 6 &nbsp; /* 数据库中的一个表被锁定 | A table in the database is locked */</div>
<div>#define SQLITE_NOMEM &nbsp; &nbsp; &nbsp; &nbsp;7 &nbsp; /* 某次 malloc() 函数调用失败 | A malloc() failed */</div>
<div>#define SQLITE_READONLY &nbsp; &nbsp; 8 &nbsp; /* 尝试写入一个只读数据库 | Attempt to write a readonly database */</div>
<div>#define SQLITE_INTERRUPT &nbsp; &nbsp;9 &nbsp; /* 操作被 sqlite3_interupt() 函数中断 | Operation terminated by sqlite3_interrupt() */</div>
<div>#define SQLITE_IOERR &nbsp; &nbsp; &nbsp; 10 &nbsp; /* 发生某些磁盘 I/O 错误 | Some kind of disk I/O error occurred */</div>
<div>#define SQLITE_CORRUPT &nbsp; &nbsp; 11 &nbsp; /* 数据库磁盘映像不正确 | The database disk image is malformed */</div>
<div>#define SQLITE_NOTFOUND &nbsp; &nbsp;12 &nbsp; /* sqlite3_file_control() 中出现未知操作数 | Unknown opcode in sqlite3_file_control() */</div>
<div>#define SQLITE_FULL &nbsp; &nbsp; &nbsp; &nbsp;13 &nbsp; /* 因为数据库满导致插入失败 | Insertion failed because database is full */</div>
<div>#define SQLITE_CANTOPEN &nbsp; &nbsp;14 &nbsp; /* 无法打开数据库文件 | Unable to open the database file */</div>
<div>#define SQLITE_PROTOCOL &nbsp; &nbsp;15 &nbsp; /* 数据库锁定协议错误 | Database lock protocol error */</div>
<div>#define SQLITE_EMPTY &nbsp; &nbsp; &nbsp; 16 &nbsp; /* 数据库为空 | Database is empty */</div>
<div>#define SQLITE_SCHEMA &nbsp; &nbsp; &nbsp;17 &nbsp; /* 数据结构发生改变 | The database schema changed */</div>
<div>#define SQLITE_TOOBIG &nbsp; &nbsp; &nbsp;18 &nbsp; /* 字符串或二进制数据超过大小限制 | String or BLOB exceeds size limit */</div>
<div>#define SQLITE_CONSTRAINT &nbsp;19 &nbsp; /* 由于约束违例而取消 | Abort due to constraint violation */</div>
<div>#define SQLITE_MISMATCH &nbsp; &nbsp;20 &nbsp; /* 数据类型不匹配 | Data type mismatch */</div>
<div>#define SQLITE_MISUSE &nbsp; &nbsp; &nbsp;21 &nbsp; /* 不正确的库使用 | Library used incorrectly */</div>
<div>#define SQLITE_NOLFS &nbsp; &nbsp; &nbsp; 22 &nbsp; /* 使用了操作系统不支持的功能 | Uses OS features not supported on host */</div>
<div>#define SQLITE_AUTH &nbsp; &nbsp; &nbsp; &nbsp;23 &nbsp; /* 授权失败 | Authorization denied */</div>
<div>#define SQLITE_FORMAT &nbsp; &nbsp; &nbsp;24 &nbsp; /* 附加数据库格式错误 | Auxiliary database format error */</div>
<div>#define SQLITE_RANGE &nbsp; &nbsp; &nbsp; 25 &nbsp; /* 传递给sqlite3_bind()的第二个参数超出范围 | 2nd parameter to sqlite3_bind out of range */</div>
<div>#define SQLITE_NOTADB &nbsp; &nbsp; &nbsp;26 &nbsp; /* 被打开的文件不是一个数据库文件 | File opened that is not a database file */</div>
<div>#define SQLITE_ROW &nbsp; &nbsp; &nbsp; &nbsp; 100 &nbsp;/* sqlite3_step() 已经产生一个行结果 | sqlite3_step() has another row ready */</div>
<div>#define SQLITE_DONE &nbsp; &nbsp; &nbsp; &nbsp;101 &nbsp;/* sqlite3_step() 完成执行操作 | sqlite3_step() has finished executing */</div>
<div>/* 错误码结束 */</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/203297.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2013-09-18 11:24 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/203297.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>emacs实用函数总结</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/199528.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 17 Apr 2013 17:09:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/199528.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/199528.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/199528.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/199528.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/199528.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 部分非原创，但求有益大众align-regexp代码对齐C-M-\一般都能满足需要，可是有时候需要按一行中的某些字符对齐，比如一些变态的语言或者编程规范规定赋值语句需要按 &#8220;=&#8221; 对齐，那怎么办?align-regexp 使用起来只需要选中需要对齐的 region，然后执行，输入需要匹配的正则表达式即可。1 2 3 int var = 2; int variable_is_...&nbsp;&nbsp;<a href='http://www.cppblog.com/TianShiDeBaiGu/articles/199528.html'>阅读全文</a><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/199528.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2013-04-18 01:09 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/199528.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>EMACS 24配置遇到的问题以及解决方案</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/199527.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 17 Apr 2013 17:08:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/199527.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/199527.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/199527.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/199527.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/199527.html</trackback:ping><description><![CDATA[<h1><a id="viewpost1_TitleUrl" href="http://www.cppblog.com/TianShiDeBaiGu/archive/2012/10/24/emacs24.html" style="color: #ff6600; text-decoration: none;">EMACS 24配置遇到的问题以及解决方案</a></h1><div style="padding-left: 20px; font-size: 13px; color: #5e5e5e; font-family: Verdana, Helvetica, Arial; line-height: 18px; text-align: justify; background-color: #ffffff;"><div><span style="color: red;">1 emacs24在cedet使用时于老版本的cedet不兼容</span><br />需要去cedet官方下载最新的2.4版本的cedet，使用./configure;make;编译，并将cedet-build.el编译为二进制文件以提高效率，命令为：emacs -Q -l cedet-build.el -f cedet-build<br /><br /><span style="color: red;">2 出现</span><span style="color: red;">symbols function definition is void:eieio-build-class-alist错误提示<br /></span><span style="color: #000000;">需要在.emacs中(require 'cedet)后增加一行(require 'eieio-opt)<br /><br /></span><span style="color: red;">3 无法找到gdb-ui.el这个文件<br /></span><span style="color: #000000;">emacs24将gdb图形化调试工具的插件名改为了gdb-mi,因此，在.emacs中应该将原来的(require 'gdb-ui)改为(require 'gdb-mi)<br /><br /></span><div><span style="color: red;">4 load-with-code-conversion("/home/.emacs" "/home/.emacs" t t)</span><br />这个错误原因为找不到正确的site-lisp位置，如果是自己编译的emacs需要确认自己的site-lisp是位于/usr/local/share/emacs下，而不是/usr/share/emacs下。</div></div></div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/199527.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2013-04-18 01:08 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/199527.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>emacs收拾弹出窗口  好东西 popwin.el</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/196629.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 26 Dec 2012 01:31:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/196629.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/196629.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/196629.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/196629.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/196629.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: ;;; popwin.el --- Popup Window Manager.;; Copyright (C) 2011, 2012  Tomohiro Matsuyama;; Author: Tomohiro Matsuyama &lt;tomo@cx4a.org&gt;;; Keywords: convenience;; Version: 0.6.1;; This program is fre...&nbsp;&nbsp;<a href='http://www.cppblog.com/TianShiDeBaiGu/articles/196629.html'>阅读全文</a><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/196629.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2012-12-26 09:31 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/196629.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>redhat使用yum使用安装ISO镜像或者光盘上的软件</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/kvm.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Tue, 09 Oct 2012 09:10:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/kvm.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/193067.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/kvm.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/193067.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/193067.html</trackback:ping><description><![CDATA[<div>挂载ISO文件：<br />mkdir -p /media/rhel<br />mount -o loop rhel.iso /media/rhel<br /><br />添加文件rhel.repo到/etc/yum.repos.d/下，在rhel.repo中加入如下内容<br /><span style="background-color: #eeeeee; font-size: 13px; ">[rhel_6_iso]<br /></span><span style="font-size: 13px; background-color: #eeeeee; ">name</span><span style="font-size: 13px; background-color: #eeeeee; ">=</span><span style="font-size: 13px; background-color: #eeeeee; ">local&nbsp;iso</span><br style="font-size: 13px; " /><span style="font-size: 13px; background-color: #eeeeee; ">baseurl</span><span style="font-size: 13px; background-color: #eeeeee; ">=</span><span style="font-size: 13px; background-color: #eeeeee; ">file:</span><span style="font-size: 13px; color: #808080; ">///</span><span style="font-size: 13px; color: #008000; ">media/rhel/</span><span style="font-size: 13px; color: #808080; "><br /></span><span style="font-size: 13px; background-color: #eeeeee; ">gpgcheck</span><span style="font-size: 13px; background-color: #eeeeee; ">=</span><span style="font-size: 13px; background-color: #eeeeee; ">1</span><br style="font-size: 13px; " /><span style="font-size: 13px; background-color: #eeeeee; ">gpgkey</span><span style="font-size: 13px; background-color: #eeeeee; ">=</span><span style="font-size: 13px; background-color: #eeeeee; ">file:</span><span style="font-size: 13px; color: #808080; ">///</span><span style="font-size: 13px; color: #008000; ">media/rhel/RPM-GPG-KEY-redhat-release</span><br /><br /><br />测试安装kvm<br />yun install kvm<br /><br /><div>[root@localhost rhel]# yum install kvm</div><div>Loaded plugins: fastestmirror, product-id, subscription-manager</div><div>Updating certificate-based repositories. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>Loading mirror speeds from cached hostfile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>addons &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 1.9 kB &nbsp; &nbsp; 00:00 &nbsp; &nbsp;&nbsp;</div><div>base &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 1.1 kB &nbsp; &nbsp; 00:00 &nbsp; &nbsp;&nbsp;</div><div>extras &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 1.9 kB &nbsp; &nbsp; 00:00 &nbsp; &nbsp;&nbsp;</div><div>rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 4.0 kB &nbsp; &nbsp; 00:00 ...&nbsp;</div><div>rhel_6_iso/primary_db &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 3.1 MB &nbsp; &nbsp; 00:00 ...&nbsp;</div><div>update &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 1.9 kB &nbsp; &nbsp; 00:00 &nbsp; &nbsp;&nbsp;</div><div>Setting up Install Process &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>Resolving Dependencies &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>--&gt; Running transaction check &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>---&gt; Package qemu-kvm.x86_64 2:0.12.1.2-2.209.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>rhel_6_iso/filelists_db &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 3.6 MB &nbsp; &nbsp; 00:00 ...&nbsp;</div><div>--&gt; Processing Dependency: qemu-img = 2:0.12.1.2-2.209.el6 for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: vgabios-vmware for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: vgabios-stdvga for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: vgabios-qxl for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>--&gt; Processing Dependency: vgabios for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>--&gt; Processing Dependency: seabios for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>--&gt; Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.8.3)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.8.2)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.8.1)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.6.0)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>--&gt; Processing Dependency: /usr/share/sgabios/sgabios.bin for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64&nbsp;</div><div>--&gt; Processing Dependency: /usr/share/gpxe/virtio-net.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64&nbsp;</div><div>--&gt; Processing Dependency: /usr/share/gpxe/rtl8139.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64&nbsp;</div><div>--&gt; Processing Dependency: /usr/share/gpxe/rtl8029.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64&nbsp;</div><div>--&gt; Processing Dependency: /usr/share/gpxe/pcnet32.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64&nbsp;</div><div>--&gt; Processing Dependency: /usr/share/gpxe/e1000-0x100e.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp;&nbsp;</div><div>--&gt; Processing Dependency: libspice-server.so.1()(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp;</div><div>--&gt; Processing Dependency: libcelt051.so.0()(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp;</div><div>--&gt; Running transaction check &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>---&gt; Package celt051.x86_64 0:0.5.1.3-0.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>---&gt; Package gpxe-roms-qemu.noarch 0:0.9.7-6.9.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>---&gt; Package qemu-img.x86_64 2:0.12.1.2-2.209.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>---&gt; Package seabios.x86_64 0:0.6.1.2-8.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>---&gt; Package sgabios-bin.noarch 0:0-0.3.20110621svn.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>---&gt; Package spice-server.x86_64 0:0.8.2-5.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>---&gt; Package vgabios.noarch 0:0.6b-3.6.el6 will be installed &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>--&gt; Finished Dependency Resolution &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div></div><div>Dependencies Resolved</div><div></div><div>=========================================================================================================</div><div>&nbsp;Package &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Arch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Version &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Repository &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size&nbsp;</div><div>=========================================================================================================</div><div>Installing: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;qemu-kvm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2:0.12.1.2-2.209.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1.1 M&nbsp;</div><div>Installing for dependencies: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp;celt051 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.5.1.3-0.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;50 k&nbsp;</div><div>&nbsp;gpxe-roms-qemu &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.9.7-6.9.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 219 k&nbsp;</div><div>&nbsp;qemu-img &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2:0.12.1.2-2.209.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 329 k&nbsp;</div><div>&nbsp;seabios &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.6.1.2-8.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;83 k&nbsp;</div><div>&nbsp;sgabios-bin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0-0.3.20110621svn.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6.6 k&nbsp;</div><div>&nbsp;spice-server &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.8.2-5.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 251 k&nbsp;</div><div>&nbsp;vgabios &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.6b-3.6.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rhel_6_iso &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;42 k&nbsp;</div><div></div><div>Transaction Summary</div><div>=========================================================================================================</div><div>Install &nbsp; &nbsp; &nbsp; 8 Package(s) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div></div><div>Total download size: 2.1 M</div><div>Installed size: 6.1 M &nbsp; &nbsp;&nbsp;</div><div>Is this ok [y/N]: y &nbsp; &nbsp; &nbsp;&nbsp;</div><div>Downloading Packages: &nbsp; &nbsp;&nbsp;</div><div>---------------------------------------------------------------------------------------------------------</div><div>Total &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 26 MB/s | 2.1 MB &nbsp; &nbsp; 00:00 &nbsp; &nbsp;&nbsp;</div><div>warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>Retrieving key from file:///media/rhel/RPM-GPG-KEY-redhat-release &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Importing GPG key 0xFD431D51: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;Userid: "Red Hat, Inc. (release key 2) &lt;security@redhat.com&gt;" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp;From &nbsp;: /media/rhel/RPM-GPG-KEY-redhat-release &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Is this ok [y/N]: y &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Importing GPG key 0x2FA658E0: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;Userid: "Red Hat, Inc. (auxiliary key) &lt;security@redhat.com&gt;" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp;From &nbsp;: /media/rhel/RPM-GPG-KEY-redhat-release &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Is this ok [y/N]: y &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Running rpm_check_debug &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Running Transaction Test &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>Transaction Test Succeeded &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>Running Transaction &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>Warning: RPMDB altered outside of yum. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>PackageKit-0.5.8-19.el6.x86_64 has missing requires of PackageKit-yum = ('0', '0.5.8', '19.el6') &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>PackageKit-0.5.8-19.el6.x86_64 has missing requires of PackageKit-yum-plugin = ('0', '0.5.8', '19.el6') &nbsp;</div><div>rhn-check-1.0.0-73.el6.noarch has missing requires of yum-rhn-plugin &gt;= ('0', '0.9.1', '35') &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; Installing : celt051-0.5.1.3-0.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1/8&nbsp;</div><div>&nbsp; Installing : spice-server-0.8.2-5.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2/8&nbsp;</div><div>&nbsp; Installing : seabios-0.6.1.2-8.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3/8&nbsp;</div><div>&nbsp; Installing : sgabios-bin-0-0.3.20110621svn.el6.noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4/8&nbsp;</div><div>&nbsp; Installing : vgabios-0.6b-3.6.el6.noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5/8&nbsp;</div><div>&nbsp; Installing : 2:qemu-img-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6/8&nbsp;</div><div>&nbsp; Installing : gpxe-roms-qemu-0.9.7-6.9.el6.noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7/8&nbsp;</div><div>&nbsp; Installing : 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8/8&nbsp;</div><div>rhel_6_iso/productid &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 1.7 kB &nbsp; &nbsp; 00:00 ...&nbsp;</div><div>Installed products updated. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; Verifying &nbsp;: gpxe-roms-qemu-0.9.7-6.9.el6.noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: spice-server-0.8.2-5.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: 2:qemu-img-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: vgabios-0.6b-3.6.el6.noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: sgabios-bin-0-0.3.20110621svn.el6.noarch &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: seabios-0.6.1.2-8.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7/8&nbsp;</div><div>&nbsp; Verifying &nbsp;: celt051-0.5.1.3-0.el6.x86_64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8/8&nbsp;</div><div></div><div>Installed:</div><div>&nbsp; qemu-kvm.x86_64 2:0.12.1.2-2.209.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div></div><div>Dependency Installed:</div><div>&nbsp; celt051.x86_64 0:0.5.1.3-0.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gpxe-roms-qemu.noarch 0:0.9.7-6.9.el6</div><div>&nbsp; qemu-img.x86_64 2:0.12.1.2-2.209.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;seabios.x86_64 0:0.6.1.2-8.el6</div><div>&nbsp; sgabios-bin.noarch 0:0-0.3.20110621svn.el6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spice-server.x86_64 0:0.8.2-5.el6</div><div>&nbsp; vgabios.noarch 0:0.6b-3.6.el6</div><div></div><div>Complete!</div><div></div><br /><span style="background-color: #eeeeee; font-size: 13px; "><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></span></div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/193067.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2012-10-09 17:10 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/kvm.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>XAMPP: Couldn't start MySQL! _______localhost not found_________bugfree 403您没有被分配权限_________cbDException</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/bugfree.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Fri, 21 Sep 2012 07:53:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/bugfree.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/191486.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/bugfree.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/191486.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/191486.html</trackback:ping><description><![CDATA[写了一个脚本彻底解决bugfree的一堆问题：(对应的bugfree3.0.3与xampp文件可以直接在网站上下载)<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->rm&nbsp;<span style="color: #808080; ">-</span>rf&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span><br /><br />tar&nbsp;xvf&nbsp;xampp<span style="color: #808080; ">-</span>linux<span style="color: #808080; ">-</span><span style="color: #800000; font-weight: bold; ">1.8</span>.<span style="color: #800000; font-weight: bold; ">1</span>.tar.gz&nbsp;<span style="color: #808080; ">-</span>C&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span><br />cp&nbsp;bugfree3.<span style="color: #800000; font-weight: bold; ">0.3</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>htdocs<span style="color: #808080; ">/</span>&nbsp;<span style="color: #808080; ">-</span>dpr&nbsp;<span style="color: #808080; ">&amp;&amp;</span>&nbsp;sync<br /><br />mkdir&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>htdocs<span style="color: #808080; ">/</span>BugFile&nbsp;<span style="color: #808080; ">-</span>p<br />chmod&nbsp;<span style="color: #800000; font-weight: bold; ">777</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>htdocs<span style="color: #808080; ">/</span>BugFile<br />chmod&nbsp;<span style="color: #800000; font-weight: bold; ">777</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>htdocs<span style="color: #808080; ">/</span>bugfree3.<span style="color: #800000; font-weight: bold; ">0.3</span><span style="color: #808080; ">/</span>&nbsp;<span style="color: #808080; ">-</span>R<br /><br /><br />perl&nbsp;<span style="color: #808080; ">-</span><span style="color: #FF00FF; ">pi</span>&nbsp;<span style="color: #808080; ">-</span>e&nbsp;<span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">s|Listen\&nbsp;80|Listen\&nbsp;10000|g</span><span style="color: #FF0000; ">'</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>etc<span style="color: #808080; ">/</span>httpd.conf<br />perl&nbsp;<span style="color: #808080; ">-</span><span style="color: #FF00FF; ">pi</span>&nbsp;<span style="color: #808080; ">-</span>e&nbsp;<span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">s|upload_max_filesize\&nbsp;=\&nbsp;2M|upload_max_filesize\&nbsp;=\&nbsp;50M|g</span><span style="color: #FF0000; ">'</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>etc<span style="color: #808080; ">/</span>php.ini<br />perl&nbsp;<span style="color: #808080; ">-</span><span style="color: #FF00FF; ">pi</span>&nbsp;<span style="color: #808080; ">-</span>e&nbsp;<span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">s|nobody|root|g</span><span style="color: #FF0000; ">'</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>etc<span style="color: #808080; ">/</span>my.cnf<br />perl&nbsp;<span style="color: #808080; ">-</span><span style="color: #FF00FF; ">pi</span>&nbsp;<span style="color: #808080; ">-</span>e&nbsp;<span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">s|phpmyadmin\"\&gt;|phpmyadmin\"\&gt;\n\&nbsp;\&nbsp;\&nbsp;\&nbsp;Require\&nbsp;all\&nbsp;granted|g</span><span style="color: #FF0000; ">'</span>&nbsp;<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>etc<span style="color: #808080; ">/</span>extra<span style="color: #808080; ">/</span>httpd<span style="color: #808080; ">-</span>xampp.conf<br /><br /><br />#把空的用户密码都修改成非空的密码<br />echo&nbsp;"请登录<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>bin<span style="color: #808080; ">/</span>mysql&nbsp;<span style="color: #808080; ">-</span>u&nbsp;root&nbsp;mysql&nbsp;执行如下2个语句,并重启lamp<br /><span style="color: #0000FF; ">UPDATE</span>&nbsp;<span style="color: #FF00FF; ">user</span>&nbsp;<span style="color: #0000FF; ">SET</span>&nbsp;Password<span style="color: #808080; ">=</span>PASSWORD(<span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">123456</span><span style="color: #FF0000; ">'</span>)&nbsp;<span style="color: #0000FF; ">where</span>&nbsp;<span style="color: #FF00FF; ">USER</span><span style="color: #808080; ">=</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">root</span><span style="color: #FF0000; ">'</span>&nbsp;<span style="color: #808080; ">and</span>&nbsp;host<span style="color: #808080; ">=</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">root</span><span style="color: #FF0000; ">'</span>&nbsp;<span style="color: #808080; ">or</span>&nbsp;host<span style="color: #808080; ">=</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">localhost</span><span style="color: #FF0000; ">'</span>;<br />FLUSH&nbsp;<span style="color: #0000FF; ">PRIVILEGES</span>;<br />特别注意，123456密码只是一个实例"<br /><br />#<span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>bin<span style="color: #808080; ">/</span>mysql&nbsp;<span style="color: #808080; ">-</span>u&nbsp;root&nbsp;mysql&nbsp;<span style="color: #808080; ">-</span>p<br />killall&nbsp;httpd&nbsp;<span style="color: #808080; ">&amp;&amp;</span>&nbsp;killall&nbsp;mysqld&nbsp;<span style="color: #808080; ">&amp;&amp;</span>&nbsp;killall&nbsp;proftpd<br /><span style="color: #808080; ">/</span>opt<span style="color: #808080; ">/</span>lampp<span style="color: #808080; ">/</span>lampp&nbsp;start</div><br />bugfree的错误及解决方法，这软件不好用。。。。。<br />1 XAMPP: Couldn't start MySQL!&nbsp;&nbsp;&nbsp; <br />查看错误日志文件/opt/lamp/var/mysql/localhost.localdomain.err<br />知道/tmp目录下某个文件不能写（不知道谁把/tmp目录的权限改成755了，所以普通用户没法写。原来没有普通用户的情况下，系统只有root用户，所以没有发现这个问题），两步：<br />a,使用root用户改/tmp权限：chmod 777 /tmp<br />b,删除/tmp下面部分不需要的文件，腾出空间：rm -rf /tmp/$(unusefull)<br /><br />2 <div>403您没有被分配权限后台管理无法开启，这个应该是mysql没有启动足够的权限导致的，<br />修改/opt/lampp/conf/my.conf中的user=nobody为root</div><br />3安装时候无法找到localhost<br />我的错误原因是mysql后台进程没有开启，请进一步确认mysqld的问题。<br /><br />4 cbDException<br />数据库无权限，修改/opt/lampp/conf/my.conf，找到user=nobody,修改成user=root<br /><br />这软件布局不合理。。。。。。。<img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/191486.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2012-09-21 15:53 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/bugfree.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux软件安装与卸载管理</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/168585.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Thu, 22 Mar 2012 03:15:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/168585.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/168585.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/168585.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/168585.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/168585.html</trackback:ping><description><![CDATA[@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<div>1、通过deb包安装的情况：<br />
安装.deb包：<br />
<div><strong>代码:</strong></div>
<div>sudo dpkg -i package_file.deb</div>
<br />
反安装.deb包：<br />
<div><strong>代码:</strong></div>
<div>sudo dpkg -r package_name</div>
<br />
<br />
2、通过apt-get安装的情况：<br />
安装<br />
<div><strong>代码:</strong></div>
<div>sudo apt-get install package_name</div>
<br />
反安装<br />
<div><strong>代码:</strong></div>
<div>sudo apt-get remove package_name</div>
</div>
<div><br />
</div>
<div>
<h1 class="block_title" style="margin: 10px 0px 0px; font-size: 12pt; color: gray; font-family: verdana, arial, sans-serif; height: 59px; padding: 20px 0px 3px 20px; text-transform: uppercase; line-height: 18px; text-align: justify;"><a id="viewpost1_TitleUrl" href="http://www.cppblog.com/TianShiDeBaiGu/articles/168415.html" style="color: #ff6600; text-decoration: none;">修复崩溃的GNOME-PANNEL</a></h1>
<div class="post" style="padding-left: 20px; font-size: 13px; color: #5e5e5e; font-family: Verdana, Helvetica, Arial; line-height: 18px; text-align: justify;">
<div class="postcontent">
<div><span style="font-size: 11px;">$sudo apt-get autoremove</span></div>
<div><span style="font-size: 11px;">$sudo apt-get install gnome-panel</span></div>
<div><span style="font-size: 11px;">(做完这个提示E: Sub-process /usr/bin/dpkg returned an error code,提示kio-umountwrapper文件错误)</span></div>
<div><span style="font-size: 11px;">$sudo apt-get install kio-umountwrapper</span></div>
<div><span style="font-size: 11px;">$sudo apt-get install gnome-panel</span></div>
<div><span style="font-size: 11px;">$gnome-panel</span></div>
<div><span style="font-size: 11px;"><br />
</span></div>
<div><span style="font-size: 11px;">为了确保重启后能正常。system--preferences--Sessions--Current session 看看gnome-panel 一项的style是不是restart。不是的话就是设为restart。ok，重启检验一下</span></div>
</div>
</div>
</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/168585.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2012-03-22 11:15 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/168585.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>老是忘记的一些技术点</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/linux_note.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 04 Jan 2012 08:54:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/linux_note.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/163557.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/linux_note.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/163557.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/163557.html</trackback:ping><description><![CDATA[<div><div><span style="color: red; ">.bashrc的一个环境变量</span> PS1='[\[\033[01;32m\]\h:\[\033[01;34m\]\w\[\033[00m\]]\n\$ '</div><span style="color: #ff0000;">查</span><span style="color: #ff0000;">看文件大小 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>du -h<span style="color: #ff0000;">&nbsp;</span><br /><span style="color: red;">查看文件在文件系统中的信息&nbsp;</span>df&nbsp;<br /><span style="color: red;">查看动态库的内部符号 &nbsp; &nbsp; &nbsp;</span>nm -D&nbsp;<br /><span style="color: red;">查看进程号 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>ps -aux<br /><span style="color: red;">查看进程树 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>pstree&nbsp;<br /><div>grep -rl DEBUG | xargs perl -pi -e "s|内容|\/\/内容|g" &nbsp;<span style="color: red;"> 注释当前有DEBUG字段的文件内的所有含有&#8220;内容&#8221;的部分</span><br /><br /><span style="color: red;">fuck_the_GFW.sh</span><br /><div>#!/usr/bin/expect -f<br />set timeout 30<br />spawn ssh -D 7070 -l colleague 204.12.234.13<br />expect "password: "<br />send "vlctech\r"<br />interact<br /><br /><span style="color: red;">cscope生成索引文件</span><br /><span class="Apple-style-span" style="font-family: Arial; line-height: 26px; background-color: #e6e6e6; ">&nbsp;<span style="color: #0000ff;">find</span>&nbsp;&nbsp;.&nbsp;-name&nbsp;"*.h"&nbsp;-o&nbsp;-name&nbsp;"*.c"&nbsp;-o&nbsp;-name&nbsp;"*.cc"&nbsp;&gt;&nbsp;cscope.files<br /></span><span class="Apple-style-span" style="font-family: Arial; line-height: 26px; background-color: #e6e6e6;"><span style="color: #0000ff;">cscope</span>&nbsp;&nbsp;-Rbkq&nbsp;-i&nbsp;cscope.files<br /><br /></span><span class="Apple-style-span" style="font-family: Arial; line-height: 26px; background-color: #e6e6e6; color: red;">禅道因为某些进程占用服务而无法使用的问题</span><span class="Apple-style-span" style="font-family: Arial; line-height: 26px; background-color: #e6e6e6;"><br /></span><div>用netstat -lntp | grep :80 找出占用80端口的进程</div><div>&nbsp; &nbsp; 例如：</div><div>&nbsp; &nbsp; [root@localhost ~]# netstat -lntp | grep :80</div><div>&nbsp; &nbsp; tcp &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;0 0.0.0.0:80 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0:* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LISTEN &nbsp; &nbsp; &nbsp;3040/nginx</div><div>&nbsp; &nbsp; 这里的程序名就是nginx</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; 尝试用killall [程序名]，看能不能关闭他。</div><div>&nbsp; &nbsp; 例如：killall nginx</div><div>&nbsp; &nbsp; 如果不行，用ps 找出他的PID，</div><div>&nbsp; &nbsp; 例如：</div><div>&nbsp; &nbsp; [root@localhost ~]# ps aux | grep nginx | grep -v grep</div><div>&nbsp; &nbsp; root &nbsp; &nbsp; &nbsp;5406 &nbsp;0.0 &nbsp;0.2 &nbsp; 5996 &nbsp; 756 ? &nbsp; &nbsp; &nbsp; &nbsp;Ss &nbsp; 03:32 &nbsp; 0:00 nginx: master process /usr/local/webserver/nginx/sbin/nginx</div><div>&nbsp; &nbsp; 这里的pid是 5406</div><div>&nbsp; &nbsp; 然后用kill命令关掉它。</div><div>&nbsp; &nbsp; 例如：kill 5406</div><div>&nbsp; &nbsp; PS:如果是通过apt-get安装的apache，可以尝试通过/etc/init.d/[程序名] stop 停止进程，或者</div><div>&nbsp; &nbsp; 通过chkconfig [程序名] off 关闭开机启动。<br /><br /><div>redhat系统导入KEY<br />http://www.liusuping.com/ubuntu-linux/Redhat-linux-centos-yum.html</div></div><div></div></div></div></div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/163557.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2012-01-04 16:54 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/linux_note.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>fedora 源设置</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/149495.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Sun, 26 Jun 2011 07:15:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/149495.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/149495.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/149495.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/149495.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/149495.html</trackback:ping><description><![CDATA[更换源前做好备份，主要是源文件，以及RPM公匙文件<br />/ect/yum.conf yum配置文件<br />/etc/yum.repos.d/ repo文件,源站点<br />/etc/pki/rpm-gpg/ RPM公匙文件

<p>然后登录网站http://mirrors.163.com 或者 http://mirrors.sohu.com，</p><p>查看feoora那行的帮助，里面有说明操作。</p><p>然后</p><p>删除缓存 从新更新<br />yum clean all <br />yum makecache</p><p>还可以自动添加高速源<br />安装yum-plugin-fastestmirror(自动挑选快的镜像站) <br />yum install yum-fastestmirror <br />注:确定/etc/yum.conf中的plugins=1</p><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/149495.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2011-06-26 15:15 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/149495.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>g++编译器错误unknown pseudo-op: `.weakref' （已解决）</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/gcc_compile_error.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Sun, 10 Apr 2011 05:50:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/gcc_compile_error.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/143869.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/gcc_compile_error.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/143869.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/143869.html</trackback:ping><description><![CDATA[看了半天的英文解决方案，没有对应的办法，这个错误的原因是编译器套件的版本不兼容。<br />
通常在编译了一些版本不匹配的编译器之后，会有一系列的类似错误<br />
如果你实在没有别的办法了，删除<font color="#008000">/usr/local/bin/</font>文件下的内容，该目录下的文件是本地编译产生的，执行程序时控制台会先去这个目录找程序，如果有，他就使用下面的程序，所以如果你的本地编译程序出错了，删除这个目录，为保险起见，建议先备份，再删除。<br />
另外提一个建议----------尽量使用系统提供的在线安装软件来安装你需要的软件，深入理解你的系统工作的过程，这会避免我们走很多弯路。<br /><br /><br />

如果还有疑问，请提出来<br />
Wellcom and have fun !<br /><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/143869.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2011-04-10 13:50 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/gcc_compile_error.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>GCC强大背后</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_1_cpp.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Sat, 27 Nov 2010 09:48:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_1_cpp.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/134840.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_1_cpp.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/134840.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/134840.html</trackback:ping><description><![CDATA[<div id="content">
				<script language="javascript" type="text/javascript"><![CDATA[
                        var m = window.__blog.preRenderPosts;
                        if (m) { m(); } 
            ]]&gt;</script>
				<div id="post" class="post">
						<a name="top">
						</a>
						<h2>
								<a id="ctl06_lnkTitle" href="http://www.cnblogs.com/wwang/archive/2010/11/24/1883850.html">
										<font color="#6699cc">GCC强大背后</font>
								</a>
						</h2>
						<p>来自：<a href="http://www.cnblogs.com/wwang/archive/2010/11/24/1883850.html">http://www.cnblogs.com/wwang/archive/2010/11/24/1883850.html</a><br /></p><p>&nbsp;
								</p>
						<div class="entry"><p>
										<a href="http://gcc.gnu.org/">
												<font color="#3d81ee">GCC</font>
										</a>，全称GNU Compiler Collection，是一套GNU开发的编译器环境，它的创始人便是大名鼎鼎的<a href="http://stallman.org/" target="_blank"><font color="#3d81ee">Richard.M.Stallman</font></a>。最初GCC刚开始开发时，它还叫做GNU C Compiler，随着开发的深入，GCC很快得到了扩展，不仅可以支持C语言，还可以处理C++，Pascal，Object-C，Java以及Ada等其他语言。目前，GCC不仅是GNU的官方编译器，也成为编译和创建其他操作系统的编译器，包括BSD家族以及MAC OS X等。另外，GCC也是跨平台交叉编译的首选，它不仅支持Intel的x86系列，同时也支持MIPS，ARM，PowerPC，SPARC等等处理器。可以这么说，即使GCC不是世界上效率最高的编译器，它也一定是世界上最全面的编译器。</p>
								<p>
										<img alt="" src="http://pic002.cnblogs.com/images/2010/175492/2010112321205617.jpg" />
								</p>
								<p>&nbsp;</p>
								<h1>1. GCC简介</h1>
								<div>我们先回到一个常识性的问题，什么是编译器呢？简单地说，编译器可以看作是一个语言翻译器。就像把中文翻译成英语一样，编译器可以把高级语言翻译成计算机能够执行的机器语言。这样看来，GCC可以算得上是一个精通多国语言的高级翻译官了。</div>
								<div>最简单的GCC使用指令如下所示：</div>
								<blockquote>
										<div>gcc &nbsp;hello.c &nbsp;-o &nbsp;hello</div>
								</blockquote>
								<div>&nbsp;</div>
								<div>GCC接受hello.c作为输入，最后产生目标可执行代码hello。这个简单的流程实际上经历了很多步骤，如下图所示：</div>
								<div>
										<img alt="" src="http://pic002.cnblogs.com/images/2010/175492/2010112421321949.jpg" />
								</div>
								<div>虽然我们只用了一条命令就完成了编译，但实际上gcc命令依次呼叫了cpp，gcc自己，gas以及ld来进行完整的编译流程，最后生成最终的可执行文件hello。</div>
								<div>下面我们看一下分解动作：</div>
								<blockquote>
										<div>cpp &nbsp;hello.c &nbsp;&gt; &nbsp;hello.i</div>
								</blockquote>
								<blockquote>
										<div>gcc &nbsp;-S &nbsp;hello.i</div>
								</blockquote>
								<blockquote>
										<div>as &nbsp;hello.s &nbsp;-o &nbsp;hello.o</div>
								</blockquote>
								<blockquote>
										<div>ld &nbsp;-dynamic-linker &nbsp;/lib/ld-linux.so.2 &nbsp;/usr/lib/crt1.o &nbsp;/usr/lib/crti.o &nbsp;/usr/lib/gcc/i686-linux-gnu/4.4.5/crtbegin.o -L/usr/lib/gcc/i686-linux-gnu/4.4.5 hello.o &nbsp;-lgcc &nbsp;-lgcc_eh &nbsp;-lc &nbsp;/usr/lib/gcc/i686-linux-gnu/4.4.5/crtend.o &nbsp;/usr/lib/crtn.o &nbsp;-o &nbsp;hello</div>
								</blockquote>
								<div>&nbsp;</div>
								<div>看完这些步骤有没有晕头转向的感觉呢？对于普通的用户来说，还是让GCC帮我们做这些事情比较好。</div>
								<div>对于如何学习使用GCC，可以参考GCC官方的手册，如果大家觉得官方的手册太罗嗦，我这里推荐一本GCC的入门书籍《<a href="http://www.network-theory.co.uk/gcc/intro/" target="_blank"><font color="#3d81ee">An Introduction to GCC</font></a>》，这本书详尽的介绍了GCC的使用方法，内容浅显易懂，很适合初学者。</div>
								<div>&nbsp;</div>
								<h1>2. GCC强大的背后</h1>
								<p>学过编译原理这门课程的同学对下面这副图应该很熟悉，这是经典的编译流程。</p>
								<p>
										<img alt="" src="http://pic002.cnblogs.com/images/2010/175492/2010112321385743.jpg" />
								</p>
								<p>GCC作为经典的编译器，自然也是遵循这个教科书流程（实际GCC的处理更复杂点，但本质上是一样的）。我们先简化一下上面这幅图，以中间代码为分界，前面的词法分析、语法分析、语义分析我们把它称之为前端处理，后面的优化和目标代码生成我们称之为后端处理。</p>
								<p>试想一下，是否可以为不同的高级语言单独写一个前端，然后为不同的处理器架构单独写一个后端呢？</p>
								<p>
										<img alt="" src="http://pic002.cnblogs.com/images/2010/175492/2010112421324033.jpg" />
								</p>
								<p>GCC基本上也是这么实现的，不过不要误会，并没有一个统一的gcc执行程序能够处理如此多的前端和后端，每个语言的编译器都是一个独立的程序（如C语言的编译器是gcc，C++的编译器是g++），而不同的后端也要对应不同的可执行程序。你可以下载单独的一份GCC源代码，通过不同的configure来编译自己需要的编译器。</p>
								<p>而且，编译器的实现也比上图要复杂的多，前端的主要功能是产生一个可供后端处理的语法树，而语法树结构实际上很难与处理器架构脱钩，这些都是编译器应用中需要解决的问题。</p>
								<p>GCC强大的真正原因是什么？是因为它支持了众多的前端和后端吗？这些都不过是一个表象而已。GCC是一款真正自由的编译器，我们可以随时把代码拿过来修改以实现自己需要的功能。如果你的硬件平台增加了一些指令，而普通的编译器并不能产生这些指令怎么办？在GCC后端添加这些指令吧。如果你觉得C语言用的不太顺手，想给它添加一些功能怎么办？修改GCC的前端吧。因为有了GCC，我们才拥有这些自由，以及迅速实现自己想法的能力，而这些才是GCC强大背后的基础。</p>
								<p>2010年1月份的时候，Google的Go语言前端被允许进入GCC编译器家族，GCC更加强大了。</p>
								<p>&nbsp;</p>
								<h1>3. GCC的多样性</h1>
								<div>GCC因为其灵活性被应用到了很多领域和系统，从PC上的开发到嵌入式开发，都可以见到GCC的影子。</div>
								<div>&nbsp;</div>
								<h2>3.1 &nbsp; PC开发</h2>
								<div>我们先看看PC。MAC自从投入Intel的怀抱，是否也可以看作是一种PC呢？</div>
								<h3>Linux</h3>
								<div>Linux系统应该是GCC的主战场，但也是最没必要去说的一个系统，除了GCC，难道我们还有更好的选择吗？Linux内核、Apache服务器、MySQL数据库，等等一系列伟大的作品都是通过GCC来构建的，GCC可以说是GNU/Linux系统的基石。</div>
								<h3>MAC OS X</h3>
								<div>MAC OS X也是GCC的重度用户，其应用程序开发环境Cocoa就是使用的GCC，所以在MAC OS X下开发也是离不开GCC的。</div>
								<h3>Windows</h3>
								<div>现在在Windows下开发C/C++程序一般都是用微软的编译器，当年的Borland已经成为传说。但是如果你不想付钱的话，也可以考虑Windows下的GCC。</div>
								<div>在Windows下体验GCC最常用的有两种方式：一是在Cygwin下使用GCC，另外一种是使用MinGW。</div>
								<div>
										<a href="http://www.cygwin.com/" target="_blank">
												<font color="#3d81ee">Cygwin</font>
										</a>是一个自由软件的集合，最初由Cygnus Solutions开发，目的是在Windows系统上运行类Unix的软件。通过Cygwin编译的程序可以在Windows上运行，但必须使用cygwin.dll。</div>
								<div>
										<a href="http://www.mingw.org/" target="_blank">
												<font color="#3d81ee">MinGW</font>
										</a>(Minimalist GNU for Windows)，是将GNU开发工具移植到Windows平台的产物，包括一系列头文件、库和可执行文件，用MinGW开发的程序不需要额外的第三方DLL就可以直接在Windows上运行。Nokia的图形开发包QT在Windows下就是调用MinGW来编译的。</div>
								<h3>DOS</h3>
								<div>在DOS系统下也是可以用GCC的，国内的DOS开发者可能更熟悉Turbo C或者Open Watcom，GCC的DOS版本<a href="http://www.delorie.com/djgpp/" target="_blank"><font color="#3d81ee">DJGPP</font></a>其实也是32位DOS程序开发的主流环境之一。最初DJGPP的发起人DJ Delorie曾经询问过Richard Stallman，FSF是否考虑过把GCC移植到MS-DOS下，当时Richard的回答是GCC太庞大，而MS-DOS只不过是个16位的操作系统，所以官方并没有考虑这件事。DJ Delorie并没有因此而退缩，最终给我们带来了这个优秀的开发平台。DJGPP刚开始开发时叫做djgcc，在引入了C++之后改为现在这个名字（DJ's GNU Programming Platform）。</div>
								<div>&nbsp;</div>
								<h2>3.2 &nbsp; 嵌入式开发</h2>
								<div>对于嵌入式开发领域来说，因为开发板的能力限制，是无法运行编译环境的，这样就需要在PC上通过交叉编译来生成目标可执行程序，GCC的高度灵活性在嵌入式开发上发挥了极大的作用。</div>
								<h3>Android</h3>
								<div>看看当今最火的移动平台Android，就是完全用GCC来构建的，请注意，这里指的不是Android应用程序，Android下的应用程序是运行在Dalvik虚拟机上的Java程序。</div>
								<h3>iOS</h3>
								<div>Apple的iOS应用程序开发也是用Cocoa来进行，这怎么会离开GCC呢？</div>
								<h3>MeeGo/Symbian</h3>
								<div>在Apple和Google的冲击下，Nokia似乎已经日薄西山了，但对于中国国情来说，真的是这样吗？iPhone高高在上，拥有者只会是少数，Google退出中国之后，Android Market很难在国内有所作为，再加上Nokia手机一贯皮实的口碑，现在的Symbian以及将来的MeeGo的保有量应该不会低。Nokia已经把Symbian和MeeGo的开发环境统一到QT上了，这里依然是GCC的一亩三分田。</div>
								<div>&nbsp;</div>
								<div>&nbsp;</div>
								<div>GCC是强大的，但它并不是一个人在战斗，在它的背后站着<a href="http://en.wikipedia.org/wiki/GNU_toolchain" target="_blank"><font color="#3d81ee">GNU工具链</font></a>，包括make，GCC，Binutils，GDB等一系列工具，这些工具之间是相辅相成的，只有把它们组合起来使用才能发挥其最大的威力。</div>
						</div>
				</div>
		</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/134840.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2010-11-27 17:48 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_1_cpp.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C++强大的背后</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_cpp.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Sat, 27 Nov 2010 09:46:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_cpp.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/134839.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_cpp.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/134839.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/134839.html</trackback:ping><description><![CDATA[
		<a name="top">
		</a> 
<h2><a id="ctl06_lnkTitle" href="http://www.cnblogs.com/miloyip/archive/2010/09/17/behind_cplusplus.html"><font color="#6699cc">C++强大背后</font></a></h2><small>2010-09-17 00:56 by Milo Yip, 16411 visits, <a onclick="PutInWz();return false;" href="#">网摘</a>, <a href="http://www.cnblogs.com/miloyip/AddToFavorite.aspx?id=1828449">收藏</a>, <a id="ctl06_lnkEdit" href="http://www.cnblogs.com/miloyip/admin/EditPosts.aspx?postid=1828449">编辑</a></small><div class="entry"><p>在31年前(1979年)，一名刚获得博士学位的研究员，为了开发一个软件项目发明了一门新编程语言，该研究员名为<a href="http://www2.research.att.com/%7Ebs/"><font color="#3d81ee">Bjarne Stroustrup</font></a>，该门语言则命名为——C with classes，四年后改称为C++。C++是一门通用编程语言，支持多种编程范式，包括过程式、面向对象(object-oriented programming, OP)、泛型(generic programming, GP)，后来为泛型而设计的模版，被<a href="http://www.erwin-unruh.de/meta.html"><font color="#3d81ee">发现</font></a>及<a href="http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=AA022F3026015EF910CAEF5156901019?doi=10.1.1.14.3670&amp;rep=rep1&amp;type=pdf"><font color="#3d81ee">证明是图灵完备的</font></a>，因此使C++亦可支持<a href="http://en.wikipedia.org/wiki/Template_metaprogramming"><font color="#3d81ee">模版元编程范式(template metaprogramming, TMP)</font></a>。C++继承了C的特色，既为高级语言，又含低级语言功能，可同时作为系统和应用编程语言。</p><p>C++广泛应用在不同领域，使用者<a href="http://www2.research.att.com/%7Ebs/bs_faq.html#number-of-C++-users"><font color="#3d81ee">以数百万计</font></a>。根据<a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html"><font color="#3d81ee">近十年的调查</font></a>，C++的流行程度约稳定排行第3位(于C/Java之后)。 C++经历长期的实践和演化，才成为今日的样貌。1998年，C++标准委员会排除万难，使C++成为ISO标准(俗称C++98)，当中含非常强大的<a href="http://www.sgi.com/tech/stl/"><font color="#3d81ee">标准模版库(standard template library, STL)</font></a>。之后委员会在2005年提交了有关标准库的<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf"><font color="#3d81ee">第一个技术报告(简称TR1)</font></a>，并为下一个标准<a href="http://en.wikipedia.org/wiki/C%2B%2B0x"><font color="#3d81ee">C++0x</font></a>而努力。可惜C++0x并不能在200x年完成，各界希望新标准能于2011年内出台。</p><p>流行的C++编译器中，微软Visual C++ 2010已实现<a href="http://msdn.microsoft.com/en-us/library/dd465215.aspx"><font color="#3d81ee">部分C++0x语法并加入TR1扩充库</font></a>，而gcc对<a href="http://gcc.gnu.org/projects/cxx0x.html"><font color="#3d81ee">C++0x语法和库的支持</font></a>比VC2010更多。</p><h2>应否选择C++</h2><h3>哪些程序适宜使用C++?</h3><p>C++并非万能丹，我按经验举出一些C++的适用时机。</p><ul><li>C++适合构造程序中需求较稳定的部分，需求变化较大的部分可使用脚本语言；</li><li>程序须尽量发挥硬件的最高性能，且性能瓶颈在于CPU和内存；</li><li>程序须频繁地与操作系统或硬件沟通；</li><li>程序必须使用C++框架/库，如大部分游戏引擎(如Unreal/Source)及中间件(如Havok/FMOD)，虽然有些C++库提供其他语言的绑定，但通常原生的API性能最好、最新；</li><li>项目中某个目标平台只提供C++编译器的支持。</li></ul><p>按应用领域来说，C++适用于开发服务器软件、桌面应用、游戏、实时系统、高性能计算、嵌入式系统等。</p><h3>使用C++还是C? </h3><p>C++和C的设计哲学并不一样，两者取舍不同，所以不同的程序员和软件项目会有不同选择，难以一概而论。与C++相比，C具备编译速度快、容易学习、显式描述程序细节、较少更新标准(后两者也可同时视为缺点)等优点。在语言层面上，C++包含绝大部分C语言的功能(例外之一，C++没有C99的<a href="http://en.wikipedia.org/wiki/Variable-length_array"><font color="#3d81ee">变长数组VLA</font></a>)，且提供OOP和GP的特性。但其实用C也可实现OOP思想，亦可利用宏去实现某程度的GP，只不过C++的语法能较简洁、自动地实现OOP/GP。C++的<a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization"><font color="#3d81ee">RAII</font></a>(resource acquisition is initialization，资源获取就是初始化)特性比较独特，C/C#/Java没有相应功能。回顾历史，Stroustrup开发的早期C++编译器Cpre/<a href="http://en.wikipedia.org/wiki/Cfront"><font color="#3d81ee">Cfront</font></a>是把C++源代码翻译为C，再用C编译器编译的。由此可知，C++编写的程序，都能用等效的C程序代替，但C++在语言层面上提供了OOP/GP语法、更严格的类型检查系统、大量额外的语言特性(如异常、<a href="http://en.wikipedia.org/wiki/RTTI"><font color="#3d81ee">RTTI</font></a>等)，并且C++标准库也较丰富。有时候C++的语法可使程序更简洁，如运算符重载、隐式转换。但另一方面，C语言的API通常比C++简洁，能较容易供其他语言程序调用。因此，一些C++库会提供C的API封装，同时也可供C程序调用。相反，有时候也会把C的API封装成C++形式，以支持RAII和其他C++库整合等。 </p><h3>为何C++性能可优于其他语言?</h3><p>相对运行于虚拟机语言(如C#/Java)，C/C++直接以静态形式把源程序编译为目标平台的机器码。一般而言，C/C++程序在编译及链接时可进行的优化最丰富，启动时的速度最快，运行时的额外内存开销最少。而C/C++相对动态语言(如Python/Lua)也减少了运行时的动态类型检测。此外，C/C++的运行行为是确定的，且不会有额外行为(例如C#/Java必然会初始化变量)，也不会有如垃圾收集(GC)而造成的不确定性延迟，而且C/C++的数据结构在内存中的布局也是确定的。有时C++的一些功能会使程序性能优于C，当中以内联和模版最为突出，这两项功能使C++标准库的sort()通常比C标准库的qsort()<a href="http://en.wikipedia.org/wiki/Sort_%28C%2B%2B%29#Comparison_to_qsort.28.29"><font color="#3d81ee">快多倍</font></a>(C可用宏或人手编码去解决此问题)。另一方面，C/C++能直接映射机器码，之间没有另一层中间语言，因此可以做底层优化，例如使用<a href="http://en.wikipedia.org/wiki/Intrinsic_function"><font color="#3d81ee">内部(intrinsic)函数</font></a>和嵌入汇编语言。然而，许多C++的性能优点并非免费午餐，代价包括较长的编译链接时间和较易出错，因而增加开发时间和成本，这点稍后补充。</p><p>我进行了一个简单全局渲染性能测试(512x512像素，每像素10000个采样)，C++ 1小时36分、Java 3小时18分、Python约18天、Ruby约351天。评测方式和其他语言的结果详见<a href="http://www.cnblogs.com/miloyip/archive/2010/07/07/languages_brawl_GI.html"><font color="#3d81ee">博文</font></a>。</p><h2>C++常见问题</h2><h3>C++源代码跨平台吗?</h3><p>C++有不错的跨平台能力，但由于直接映射硬件，因性能优化的关系，跨平台能力不及Java及多数脚本语言。然而，实践跨平台的C++软件还是可行的，但须注意以下问题：</p><ul><li>C++标准没有规定原始数据类型(如int)的大小，需要特定大小的类型时，可自订类型(如int32_t)，同时对任何类型使用sizeof()而不假设其大小；</li><li>字节序(byte order)按CPU有所不同，特别要注意二进制输入输出、reinterpret_cast法；</li><li>原始数据和结构类型的地址对齐有差异；</li><li>编译器提供的一些编译器或平台专用扩充指令；</li><li>避免作<a href="http://en.wikipedia.org/wiki/Application_binary_interface"><font color="#3d81ee">应用二进制接口(application binary interface, ABI)</font></a>的假设，例如调用函数时参数的取值顺序在C/C++中没定义，在C++中也不可随便假设RTTI/虚表等实现方式。</li></ul><p>总括而言，跨平台C++软件可在头文件中用宏检测编译器和平台，再用宏、typedef、自定平台相关实现等方法去实践跨平台，C++标准不会提供这类帮助。</p><h3>C++程序容易崩溃?</h3><p>和许多语言相比，C/C++提供不安全的功能以最优化性能，有可能造成崩溃。但要注意，很多运行时错误，如向空指针/引用解引用、数组越界、堆栈溢出等，其他语言也会报错或抛出异常，这些都是程序问题，而不是语言本身的问题。有些意见认为，出现这类运行时错误，应该尽量写入日志并立即崩溃，不该让程序继续运行，以免造成更大的影响(例如程序继续把内存中错误的数据覆写文件)。若要容错，可按业务把程序分割为多进程，像<a href="http://dev.chromium.org/developers/design-documents/multi-process-architecture"><font color="#3d81ee">Chrome</font></a>或使用fork()的形式。然而，C++有许多机制可以减少错误，例如以<a href="http://en.wikipedia.org/wiki/String_%28C%2B%2B%29"><font color="#3d81ee">string</font></a>代替C字符串；以<a href="http://en.wikipedia.org/wiki/Vector_%28C%2B%2B%29"><font color="#3d81ee">vector</font></a>或<a href="http://en.wikipedia.org/wiki/Array_%28C%2B%2B%29"><font color="#3d81ee">array(TR1)</font></a>代替原始数组(有些实现可在调试模式检测越界)；使用智能指针也能减少一些原始指针的问题。另外，我最常遇到的Bug，就是没有初始化成员变量，有时会导致崩溃，而且调试版和发行版的行为可能不同。</p><h3>C++要手动做内存管理?</h3><p>C++同时提供在堆栈上的自动局部变量，以及从自由存储(free store)分配的对象。对于后者，程序员需手动释放，或使用不同的容器和智能指针。 C++程序员经常进一步优化内存，自定义内存分配策略以提升效能，例如使用对象池、自定义的单向/双向堆栈区等。虽然C++0x还没加入GC功能，但也可以自行编写或使用现成库。此外，C/C++也可以直接使用操作系统提供的内存相关功能，例如内存映射文件、共享内存等。</p><h3>使用C++常要重造轮子?</h3><p>我曾参与的C++项目，都会重造不少标准库已提供的功能，此情况在其他语言中较少出现。我试图分析个中原因。首先，C++标准库相对很多语言来说是贫乏的，各开发者便会重复地制造自订库。从另一个角度看，C++标准库是用C++编写的(很多其他语言不用自身而是用C/C++去编写库)，在能力和性能上，自订库和标准库并无本质差别；另外，标准库为通用而设，对不同平台及多种使用需求作取舍，性能上有所影响，例如EA公司就曾发表自制的EASTL规格，描述游戏开发方面对STL的性能及功能需求的特点；此外，多个C++库一起使用，经常会因规范不同而引起冲突，又或功能重叠，所以项目可能须自行开发，或引入其他库的概念或实现(如<a href="http://www.boost.org/"><font color="#3d81ee">Boost</font></a>/<a href="http://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1"><font color="#3d81ee">TR1</font></a>/<a href="http://loki-lib.sourceforge.net/"><font color="#3d81ee">Loki</font></a>)，改写以符合项目规范。</p><h3>C++编译速度很慢?</h3><p>错，是非常慢。我认为C++可能是实用程序语言中编译速度最慢的。此问题涉及C++沿用C的编译链接方式，又加入了复杂的类/泛型声明和内联机制，使编译时间倍增。在C++对编译方法改革之前(如<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2073.pdf"><font color="#3d81ee">module提案</font></a>)，可使用以下技巧改善：第一，使用<a href="http://en.wikipedia.org/wiki/Opaque_pointer"><font color="#3d81ee">pimpl手法</font></a>，因性能损耗应用于调用次数不多的类；第二，仅包含必要头文件，并尽量使用及提供前置声明版本的头文件(如iosfwd)；第三采用基于接口的设计，但须注意虚函数调用成本；第四，采用<a href="http://buffered.io/2007/12/10/the-magic-of-unity-builds/"><font color="#3d81ee">unity build</font></a>，即把多个cpp文件结合在一个编译单元进行编译；第五，采用分布式生成系统如<a href="http://www.xoreax.com/"><font color="#3d81ee">IncrediBuild</font></a>。</p><h3>C++缺乏什么功能?</h3><p>虽然C++已经非常复杂，但仍缺少很多常见功能。 C++0x作出了不少改善，例如语言方面加入Lambda函数、闭包、类型推导声明等，而库方面则加入正则表达式、采用哈希表的unordered_set/unordered_map、引用计数智能指针shared_ptr/weak_ptr等。但最值得留意的是C++0x引入多线程的语法和库功能，这是C++演进的一大步。然而，模组、GC、反射机制等功能虽有提案，却未加进C++0x。</p><h2>C++使用建议</h2><h3>为应用挑选特性集</h3><p>我同意Stroustrup关于使用C++各种技术的回应：“你可以做，不意味着你必须这么做。(Just because you can do it, doesn't mean that you have to.)” C++充满丰富的特性，但同时带来不同问题，例如过分复杂、编译及运行性能的损耗。一般可考虑是否使用多重继承、异常、RTTI，并调节使用模版及模版元编程的程度。使用过分复杂的设计和功能，可能会令部分团队成员更难理解和维护。</p><h3>为团队建立编程规范</h3><p>C++的编码自由度很高，容易编写风格迥异的代码，C++本身也没有定义一些标准规范。而且，C++的源文件物理构成，较许多语言复杂。因此，除了决定特性集，每个团队应建立一套编程规范，包括源文件格式(可使用文件模版)、花括号风格。</p><h3>尽量使用C++风格而非C风格</h3><p>由于C++有对C兼容的包袱，一些功能可以使用C风格实现，但最好使用C++提供的新功能。最基本的是尽量以具名常量、内联函数和泛型取代宏，只把宏用在条件式编译及特殊情况。旧式的C要求局部变量声明在作用域开端，C++则无此限制，应把变量声明尽量置于邻近其使用的地方，for()的循环变量声明可置于for的括号内。 C++中能加强类型安全的功能应尽量使用，例如避免“万能”指针void *，而使用个别或泛型类型；用bool而非int表示布尔值；选用4种C++ cast关键字代替简单的强制转换。</p><h3>结合其他语言</h3><p>如前文所述，C++并非适合所有应用情境，有时可以混合其他语言使用，包括用C++扩展其他语言，或在C++程序中嵌入脚本语言引擎。对于后者，除了使用各种脚本语言的专门API，还可使用<a href="http://www.boost.org/doc/libs/1_42_0/libs/python/doc/index.html"><font color="#3d81ee">Boost</font></a>或<a href="http://www.swig.org/"><font color="#3d81ee">SWIG</font></a>作整合。</p><h2>C++学习建议</h2><p>C++缺点之一，是相对许多语言复杂，而且难学难精。许多人说学习C语言只需一本K&amp;R<a href="http://book.douban.com/subject/1139336/"><font color="#3d81ee">《C程序设计语言》</font></a>即可，但C++书籍却是多不胜数。我是从C进入C++，皆是靠阅读自学。在此分享一点学习心得。个人认为，学习C++可分为4个层次：</p><ul><li>第一层次，C++基础：挑选一本入门书籍，如<a href="http://book.douban.com/subject/4262575/"><font color="#3d81ee">《C++ Primer》</font></a>、<a href="http://book.douban.com/subject/2030264/"><font color="#3d81ee">《C++大学教程》</font></a>、或Stroustrup撰写的经典<a href="http://book.douban.com/subject/1099889/"><font color="#3d81ee">《C++程序设计语言》</font></a>或他一年半前的新作<a href="http://book.douban.com/subject/4875599/"><font color="#3d81ee">《C++程序设计原理与实践》</font></a>，而一般C++课程也止于此，另外<a href="http://book.douban.com/subject/1110941/"><font color="#3d81ee">《C++ 标准程序库》</font></a>及<a href="http://book.douban.com/subject/1868179/"><font color="#3d81ee">《The C++ Standard Library Extensions》</font></a>可供参考；</li><li>第二层次，正确高效地使用C++：此层次开始必须自修，阅读过《(<a href="http://book.douban.com/subject/1241385/"><font color="#3d81ee">More</font></a>)<a href="http://book.douban.com/subject/1842426/"><font color="#3d81ee">Effective C++</font></a>》、《(<a href="http://book.douban.com/subject/1244943/"><font color="#3d81ee">More</font></a>)<a href="http://book.douban.com/subject/1967356/"><font color="#3d81ee">Exceptional C++</font></a>》、<a href="http://book.douban.com/subject/1792179/"><font color="#3d81ee">《Effective STL》</font></a>及<a href="http://book.douban.com/subject/1480481/"><font color="#3d81ee">《C++编程规范》</font></a>等，才适宜踏入专业C++开发之路；</li><li>第三层次，深入了解C++：关于全局问题可读<a href="http://book.douban.com/subject/1091086/"><font color="#3d81ee">《深入探索C++对象模型》</font></a>、<a href="http://book.douban.com/subject/1470838/"><font color="#3d81ee">《Imperfect C++》</font></a>、<a href="http://book.douban.com/subject/2970056/"><font color="#3d81ee">《C++沉思录》</font></a>、<a href="http://book.douban.com/subject/1110934/"><font color="#3d81ee">《STL源码剖析》</font></a>，要挑战智商，可看关于模版及模版元编程的书籍如<a href="http://book.douban.com/subject/2378124/"><font color="#3d81ee">《C++ Templates》</font></a>、<a href="http://book.douban.com/subject/1119904/"><font color="#3d81ee">《C++设计新思维》</font></a>、<a href="http://book.douban.com/subject/4136223/"><font color="#3d81ee">《C++模版元编程》</font></a>；</li><li>第四层次，研究C++：阅读<a href="http://book.douban.com/subject/1096216/"><font color="#3d81ee">《C++语言的设计和演化》</font></a>、<a href="http://book.douban.com/subject/4722718/"><font color="#3d81ee">《编程的本质》</font></a>(含STL设计背后的数学根基)、C++标准文件<a href="http://openassist.googlecode.com/files/C%2B%2B%20Standard%20-%20ANSI%20ISO%20IEC%2014882%202003.pdf"><font color="#3d81ee">《ISO/IEC 14882:2003》</font></a>、<a href="http://www.open-std.org/JTC1/SC22/WG21/"><font color="#3d81ee">C++标准委员会</font></a>的提案书和报告书、关于C++的学术文献。</li></ul><p>由于我主要是应用C++，大约只停留于第二、三个层次。然而，C++只是软件开发的一环而已，单凭语言并不能应付业务和工程上的问题。建议读者不要强求几年内“彻底学会C++的知识”，到达第二层左右便从工作实战中汲取经验，有兴趣才慢慢继续学习更高层次的知识。虽然学习C++有难度，但也是相当有趣且有满足感的。</p><p>数十年来，C++虽有起伏，但她依靠其使用者而不断得到顽强的生命力，相信在我退休之前都不会与她分离，也希望更进一步了解她，与她走进未来。</p></div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/134839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2010-11-27 17:46 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/tianshidebaigu_cpp.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux下的段错误产生的原因及调试方法(推荐，转)</title><link>http://www.cppblog.com/TianShiDeBaiGu/articles/125785.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Fri, 03 Sep 2010 05:16:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/articles/125785.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/125785.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/articles/125785.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/125785.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/125785.html</trackback:ping><description><![CDATA[标签:Linux，段错误，调试  
Linux下的<font color="#008000">段错误产生的原因及调试方法</font><br /><br />这篇文章比较全面，讲的也不错，推荐

<br /><br />简而言之,产生段错误就是访问了错误的内存段，一般是你没有权限，或者根本就不存在对应的物理内存,尤其常见的是访问0地址.

<br />一般来说,段错误就是指访问的内存超出了系统所给这个程序的内存空间，通常这个值是由 &nbsp; <font color="#008000">gdtr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font> 来保存的，他是一个48位的寄存器，其中的32位是保存由它指向的<font color="#008000">gdt</font>表，后13位保存相应于<font color="#008000">gdt</font>的下标，最后3位包括了程序是否在内存中以及程序的在cpu中的运行级别,指向的gdt是由以64位为一个单位的表，在这张表中就保存着程序运行的代码段以及数据段的起始地址以及与此相应的段限和页面交换还有程序运行级别还有内存粒度等等的信息。<br />一旦一个程序发生了越界访问，cpu就会产生相应的异常保护，于是segmentation fault就出现了.

<br /><br /><br />在编程中以下几类做法容易导致段错误,基本是是错误地使用指针引起的

<br /><br />1)访问系统数据区，尤其是往  系统保护的内存地址写数据
   最常见就是给一个指针以0地址
<br />2)内存越界(数组越界，变量类型不一致等) 访问到不属于你的内存区域

解决方法

我们在用C/C++语言写程序的时侯，内存管理的绝大部分工作都是需要我们来做的。实际上，内存管理是一个比较繁琐的工作，无论你多高明，经验多丰富，难免会在此处犯些小错误，而通常这些错误又是那么的浅显而易于消除。<br /><br />但是手工&#8220;除虫&#8221;（debug），往往是效率低下且让人厌烦的，本文将就"段错误"这个内存访问越界的错误谈谈如何快速定位这些"段错误"的语句。
<br />下面将就以下的一个存在段错误的程序介绍几种调试方法：<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; "></span><span style="color: #000000; "> dummy_function&nbsp;(</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">)<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">{<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">ptr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0x00</span><span style="color: #000000; ">;<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #000000; ">*</span><span style="color: #000000; ">ptr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0x00</span><span style="color: #000000; ">;<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;}<br /></span><span style="color: #000000; "></span><span style="color: #000000; "><br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;main&nbsp;(</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">)<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;{<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dummy_function&nbsp;();<br /></span><span style="color: #000000; "></span><span style="color: #000000; "><br /></span><span style="color: #000000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0</span><span style="color: #000000; ">;<br /></span><span style="color: #000000; "></span><span style="color: #000000; ">} <br /></span></div><br />作为一个熟练的C/C++程序员，以上代码的bug应该是很清楚的，因为它尝试操作地址为0的内存区域，而这个内存区域通常是不可访问的禁区，当然就会出错了。<br />我们尝试编译运行它:
<br />$ ./a.out
<br />段错误
 
<br />果然不出所料，它出错并退出了。<br /><br /><br /><br />&nbsp;1.利用gdb逐步查找段错误:
这种方法也是被大众所熟知并广泛采用的方法.<br /><br />首先我们需要一个带有调试信息的可执行程序，所以我们加上&#8220;-g -rdynamic"的参数进行编译，然后用gdb调试运行这个新编译的程序,具体步骤如下:
<br />$ <font color="#ffc0cb">gcc -g -rdynamic d.c
</font><br />$<font color="#ffc0cb"> gdb ./a.out
</font><br />GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
<br />Type "show copying" to see the conditions.
<br />There is absolutely no warranty for GDB. <br /> Type "show warranty" for details.
<br />This GDB was configured as "i686-pc-linux-gnu"...<br />Using host libthread_db library "/lib/libthread_db.so.1".

<br />(gdb)<font color="#ffc0cb"> r
Starting program: ./a.out

</font><br />Program received signal SIGSEGV, Segmentation fault.
<br />0x08048524 in dummy_function () at d.c:4
4               *ptr = 0x00;
<br />(gdb)                      
 
<br />哦？！好像不用一步步调试我们就找到了出错位置d.c文件的第4行，其实就是如此的简单。
从这里我们还发现进程是由于收到了SIGSEGV信号而结束的。<br />通过进一步的查阅文档(man 7 signal)，我们知道SIGSEGV默认handler的动作是打印&#8221;段错误"的出错信息，并产生Core文件，由此我们又产生了方法二。
<br /><br />2.分析Core文件：
<br />Core文件是什么呢？
<br />/The  default action of certain signals is to cause a process to terminate and produce a core dump file, a disk file containing an image of the process's memory  at the time of termination.  A list of the signals which cause a process to dump core can be found in signal(7). 
<br />以 上资料摘自man page(man 5 core)。<br />不过奇怪了，我的系统上并没有找到core文件。后来，想起为了减少系统上的拉圾文件的数量，禁止了core文件的生成，查看了一下果真如此，将系统的core文件的大小限制在512K大小，<br />再试:
<br />$<font color="#008000"> ulimit -c
</font><br />0 <br />$<font color="#008000"> ulimit -c 1000</font><br />$ <font color="#008000">ulimit -c
</font><br />1000 <br />$<font color="#008000"> ./a.out
<br /></font>段错误 (core dumped) <br />$<font color="#008000"> ls
</font><br />a.out  core  d.c  f.c  g.c  pango.c  test_iconv.c  test_regex.c
 
<br /><br />core文件终于产生了，用gdb调试一下看看吧: <br /><br />$ <font color="#008000">gdb ./a.out core
</font><br />GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
<br />GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
<br />Type "show copying" to see the conditions.
<br />There is absolutely no warranty for GDB.  <br />Type "show warranty" for details.
<br />This GDB was configured as "i686-pc-linux-gnu"...<br />Using host libthread_db library "/lib/libthread_db.so.1".


<br />warning: Can't read pathname for load map: 输入/输出错误.
<br />Reading symbols from /lib/libc.so.6...done.
<br />Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
<br />Loaded symbols for /lib/ld-linux.so.2
<br />Core was generated by `./a.out'.
<br /><br />Program terminated with signal 11, Segmentation fault.
<br />#0<font color="#ff1493">  0x08048524 in dummy_function () at d.c:4
4               *ptr = 0x00;
 
</font><br /><br />哇，好历害，还是一步就定位到了错误所在地，佩服一下Linux/Unix系统的此类设计。
<br />接着考虑下去，以前用windows系统下的ie的时侯，有时打开某些网页，会出现&#8220;运行时错误&#8221;，这个时侯如果恰好你的机器上又装有windows的编译器的话，他会弹出来一个对话框，问你是否进行调试，如果你选择是，编译器将被打开，并进入调试状态，开始调试。<br />&nbsp;Linux下如何做到这些呢？<br />我的大脑飞速地旋转着，有了，让它在SIGSEGV的handler中调用gdb，于是第三个方法又诞生了:<br /><br /><br /><br />&nbsp;3.段错误时启动调试:<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">#include<br />#include<br />#include<br />#include<br /></span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;dump(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;signo)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;buf[</span><span style="color: #000000; ">1024</span><span style="color: #000000; ">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;cmd[</span><span style="color: #000000; ">1024</span><span style="color: #000000; ">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FILE&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">fh;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;snprintf(buf,&nbsp;</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(buf),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/proc/%d/cmdline</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getpid());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(</span><span style="color: #000000; ">!</span><span style="color: #000000; ">(fh&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;fopen(buf,&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">r</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(</span><span style="color: #000000; ">0</span><span style="color: #000000; ">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(</span><span style="color: #000000; ">!</span><span style="color: #000000; ">fgets(buf,&nbsp;</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(buf),&nbsp;fh))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(</span><span style="color: #000000; ">0</span><span style="color: #000000; ">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fclose(fh);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(buf[strlen(buf)&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">1</span><span style="color: #000000; ">]&nbsp;</span><span style="color: #000000; ">==</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">'</span><span style="color: #000000; ">\n</span><span style="color: #000000; ">'</span><span style="color: #000000; ">)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buf[strlen(buf)&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">1</span><span style="color: #000000; ">]&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">'</span><span style="color: #000000; ">\0</span><span style="color: #000000; ">'</span><span style="color: #000000; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;snprintf(cmd,&nbsp;</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(cmd),&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">gdb&nbsp;%s&nbsp;%d</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,&nbsp;buf,&nbsp;getpid());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;system(cmd);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(</span><span style="color: #000000; ">0</span><span style="color: #000000; ">);<br />}<br /></span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;dummy_function&nbsp;(</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">ptr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0x00</span><span style="color: #000000; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">ptr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0x00</span><span style="color: #000000; ">;&nbsp;}&nbsp;</span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;main&nbsp;(</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;signal(SIGSEGV,&nbsp;</span><span style="color: #000000; ">&amp;</span><span style="color: #000000; ">dump);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy_function&nbsp;();&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0</span><span style="color: #000000; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span></div><stdio.h><stdlib.h><signal.h><string.h><br />编译运行效果如下:<br />$ <font color="#008000">gcc -g</font><font color="#ff0000">-rdynamic</font><font color="#008000">f.c
</font><br />$ <font color="#008000">./a.ou</font>t<br />&nbsp;GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
<br />Type "show copying" to see the conditions.
<br />There is absolutely no warranty for GDB. <br /> Type "show warranty" for details.
<br />This GDB was configured as "i686-pc-linux-gnu"...<br />Using host libthread_db library "/lib/libthread_db.so.1".

<br />Attaching to program: /home/xiaosuo/test/a.out, process 9563
Reading symbols from/lib/libc.so.6...done.
<br />Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
<br />Loaded symbols for /lib/ld-linux.so.2
0xffffe410 in __kernel_vsyscall ()
<br />/(gdb) bt
<br />#0  0xffffe410 in __kernel_vsyscall ()
<br />#1  0xb7ee4b53 in waitpid () from /lib/libc.so.6
<br />#2  0xb7e925c9 in strtold_l () from /lib/libc.so.6
<br />#3  0x08048830 in dump (signo=11) at f.c:22
<br />#4  <signal handler="" called=""><br />#5  0x0804884c in dummy_function () at f.c:31
<br />#6  0x08048886 in main () at f.c:38
 
<br /><br />怎么样？是不是依旧很酷？
以上方法都是在系统上有gdb的前提下进行的，如果没有呢？其实glibc为我们提供了此类能够dump栈内容的函数簇，详见/usr/include/execinfo.h（这些函数都没有提供man page，难怪我们找不到），另外你也可以通过gnu的手册进行学习。
<br /><br /><br />4.利用<font color="#ee82ee">backtrace和objdump</font>进行分析:
<br />重写的代码如下:
<br /></signal></string.h></signal.h></stdlib.h></stdio.h><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">#include<br />#include<br />#include<br />#include&nbsp;</span><span style="color: #008000; ">/*</span><span style="color: #008000; ">&nbsp;A&nbsp;dummy&nbsp;function&nbsp;to&nbsp;make&nbsp;the&nbsp;backtrace&nbsp;more&nbsp;interesting.&nbsp;</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;dummy_function&nbsp;(</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">ptr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0x00</span><span style="color: #000000; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">ptr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0x00</span><span style="color: #000000; ">;<br />}<br /></span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;dump(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;signo)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">*</span><span style="color: #000000; ">array[</span><span style="color: #000000; ">10</span><span style="color: #000000; ">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;size;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">**</span><span style="color: #000000; ">strings;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;i;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;backtrace&nbsp;(array,&nbsp;</span><span style="color: #000000; ">10</span><span style="color: #000000; ">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strings&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;backtrace_symbols&nbsp;(array,&nbsp;size);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf&nbsp;(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">Obtained&nbsp;%zd&nbsp;stack&nbsp;frames.\n</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,&nbsp;size);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">for</span><span style="color: #000000; ">&nbsp;(i&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0</span><span style="color: #000000; ">;&nbsp;i&nbsp;</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">&nbsp;size;&nbsp;i</span><span style="color: #000000; ">++</span><span style="color: #000000; ">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf&nbsp;(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%s\n</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,&nbsp;strings[i]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;free&nbsp;(strings);&nbsp;exit(</span><span style="color: #000000; ">0</span><span style="color: #000000; ">);<br />}<br /></span><span style="color: #0000FF; ">int</span><span style="color: #000000; ">&nbsp;main&nbsp;(</span><span style="color: #0000FF; ">void</span><span style="color: #000000; ">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;signal(SIGSEGV,&nbsp;</span><span style="color: #000000; ">&amp;</span><span style="color: #000000; ">dump);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy_function&nbsp;();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">0</span><span style="color: #000000; ">;<br />}</span></div><stdio.h><stdlib.h><signal.h><string.h><signal handler="" called=""><execinfo.h><stdio.h><stdlib.h><signal.h> 编译运行结果如下：<br />$ <font color="#008000">gcc -g -rdynamic g.c
</font><br />$<font color="#008000"> ./a.out
</font><br />Obtained 5 stack frames.
<br />./a.out(dump+0x19) [0x80486c2]
[0xffffe420]
<br />./a.out(main+0x35) [0x804876f]<font color="#ffc0cb">
/lib/libc.so.6</font>(__libc_start_main+0xe6) [0xb7e02866]
<br />./a.out [0x8048601]
 
<br />这次你可能有些失望,似乎没能给出足够的信息来标示错误,不急,先看看能分析出来什么吧,<br />用objdump反汇编程序,找到地址0x804876f对应的代码位置: <br />$<font color="#008000"> objdump -d a.out
</font><br />8048765:       e8 02 fe ff ff          call   <br />804856c <signal@plt>
 804876a:       e8 25 ff ff ff          call <br />  8048694 <dummy_function>
 804876f:       b8 00 00 00 00          mov    $0x0,%eax
 <br />8048774:       c9                      leave
 
<br />我们还是找到了在哪个函数(dummy_function)中出错的,信息已然不是很完整,不过有总比没有好的啊!
<br /><br />后记:
本文给出了分析"段错误"的几种方法,不要认为这是与孔乙己先生的"回"字四种写法一样的哦,因为每种方法都有其自身的适用范围和适用环境,请酌情使用,或遵医嘱。 



<br /><br /><br />文章引用自: 
<br /><font color="#000080">http://www.upsdn.net/html/2006-11/775.html
</font></dummy_function></signal@plt></signal.h></stdlib.h></stdio.h></execinfo.h></signal></string.h></signal.h></stdlib.h></stdio.h><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/125785.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2010-09-03 13:16 <a href="http://www.cppblog.com/TianShiDeBaiGu/articles/125785.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>