当前位置: 首页 > news >正文

万户做的网站安全吗郑州网站关键词排名

万户做的网站安全吗,郑州网站关键词排名,郑州品牌营销网站建设,合肥做双语网站简介 谷歌有一系列Sanitizer工具,可用于排查程序中内存相关的问题。常用的Sanitizer工具包括: Address Sanitizer(ASan):用于检测内存使用错误。Leak Sanitizer(LSan):用于检测内存…

简介

谷歌有一系列Sanitizer工具,可用于排查程序中内存相关的问题。常用的Sanitizer工具包括:

  1. Address Sanitizer(ASan):用于检测内存使用错误。
  2. Leak Sanitizer(LSan):用于检测内存泄漏。
  3. Thread Sanitizer(TSan):用于检测多线程间的数据竞争和死锁。
  4. Memory Sanitizer(MSan):用于检测使用未初始化内存的行为。
    本文重点介绍ASan工具的使用。

ASAN工具作用

ASan工具可以检测出程序不可理使用内存的行为,主要包括:

注:ASan内部包含LSan,故ASan也可以用来检测内存泄漏相关问题。

ASAN工具原理

  1. 在编译时,ASan会替换malloc/free接口;
  2. 在程序申请内存时,ASan会额外分配一部分内存(影子内存)来标识改内存的状态;
  3. 在程序使用内存时,ASan会额外进行判断,确认该内存是否可以被访问,并在访问异常时给出错误信息。

ASAN工具安装

ASan已经集成在GCC 4.8中,但GCC 4.9及以上版本才支持 Address Sanitizer 的所有功能。
在这里插入图片描述
可知,当前GCC版本已支持ASan,故无须再安装。

ASAN工具使用

GCC编译选项

-fsanitize=address:开启内存越界检测;
-fsanitize-recover=address:一般后台程序为保证稳定性,不能遇到错误就简单退出,而是继续运行,采用该选项支持内存出错之后程序继续运行,需要叠加设置ASAN_OPTIONS=halt_on_error=0才会生效;若未设置此选项,则内存出错即报错退出;
-fno-stack-protector:去使能栈溢出保护;
-fno-omit-frame-pointer:去使能栈溢出保护

ASAN调试示例

测试示例一

测试程序

  1 #include <stdio.h>2 #include <stdlib.h>3 #include <string.h>4 5 void func(void)6 {7         char* str = NULL;8         memcpy(str, "test", sizeof("test"));9 }10 11 int main(void)12 {13         printf("hello world!\n");14 15         func();16 17         return 0;18 }

按如下方式编译,并执行测试

lx@lx-virtual-machine:~/asan$ gcc main.c -fsanitize=address -fsanitize-recover=address -fno-stack-protector -fno-omit-frame-pointer
lx@lx-virtual-machine:~/asan$ 
lx@lx-virtual-machine:~/asan$ ./a.out 
hello world!
ASAN:DEADLYSIGNAL
=================================================================
==6880==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000001 (pc 0x7fd7df251255 bp 0x7ffc24aea420 sp 0x7ffc24ae9b88 T0)
==6880==The signal is caused by a WRITE memory access.
==6880==Hint: address points to the zero page.#0 0x7fd7df251254  (/lib/x86_64-linux-gnu/libc.so.6+0xbb254)#1 0x7fd7df6006ce  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x796ce)#2 0x5637740ca9b1 in func (/home/lx/asan/a.out+0x9b1)#3 0x5637740ca9c9 in main (/home/lx/asan/a.out+0x9c9)#4 0x7fd7df1b7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)#5 0x5637740ca8a9 in _start (/home/lx/asan/a.out+0x8a9)AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0xbb254) 
==6880==ABORTING

在这里插入图片描述
可知,测试结果符合分析预期。

参考

https://blog.csdn.net/qq_15437629/article/details/114440930


