日期:2014-05-16  浏览次数:20691 次

帮我看下gdb调试core问题
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb573db70 (LWP 24210)]
0x003b16d3 in two_way_short_needle (haystack_start=0xb433a842, haystack_len=6679, needle_start=0x8162c72, needle_len=5) at str-two-way.h:273
273               while (i < needle_len && (CANON_ELEMENT (needle[i])
Missing separate debuginfos, use: debuginfo-install libgcc-4.4.6-4.el6.i686 libstdc++-4.4.6-4.el6.i686 zlib-1.2.3-27.el6.i686
(gdb) bt
#0  0x003b16d3 in two_way_short_needle (haystack_start=0xb433a842, haystack_len=6679, needle_start=0x8162c72, needle_len=5) at str-two-way.h:273
#1  memmem (haystack_start=0xb433a842, haystack_len=6679, needle_start=0x8162c72, needle_len=5) at memmem.c:72
#2  0x0804d7fb in ethernetInputHook (pMuxBuf=0xb433a842 "\214\211\245\276i\324", caplen=8814, secTime=1387467658, usetTime=625149) at pcap/src/rp_mcap.cpp:104
#3  0x0804de9c in pcap_mmap_thread (arg=0x0) at pcap/src/rp_mcap.cpp:389
#4  0x00507b39 in start_thread (arg=0xb573db70) at pthread_create.c:301
#5  0x00417d6e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133
(gdb) frame 3
#3  0x0804de9c in pcap_mmap_thread (arg=0x0) at pcap/src/rp_mcap.cpp:389
389     pcap/src/rp_mcap.cpp: No such file or directory.
        in pcap/src/rp_mcap.cpp
(gdb) list
384     in pcap/src/rp_mcap.cpp

帮我看下这个错误可能出在哪里,谢谢

------解决方案--------------------
while (i < needle_len && (CANON_ELEMENT (needle[i]) 这个语句后面还有呢? 
用p命令打印各个表达式看看结果是不是正常的.