[daily] 在CentOS7中使用 sanitizer-address 发现内存问题 / CentOS7使用SCLo软件源安装devtoolset软件
接前文:
[daily] 内存越界的分析与定位
如前文提及, 使用sanitizer-address 可以有效的检查程序的内存问题。
当时在CentOS7中,虽然也可以使用,但是却遇到如下两个问题:
1. 程序崩溃时的打印信息中,缺少代码信息,虽然知道出了问题,但是却并不知道具体问题处在哪一个地方,哪一行。
2. 不能对 sanitizer-address 设置断点。从而在发生问题的时候,保留运行信息。
对比,我的archlinux,却没有这个问题。我想唯一的区别应该就是gcc的版本问题。
arch的gcc版本是7, CentOS7的gcc版本是4.8.5
所以解决这问题的思路就是安装一个高版本的gcc。
那么在 CentOS7中,安装高版本gcc,一般有两个方法:
1, 使用源码。
2. 使用SCLo
什么是SCLo,简单的说,就是比epel更丰富的软件包集合:
https://www.softwarecollections.org/en/about/
快速使用方法:
https://www.softwarecollections.org/en/docs/
yum install centos-release-scl
好了,有了SCLo库之后,我们就可以安装GCC7了。
yum install devtoolset--gcc
再装GCC7的 libasan
yum install devtoolset--libasan-devel
他们是devtoolset,和常规的软件还不太一样
devtoolset- - Developer Toolset is designed for developers working on CentOS or Red Hat Enterprise Linux platform. It provides current versions of the GNU Compiler Collection,
GNU Debugger, and other development, debugging, and performance monitoring tools.
因为他们都是装在opt下面的,
[root@dpdk chimpanzee]# rpm -ql devtoolset--libasan-devel
/opt/rh/devtoolset-/root/usr/lib/gcc
/opt/rh/devtoolset-/root/usr/lib/gcc/x86_64-redhat-linux
/opt/rh/devtoolset-/root/usr/lib/gcc/x86_64-redhat-linux/
/opt/rh/devtoolset-/root/usr/lib/gcc/x86_64-redhat-linux//libasan.a
/opt/rh/devtoolset-/root/usr/lib/gcc/x86_64-redhat-linux//libasan.so
/opt/rh/devtoolset-/root/usr/lib/gcc/x86_64-redhat-linux//libasan_preinit.o
/opt/rh/devtoolset-/root/usr/share/doc/devtoolset--libasan-devel-7.2.
/opt/rh/devtoolset-/root/usr/share/doc/devtoolset--libasan-devel-7.2./ChangeLog.bz2
/opt/rh/devtoolset-/root/usr/share/doc/devtoolset--libasan-devel-7.2./LICENSE.TXT
[root@dpdk chimpanzee]#
配置一下,就可以用了
[root@dpdk chimpanzee]# source /opt/rh/devtoolset-/enable
[root@dpdk chimpanzee]# gcc -v
... ...
gcc version 7.2. (Red Hat 7.2.-) (GCC)
这个 enable 属于软件 devtoolset-7-runtime
[root@dpdk chimpanzee]# rpm -qf /opt/rh/devtoolset-/enable
devtoolset--runtime-7.0-.el7.sc1.x86_64
这个时候,再去使用sanitizer编译程序,之后就能够看见调试信息了,也能够成功的断到libasan的断点了。
[daily] 在CentOS7中使用 sanitizer-address 发现内存问题 / CentOS7使用SCLo软件源安装devtoolset软件的更多相关文章
- centos7中修改运行级别
centos6 在centos6里打开vim /etc/inittab文件看到下面有一行 id:5:initdefault,因此我们可以通过修改这个文件的id后的数字来修改运行级别 如果我们想要直接切 ...
- 【原创】主机不能访问虚拟机CentOS7中的站点
主机不能访问虚拟机CentOS7中的站点 ================================ 虚拟机上装好了centos7,并配好了nginx+php+mysql,但是本机就是无法访问. ...
- Centos7中hadoop配置
Centos7中hadoop配置 1.下载centos7安装教程: http://jingyan.baidu.com/article/a3aad71aa180e7b1fa009676.html (注意 ...
- CentOS7中DHCP配置
因为需要网络引导系统的安装,所以需要安装和配置DHCP服务器.DHCP(Dynamic Host Configuration Protocol) 动态主机配置协议,它提供了一种动态指定IP地址和配置参 ...
- 在centos7中限制kvm虚拟机可访问的资源
最近通过艰苦卓绝的度娘(我很想用谷歌,可是,你懂的),终于搞明白如何在centos7中限制kvm虚拟机可访问的资源了.度娘给出的结果中,大部分都说的很对,然而,却很难照着做,主要原因有两点:1.网上的 ...
- Centos7中网络及设备相关配置
centos7中,不再赞成使用ifconfig工具,取而代之的是nmcli工具,服务管理也是以systemctl工具取代了service,这些之前版本的工具虽然在centos7中还可以继续使用,只是出 ...
- CentOS7中使用yum安装Nginx的方法
最近无意间发现Nginx官方提供了Yum源.因此写个文章记录下. 1.添加源 默认情况Centos7中无Nginx的源,最近发现Nginx官网提供了Centos的源地址.因此可以如下执行命令添加源: ...
- <亲测>CentOS7中使用yum安装Nginx的方法
CentOS7中使用yum安装Nginx的方法 最近无意间发现Nginx官方提供了Yum源.因此写个文章记录下. 1.添加源 默认情况Centos7中无Nginx的源,最近发现Nginx官网提供了 ...
- Centos7中ELK集群安装流程
Centos7中ELK集群安装流程 说明:三个版本必须相同,这里安装5.1版. 一.安装Elasticsearch5.1 hostnamectl set-hostname elk vim /e ...
随机推荐
- vue遍历时添加个数过滤条件
1.效果 本身有5个地址,显示3个 2.address.html <!DOCTYPE html> <html lang="en"> <head> ...
- oracle 回收表空间的数据文件大小
查看表空间的使用情况: " "used MB",b.bytes "free MB", ,) "percent_used" from ...
- spring batch中用到的表
1,批量表的前缀:{prefix}来自类AbstractJdbcBatchMetadataDao中的变量DEFAULT_TABLE_PREFIX 2,{prefix}job_execution:存放j ...
- Thrift源码学习二——Server层
Thrift 提供了如图五种模式:TSimpleServer.TNonblockingServer.THsHaServer.TThreadPoolServer.TThreadSelectorServe ...
- 【Unity笔记】打包安卓APK时Build Setting中的三种Build System
Internal(Default):Unity内置,仅需Android SDK支持.不能导出工程,适用于仅适用Unity开发的工程. Gradle(New):使用Gradle进行构建,需要Androi ...
- CSS让页面平滑滚动
我们以往实现平滑滚动往往用的是jQuery, 如实现平滑回到顶部,就写如下代码: $('.js_go_to_top').click(function () { $(".js_scroll_a ...
- easyradius通讯接口 V4全新升级,显示同步失败原因,方便用户寻找故障
最近一段时间,我们做了很多的努力,不仅完成了WayOs.BV.ROS.IK.PA接口的重写(主要加入智能判断,能处理的直接处理,不能处理的告诉用户),而且在原有DDNS访问失败的提示下,升级了同步失败 ...
- [Artoolkit] Framework Analysis of nftSimple
What is nftSimple? Loads NFT dataset names from a configuration file. The example uses the “Pinball. ...
- Use a load-balancer as a first row of defense against DDOS
We’ve seen recently more and more DOS and DDOS attacks. Some of them were very big, requiring thousa ...
- [转]ubuntu bits/predefs.h:没有那个文件或目录
[转]ubuntu bits/predefs.h:没有那个文件或目录 (2012-04-28 10:09:38) 转载▼ 标签: it 分类: Linux In file included from ...