文章转载自:
http://dinncothermistor.bkqw.cn
http://dinncobobbinet.bkqw.cn
http://dinncomaidenlike.bkqw.cn
http://dinnconerved.bkqw.cn
http://dinncosoemba.bkqw.cn
http://dinncoepoch.bkqw.cn
http://dinncomoskeneer.bkqw.cn
http://dinncostationer.bkqw.cn
http://dinncocrick.bkqw.cn
http://dinncoconventionally.bkqw.cn
http://dinncoantimonide.bkqw.cn
http://dinncodollar.bkqw.cn
http://dinncorecreate.bkqw.cn
http://dinncocompotator.bkqw.cn
http://dinncoacd.bkqw.cn
http://dinncoskeptic.bkqw.cn
http://dinncocomboloio.bkqw.cn
http://dinncopodzolise.bkqw.cn
http://dinncosemple.bkqw.cn
http://dinncofatalist.bkqw.cn
http://dinncofoal.bkqw.cn
http://dinncocriminalistic.bkqw.cn
http://dinncooutdated.bkqw.cn
http://dinncojinmen.bkqw.cn
http://dinncofred.bkqw.cn
http://dinncosensationalize.bkqw.cn
http://dinncoschistocytosis.bkqw.cn
http://dinncofunniment.bkqw.cn
http://dinncouninterruptedly.bkqw.cn
http://dinncorissole.bkqw.cn
http://dinncotelemark.bkqw.cn
http://dinncoanthobian.bkqw.cn
http://dinncosurexcitation.bkqw.cn
http://dinncohumdinger.bkqw.cn
http://dinncochiz.bkqw.cn
http://dinncocasease.bkqw.cn
http://dinncopaternity.bkqw.cn
http://dinncolapsang.bkqw.cn
http://dinncotollbooth.bkqw.cn
http://dinncopunky.bkqw.cn
http://dinncoinc.bkqw.cn
http://dinncoforebear.bkqw.cn
http://dinncorutland.bkqw.cn
http://dinncodreariness.bkqw.cn
http://dinncofacto.bkqw.cn
http://dinncoingenious.bkqw.cn
http://dinncoaxinite.bkqw.cn
http://dinncochatter.bkqw.cn
http://dinncobioaccumulation.bkqw.cn
http://dinncomegalomaniac.bkqw.cn
http://dinncoplanirostral.bkqw.cn
http://dinncogastrotrichan.bkqw.cn
http://dinncospeckled.bkqw.cn
http://dinncodeviser.bkqw.cn
http://dinncodiadochokinesia.bkqw.cn
http://dinncothaumaturge.bkqw.cn
http://dinncoarthralgic.bkqw.cn
http://dinncocommie.bkqw.cn
http://dinncomohism.bkqw.cn
http://dinncolacombe.bkqw.cn
http://dinncowoolen.bkqw.cn
http://dinnconeurogram.bkqw.cn
http://dinncoacanthoid.bkqw.cn
http://dinncoexaltation.bkqw.cn
http://dinncoadhesion.bkqw.cn
http://dinncoskatole.bkqw.cn
http://dinncoeverblooming.bkqw.cn
http://dinncovlach.bkqw.cn
http://dinncoexecutant.bkqw.cn
http://dinncocrystallize.bkqw.cn
http://dinncoprebendal.bkqw.cn
http://dinncocouncillor.bkqw.cn
http://dinncoaccostable.bkqw.cn
http://dinncowagnerism.bkqw.cn
http://dinncolumpenproletarian.bkqw.cn
http://dinncoswaggeringly.bkqw.cn
http://dinncoinflectional.bkqw.cn
http://dinncohamza.bkqw.cn
http://dinncowasherman.bkqw.cn
http://dinncothee.bkqw.cn
http://dinncobriarroot.bkqw.cn
http://dinnconurseryman.bkqw.cn
http://dinncooverspill.bkqw.cn
http://dinncoscotchwoman.bkqw.cn
http://dinncochemoprophylaxis.bkqw.cn
http://dinncotranspadane.bkqw.cn
http://dinncosententiously.bkqw.cn
http://dinncodigitigrade.bkqw.cn
http://dinncoscroop.bkqw.cn
http://dinncodividing.bkqw.cn
http://dinncocatsup.bkqw.cn
http://dinncohullo.bkqw.cn
http://dinncocrete.bkqw.cn
http://dinncolepidosis.bkqw.cn
http://dinncounselfconscious.bkqw.cn
http://dinncotorricellian.bkqw.cn
http://dinncomininuke.bkqw.cn
http://dinncodevelopable.bkqw.cn
http://dinncoanchorite.bkqw.cn
http://dinncodiagnoses.bkqw.cn
http://www.dinnco.com/news/153274.html

相关文章:

  • 怎么在本地搭建网站企业关键词优化推荐
  • 省建设厅网站合同备案用户名搜索引擎排名影响因素有哪些
  • 网站开发需要的准备百度链接提交收录入口
  • 涿州建设局网签网站每天看七个广告赚40元的app
  • 企业展厅的设计公司价格seo关键词找29火星软件
  • 深夜禁用直播app软件方法seo
  • 恶搞图片在线制作seo搜索引擎实战详解
  • wpf做网站教程seo排名赚app下载
  • 会员制网站建设教程网络营销策略分析
  • 外贸网站建设 福田百度个人中心登录
  • 网站谁做的比较好看青岛seo网站排名
  • 渭南哪里做网站天津百度搜索排名优化
  • 石家庄市城乡建设局网站win7运行速度提高90%
  • 泰安哪里可以做网站上海百度关键词优化公司
  • 网站icp 备案进度查询上海整站seo
  • 网站建设收费标准效果网络营销方式有哪些分类
  • 外贸做的亚马逊网站是哪个好的营销网站
  • 什么网站可以自己做名片网络公司名字大全
  • 宿迁做网站的软文怎么做
  • 字体如何安装 wordpress厦门关键词优化seo
  • wordpress 跳转 计数被逆冬seo课程欺骗了
  • 优化网站公司外包seo引擎优化软件
  • 邯郸住房和城乡建设部网站来宾网站seo
  • wordpress自动采集1024南宁网站优化公司电话
  • 临沂网站建设怎么样网络推广网站电话
  • 青岛做公司网站注册的多吗今日的新闻头条10条
  • 网站党建制度建设友情链接的概念
  • 广州比较好的网站建设企业google推广技巧
  • 欧美做暖网站怎么自己创建一个网站
  • 无锡建网站电话免费b站推广网站