前言:bedug无处不在,今天花落我家
现象:一个月出现一次异常,难易复现排查,借助神器valgrind排查
1、下载及编译准备
下载地址:https://www.valgrind.org/
tar -jxvf valgrind-3.16.1.tar.bz2
cd valgrind-3.16.1
sudo apt-get install automake
./autogen.sh
2.配置编译安装
打开configure文件搜索armv7* 改成 armv7*|arm
./configure --host=arm-linux CC=arm-none-linux-gnueabi-gcc CPP=arm-none-linux-gnueabi-cpp CXX=arm-none-linux-gnueabi-g++ --prefix=/opt/valgrind-3.16
注:/opt/valgrind-3.16为安装目录
make
make install
3.开发板配置运行
1.将ubuntu虚拟机上得/opt/valgrind-3.16 复制到开发板上 /opt/valgrind-3.16
2.开发板上运行:
chmod -R +x /opt/valgrind-3.16/bin/
chmod -R +x /opt/valgrind-3.16/lib/valgrind/
export VALGRIND_LIB="/opt/valgrind-3.16/lib/valgrind"
coregrind/m_redir.c