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野指针问题的更多相关文章

  1. linux kernel elv_queue_empty野指针访问内核故障定位与解决

    1. 故障描述 故障操作步骤: 单板上插了一个U盘,出问题前正在通过FTP往单板上拷贝文件,拷贝的过程中单板自动重启. 故障现象: Entering kdb (current=0xc000000594 ...

  2. iOS为真机调试增加scribble来定位野指针

    尽管在ARC中,野指针出现的频率已经大大降低了,但是仍然会有野指针困扰着我们. 在模拟器调试中,我们可以开启scribble或者zombieObject来将已经释放的内存填充无意义的内容,能够将一些非 ...

  3. C++内存泄露之野指针

    写出本文仅仅是处于备忘的目的. 最近为现在做的软件添加了一个内存回收机制(以前处于某种内存只申请不释放,这并不等于内存泄露,因为我们知道这些内存块在内存中的位置)-- 在某一块内存不使用的时候将其释放 ...

  4. iOS开发_内存泄漏、内存溢出和野指针之间的区别

    今天,在工作群中,被问到了内存泄漏和野指针指向的区别,自己答的不是很好,特意回来查了资料,在博文中总结一下经验,欢迎指正. 内存泄漏:是指在堆区,alloc 或new 创建了一个对象,但是并没有放到自 ...

  5. NULL指针、零指针、野指针

    1.1.空指针 如果 p 是一个指针变量,则 p = 0; p = 0L; p = '\0'; p = 3 - 3; p = 0 * 17;p=(void*)0; 中的任何一种赋值操作之后, p 都成 ...

  6. Xcode 7 调试野指针利器 Address sanitizer

    Xcode 7 调试野指针利器 Address sanitizer 什么是Address Sanitizer? AddressSanitizer is a fast memory error dete ...

  7. 黑马程序员-nil Nil NULL NSNull 野指针和空指针

    空指针1.空指针指不含有任何内存地址的指针.在没有具体初始化之前,其被符值为0Dog * dog = nil;Dog * dog = NULL;都为空指针2.野指针指指向的内存为垃圾内存,导致其值不确 ...

  8. C中的野指针—如何避免

    转自:http://www.cnblogs.com/viviwind/archive/2012/08/14/2638810.html 先看一个例子: struct student{ char* nam ...

  9. C语言 野指针与空指针

    //野指针与空指针的区别 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> //野指针是 ...

  10. 野指针及c++指针使用注意点

    避免野指针的产生 “野指针”的成因主要有: 1)指针变量没有被初始化.任何指针变量刚被创建时不会自动成为NULL指针,它的缺省值是随机的,它会乱指一气.所以,指针变量在创建的同时应当被初始化,要么将指 ...

随机推荐

  1. JSON提取器

    如果返回的数据是JSON格式的,我们可以用JSON提取器来提取需要的字段,这样更简单一点 Variable names:保存的变量名,后面使用${Variable names}引用 JSON Path ...

  2. get和post请求方式的区别,常见状态码的整理

    get和post的区别 get和post是什么? HTTP协议中的两种发送请求的方法.get从指定的资源请求数据: post向指定的资源提交要被处理的数据. HTTP是什么? 超文本传输协议(HTTP ...

  3. HDU 6205 card card card ( 思维 )

    题意 : 给定两个序列 a 和 b ,保证 a 数列的和 == b数列的和,从头到尾考虑 (a[i] - b[i]) 的前缀和,直到前缀和为负数则无法进行下去,所得的便是a[1~i]的和,现在有一个操 ...

  4. HDU 6620 Just an Old Puzzle

    Time limit 2000 ms Memory limit 262144 kB OS Windows 解题过程 感觉搜索不可行,状态太多了,120步,判断状态是否重复时,即使用std::map也太 ...

  5. ARIMA模型--粒子群优化算法(PSO)和遗传算法(GA)

    ARIMA模型(完整的Word文件可以去我的博客里面下载) ARIMA模型(英语:AutoregressiveIntegratedMovingAverage model),差分整合移动平均自回归模型, ...

  6. Behaviour Tree Service 中的几个函数

    Service中可以override的函数有8个,因为每个函数都有个AI版本的,所以实际上是4组函数,AI版本的和非AI版本基本一样, 他们分别是: Receive Search Start (AI) ...

  7. Codeforces Round #603 (Div. 2) E. Editor

    E. Editor 题目链接: https://codeforces.com/contest/1263/problem/E 题目大意: 输入一个字符串S1含有‘(’ , ‘)’ , ‘R’ , ‘L’ ...

  8. eclipse配置apache tomcat运行时访问路径不需要项目名称

    问题:tomcat运行项目默认是要带上项目名的,有时候不想要项目名来访问,如何解决呢? 方法: 1:双击打开tomcat 2:选择Modules,选择你要修改的项目 3:点击Edit,把path修改成 ...

  9. [CSP-S模拟测试]:导弹袭击(数学+凸包+单调栈)

    题目背景 $Guess$准备向敌军阵地发起进攻了!$Guess$的武器是自动制导导弹.然而在机房是不允许游戏的,所以班长$XZY$对游戏界面进行了降维打击,结果... 题目描述 众所周知,环境因素对导 ...

  10. Python 学习笔记(基础语法 restful 、 Flask 和 Requests)

    input 函数 #!/usr/bin/env python3 name = input("\n\n按下 enter 键后退出.") print(name) print() 在 p ...