free野指针问题
gdb backtrace内容如下:
Program received signal SIGABRT, Aborted.
0xb67683c0 in raise () from /lib/libc.so.
(gdb) p cmd
No symbol "cmd" in current context.
(gdb) bt
# 0xb67683c0 in raise () from /lib/libc.so.
# 0xb6762bfc in abort () from /lib/libc.so.
8 #2 0xb67626a8 in free () from /lib/libc.so.0
9 #3 0xb6a8a6dc in cmd_matcher_match_keyword (matcher=0xbeac7080, token=0x917690, argc=0xbeac7698, argv=0xbeac7634)
at /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c:
# 0xb6a8a97c in cmd_element_match (cmd_element=0xb65d02ec, filter=FILTER_RELAXED, vline=0x8ec160, index=,
match_type=0x0, match=0x0, argc=0xbeac7698, argv=0xbeac7634)
at /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c:
# 0xb6a8ace4 in cmd_parse (cmd_element=0xb65d02ec, vline=0x8ec160, argc=0xbeac7698, argv=0xbeac7634)
at /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c:
# 0xb6a8d680 in cmd_execute_command_real (vline=0x8ec160, filter=FILTER_RELAXED, vty=0x8dd290, cmd=0xbeac7798)
at /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c:
# 0xb6a8e564 in cmd_execute_command (vline=0x8ec160, vty=0x8dd290, cmd=0xbeac7798, vtysh=)
at /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c:
# 0x000278f0 in vtysh_execute_func (line=0x977c8f "snmp-server host 10.54.88.108 inform version v2c community a3 port 162",
pager=) at /Source_route/wns/apps/openswitch_ori/ops-cli/vtysh/vtysh.c:
# 0x00027ec0 in vtysh_execute (line=0x977c8f "snmp-server host 10.54.88.108 inform version v2c community a3 port 162")
at /Source_route/wns/apps/openswitch_ori/ops-cli/vtysh/vtysh.c:
# 0x00025e80 in s_process_cli_cmd (buf=0x985860, len=, msg=0x0, proxy_hdr=0x98581c)
at /Source_route/wns/apps/openswitch_ori/ops-cli/vtysh/vtysh_main.c:
# 0xb6a29a28 in ?? () from /wns/lib/libwns_ipc.so
# 0xb6a29a28 in ?? () from /wns/lib/libwns_ipc.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
看第2、3行, 在cmd_matcher_match_keyword 函数中free出错,有两种情况:释放野指针;重复释放(造成野指针)
所以,在看看前文哪里有free行为的代码, 直接注释掉
(gdb) frame
# 0xb6b326dc in cmd_matcher_match_keyword (matcher=0xbec3d080, token=0xb3b690, argc=0xbec3d698, argv=0xbec3d634) at /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c:
in /Source_route/wns/apps/openswitch_ori/ops-cli/lib/command.c
(gdb) ptype matcher
type = struct cmd_matcher {
struct cmd_element *cmd;
enum filter_type filter;
vector vline;
unsigned int index;
enum match_type *match_type;
vector *match;
unsigned int word_index;
} *
(gdb)
frame n切换现场查看具体信息
free野指针问题的更多相关文章
- linux kernel elv_queue_empty野指针访问内核故障定位与解决
1. 故障描述 故障操作步骤: 单板上插了一个U盘,出问题前正在通过FTP往单板上拷贝文件,拷贝的过程中单板自动重启. 故障现象: Entering kdb (current=0xc000000594 ...
- iOS为真机调试增加scribble来定位野指针
尽管在ARC中,野指针出现的频率已经大大降低了,但是仍然会有野指针困扰着我们. 在模拟器调试中,我们可以开启scribble或者zombieObject来将已经释放的内存填充无意义的内容,能够将一些非 ...
- C++内存泄露之野指针
写出本文仅仅是处于备忘的目的. 最近为现在做的软件添加了一个内存回收机制(以前处于某种内存只申请不释放,这并不等于内存泄露,因为我们知道这些内存块在内存中的位置)-- 在某一块内存不使用的时候将其释放 ...
- iOS开发_内存泄漏、内存溢出和野指针之间的区别
今天,在工作群中,被问到了内存泄漏和野指针指向的区别,自己答的不是很好,特意回来查了资料,在博文中总结一下经验,欢迎指正. 内存泄漏:是指在堆区,alloc 或new 创建了一个对象,但是并没有放到自 ...
- NULL指针、零指针、野指针
1.1.空指针 如果 p 是一个指针变量,则 p = 0; p = 0L; p = '\0'; p = 3 - 3; p = 0 * 17;p=(void*)0; 中的任何一种赋值操作之后, p 都成 ...
- Xcode 7 调试野指针利器 Address sanitizer
Xcode 7 调试野指针利器 Address sanitizer 什么是Address Sanitizer? AddressSanitizer is a fast memory error dete ...
- 黑马程序员-nil Nil NULL NSNull 野指针和空指针
空指针1.空指针指不含有任何内存地址的指针.在没有具体初始化之前,其被符值为0Dog * dog = nil;Dog * dog = NULL;都为空指针2.野指针指指向的内存为垃圾内存,导致其值不确 ...
- C中的野指针—如何避免
转自:http://www.cnblogs.com/viviwind/archive/2012/08/14/2638810.html 先看一个例子: struct student{ char* nam ...
- C语言 野指针与空指针
//野指针与空指针的区别 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> //野指针是 ...
- 野指针及c++指针使用注意点
避免野指针的产生 “野指针”的成因主要有: 1)指针变量没有被初始化.任何指针变量刚被创建时不会自动成为NULL指针,它的缺省值是随机的,它会乱指一气.所以,指针变量在创建的同时应当被初始化,要么将指 ...
随机推荐
- 进度对话框QProgressDialog
继承于 QDialog import sys,time from PyQt5.QtWidgets import QApplication, QWidget,QPushButton,QProgress ...
- 【GDOI2014模拟】服务器
前言 直到比赛最后几分钟,才发现60%数据居然是一个水dp,结果没打完. 题目 我们需要将一个文件复制到n个服务器上,这些服务器的编号为S1, S2, -, Sn. 首先,我们可以选择一些服务器,直接 ...
- 【leetcode】Reaching Points
题目如下: A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). G ...
- A1046
n个节点围成一个环,每个节点之间的距离已知.输入n并给出n个节点的距离,输入m组节点编号(两个),求这两个节点编号间的最短距离. 1 建立dis[]数组,记录V1点到每一个点的顺时针距离,sum计算环 ...
- window7下docker toolbox 启用数据卷报错: Error response from daemon: invalid mode:
场景:希望把d:\dockerShare文件夹作为数据卷 ,和docker中的centos镜像生成的容器关联. 原来的命令: docker run -d -it --name=edc-centos7 ...
- Leetcode 7. Reverse Integer(水)
7. Reverse Integer Easy Given a 32-bit signed integer, reverse digits of an integer. Example 1: Inpu ...
- 个推一键认证SDK重磅推出,打造秒级登录体验,让用户一“键”倾心
移动互联网时代,用户注意力的持续时间越来越短,他们追求便捷与高效.从账号密码登录.短信验证,到第三方登录甚至人脸识别登录,APP的注册/登录方式在逐步变化,开发者希望在这重要的交互端口提升用户的体验, ...
- HTTP入门(二):用Chrome开发者工具查看 HTTP 请求与响应
HTTP入门(二):用Chrome开发者工具查看 HTTP 请求与响应 本文简单总结HTTP的请求与响应. 本文主要目的是对学习内容进行总结以及方便日后查阅. 详细教程和原理可以参考HTTP文档(MD ...
- uva live 7639 Extreme XOR Sum (暴力+二项式)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...
- qbzt day2 下午
内容提要 高精 矩阵 筛法 先是高精除法 注意细节 高精度开方:神奇的竖式 以小数点为分界线,每两个位砍一刀 87654.321-->08|76|54|.32|1 大概就是先对第一位开方,然后相 ...