The heap is being corrupted whn running on PPC. Do you have GDB on the embedded box??.
I also sent a similar mail (infact i termed it: A possible bug in libpcap xD), turns out it was completely my fault. If you cant cross compile valgrind, then try using something like efence (http://en.wikipedia.org/wiki/Electric_Fence). On Fri, May 20, 2011 at 11:32 AM, Guy Morand <mor...@telecontrol.ch> wrote: > Hello everyone ! > > I don't know if I'm in the right place but I'm having a strange error with > libpcap and as I > don't find any clue on the Internet, I was wondering if you could help me or > give any > pointer .... > > I wrote a small application with libpcap 1.1.1. It works pretty well on my > station. The problem > comes when I run it on my embedded platform based on PPC, I got this error : > > *** glibc detected *** ./ipSnifferPcap: corrupted double-linked list: > 0x10019000 *** > ======= Backtrace: ========= > /lib/libc.so.6[0xfe7e610] > /lib/libc.so.6[0xfe7e7a8] > /lib/libc.so.6[0xfe80638] > /lib/libc.so.6(__libc_malloc+0xb4)[0xfe827b8] > /lib/libpcap.so(pcap_create_common+0x28)[0xffc84b4] > /lib/libpcap.so(pcap_create+0x18)[0xffc3eac] > /lib/libpcap.so(pcap_open_live+0x40)[0xffc8344] > ./ipSnifferPcap[0x10003514] > ./ipSnifferPcap[0x10003828] > ./ipSnifferPcap[0x10003078] > ./ipSnifferPcap[0x100023fc] > ./ipSnifferPcap[0x100021f8] > ./ipSnifferPcap[0x10001fe8] > ./ipSnifferPcap[0x10001f24] > /lib/libc.so.6[0xfe24fa0] > /lib/libc.so.6[0xfe25124] > ======= Memory map: ======== > 00100000-00103000 r-xp 00100000 00:00 0 [vdso] > 0fe06000-0ff43000 r-xp 00000000 1f:05 187 /lib/libc-2.5.so > 0ff43000-0ff53000 ---p 0013d000 1f:05 187 /lib/libc-2.5.so > 0ff53000-0ff55000 r--p 0013d000 1f:05 187 /lib/libc-2.5.so > 0ff55000-0ff58000 rwxp 0013f000 1f:05 187 /lib/libc-2.5.so > 0ff58000-0ff5b000 rwxp 0ff58000 00:00 0 > 0ff6b000-0ff80000 r-xp 00000000 1f:05 220 /lib/libpthread-2.5.so > 0ff80000-0ff8f000 ---p 00015000 1f:05 220 /lib/libpthread-2.5.so > 0ff8f000-0ff90000 r--p 00014000 1f:05 220 /lib/libpthread-2.5.so > 0ff90000-0ff91000 rwxp 00015000 1f:05 220 /lib/libpthread-2.5.so > 0ff91000-0ff93000 rwxp 0ff91000 00:00 0 > 0ffa3000-0ffdf000 r-xp 00000000 1f:05 886 /lib/libpcap.so > 0ffdf000-0ffef000 ---p 0003c000 1f:05 886 /lib/libpcap.so > 0ffef000-0fff0000 rwxp 0003c000 1f:05 886 /lib/libpcap.so > 10000000-10005000 r-xp 00000000 00:0a 165 /tmp/ipSnifferPcap > 10015000-10016000 rwxp 00005000 00:0a 165 /tmp/ipSnifferPcap > 10016000-10037000 rwxp 10016000 00:00 0 [heap] > 48000000-4801f000 r-xp 00000000 1f:05 178 /lib/ld-2.5.so > 4801f000-48021000 rw-p 4801f000 00:00 0 > 4802e000-4802f000 r--p 0001e000 1f:05 178 /lib/ld-2.5.so > 4802f000-48030000 rwxp 0001f000 1f:05 178 /lib/ld-2.5.so > 48030000-48031000 rwxp 48030000 00:00 0 > 48031000-48032000 ---p 48031000 00:00 0 > 48032000-48831000 rw-p 48032000 00:00 0 > 48831000-48832000 ---p 48831000 00:00 0 > 48832000-49031000 rw-p 48832000 00:00 0 > 49031000-49032000 ---p 49031000 00:00 0 > 49032000-49831000 rw-p 49032000 00:00 0 > 49831000-49832000 ---p 49831000 00:00 0 > 49832000-4a031000 rw-p 49832000 00:00 0 > 4a031000-4a032000 ---p 4a031000 00:00 0 > 4a032000-4a831000 rw-p 4a032000 00:00 0 > bff40000-bff55000 rw-p bffeb000 00:00 0 [stack] > Aborted > > The strangest thing is that when I run it on my x86 with valgrind and doing > exactly the same manipulation, here is what I got : > ==2677== > ==2677== HEAP SUMMARY: > ==2677== in use at exit: 0 bytes in 0 blocks > ==2677== total heap usage: 106 allocs, 106 frees, 64,942 bytes allocated > ==2677== > ==2677== All heap blocks were freed -- no leaks are possible > ==2677== > ==2677== For counts of detected and suppressed errors, rerun with: -v > ==2677== ERROR SUMMARY: 28 errors from 2 contexts (suppressed: 16 from 7) > > So I think on my side, everything looks fine in the sense of memory > management. > I'm also wondering if there is a "bug" in the C library ... ???!!! > > Any advices or pointer is strongly appreciated ! > > Regards, > > Guy Morand > > > - > This is the tcpdump-workers list. > Visit https://cod.sandelman.ca/ to unsubscribe. > - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.