tcpdump mailing list archives
Debugging an issue with pcap_compile/pcap_setfilter
From: Adayadil Thomas <adayadil.thomas () gmail com>
Date: Thu, 29 Oct 2009 11:23:17 -0400
Hi All,
I have a program that uses libpcap to read and analyze packets.
Libpcap version: 0.9.4
The pseudo code of my program looks like this
PacketFunc()
{
pd = pcap_open_live( ifname, snaplen, 1, 10, errorbuf);
if ( !pd ) {
//error out
}
if(pcap_compile(pd, &fcode, filter, 1, netmask) < 0)
{
//error out
}
if(pcap_setfilter(pd, &fcode) < 0)
{
//error out
}
if(pcap_loop(pd, -1, (pcap_handler) analyze, (u_char *)&args) < 0) {
//error out
}
}
I get a seg fault with the following dump -
Program terminated with signal 11, Segmentation fault.
[New process 9556]
[New process 9555]
[New process 9551]
#0 0xb761807c in ?? ()
(gdb) bt
#0 0xb761807c in ?? ()
#1 0xb7fb308a in _dl_signal_error () from /lib/ld-linux.so.2
#2 0xb7fb313a in _dl_signal_cerror () from /lib/ld-linux.so.2
#3 0xb7faf3ee in _dl_lookup_symbol_x () from /lib/ld-linux.so.2
#4 0xb7fb2cc8 in _dl_fixup () from /lib/ld-linux.so.2
#5 0xb7fb84d0 in _dl_runtime_resolve () from /lib/ld-linux.so.2
#6 0xb7f7da78 in pcap_compile () from /usr/lib/libpcap.so.0.9.4
#7 0x0804bbe5 in PacketFunc (t_id=0x1) at program.c:959
#8 0xb7f6449b in start_thread () from /lib/libpthread.so.0
#9 0xb7eec42e in clone () from /lib/libc.so.6
The following message was found in log file :
symbol lookup error: /usr/lib/libpcap.so.0.9.4: undefined symbol: lex_cleanup
Any ideas or pointers to what the issue may be?
Thanks
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- Debugging an issue with pcap_compile/pcap_setfilter Adayadil Thomas (Oct 29)
- Re: Debugging an issue with pcap_compile/pcap_setfilter Gianluca Varenni (Oct 29)
- Re: Debugging an issue with pcap_compile/pcap_setfilter Adayadil Thomas (Oct 30)
- Re: Debugging an issue with pcap_compile/pcap_setfilter Guy Harris (Oct 30)
- Re: Debugging an issue with pcap_compile/pcap_setfilter Adayadil Thomas (Oct 30)
- Re: Debugging an issue with pcap_compile/pcap_setfilter Gianluca Varenni (Oct 29)
