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. <el-menu>菜单标签(里面可以包括:<el-submenu>和<el-menu-item>)

    <el-menu> 1.router属性,若使用router属性menu-item的index将对应router的path属性 2.mode,下拉菜单的模式分为horizontal和ver ...

  2. man du

    DU(1)                      User Commands/用户命令                     DU(1) NAME/名字         du - estimat ...

  3. zrender笔记----(数字Number组件)出现的问题和解决办法

    1.期望的效果是这样子的(这也是最终结果): 2.开始是用json假数据,开始没考虑null的问题,导致在判断传值处,判断有误. 导致在对接接口时,凌乱了,后来修改了下变成后面图C的逻辑,json数据 ...

  4. js解决手机键盘影响定位的问题

    // 滑动其他地方隐藏软键盘document.body.addEventListener('touchend', function(evt) { document.activeElement.blur ...

  5. [luogu]P1600 天天爱跑步[LCA]

    [luogu]P1600 [NOIP 2016]天天爱跑步 题目描述 小c同学认为跑步非常有趣,于是决定制作一款叫做<天天爱跑步>的游戏.«天天爱跑步»是一个养成类游戏,需要玩家每天按时上 ...

  6. 【PowerOJ1736&网络流24题】飞行员配对方案问题(最小割)

    题意: n<=100,要求输出方案 思路:准备把没刷的24题从头搞一遍 输出方案的话就在增广的时候记一下另一端的编号就好 #include<bits/stdc++.h> using ...

  7. Mysql索引深入理解

    一.  引言 Mysql 我们平常用的很多,了解的很多,今天别的不说,直接说mysql的底层是什么,说到底层,就想到数据结构,那么,mysql的数据结构是什么呢? 是B + tree .那么数据库中的 ...

  8. 如何快速优雅的解决:ORA-02290: 违反检查约束条件 异常问题

    在向oracle保存数据时,控制台报错如下: 很明显是保存时,该表的设计不允许某个字段非空导致的,但由于该表的数量较多,采用断点的方式有太过麻烦, 这里笔者采用 oracle 的客户端连接工具orac ...

  9. Hash算法原理以及HashCode深入理解

    Java中的Collection有两类,一类是List,一类是Set.List内的元素是有序的,元素可以重复.Set元素无序,但元素不可重复.要想保证元素不重复,两个元素是否重复应该依据什么来判断呢? ...

  10. CentOS6.5/7安装配置Samba

    CentOS6.5安装配置Samba 本文的场景是虚拟机运行CentOS6.,本机是Win7,现欲把CentOS上的一个文件夹共享出来,Win的机器可以读写. Samba与window连接需要使用Ne ...