Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-07-12 Thread Guy Harris
On Jul 12, 2011, at 8:26 PM, Flavio Truzzi wrote: > Program received signal SIGABRT, Aborted. > 0x75c57795 in raise () from /lib/libc.so.6 > (gdb) backtrace > #0 0x75c57795 in raise () from /lib/libc.so.6 > #1 0x75c58c0b in abort () from /lib/libc.so.6 > #2 0x75

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-07-12 Thread Flavio Truzzi
=== Backtrace: = /lib/libc.so.6(+0x7366a)[0x75c9666a] /lib/libc.so.6(cfree+0x6c)[0x75c9a54c] /usr/lib/libpcap.so.1(+0x1837a)[0x77bbd37a] /usr/lib/libpcap.so.1(icode_to_fcode+0x7e)[0x77bbf7be] /usr/lib/libpcap.so.1(pcap_compile+0x236)[0x77bb4576] /home/ftruzzi/devel/m

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-06 Thread Guy Harris
On Jun 6, 2011, at 10:39 AM, Flavio Truzzi wrote: > Anyone? As Darren Reed asked: stack trace? - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-06 Thread Flavio Truzzi
Anyone? On Sun, Jun 5, 2011 at 12:26 AM, Flavio Truzzi wrote: > class Sniffer > { > public: > Sniffer(); > void processPacket(const u_char* instance, const pcap_pkthdr *pkthdr); > > > private: > char* dev; > char errbuff[PCAP_ERRBUF_SIZE]; > pcap_t *handle; > struct pcap_p

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-04 Thread Flavio Truzzi
class Sniffer { public: Sniffer(); void processPacket(const u_char* instance, const pcap_pkthdr *pkthdr); private: char* dev; char errbuff[PCAP_ERRBUF_SIZE]; pcap_t *handle; struct pcap_pkthdr header; struct bpf_program filtro; bool match(const u_char* str1,int len

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-04 Thread Guy Harris
On Jun 4, 2011, at 11:23 AM, Flavio Truzzi wrote: > In the class header How is it defined? I.e., what is the statement that defines it? - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-04 Thread Flavio Truzzi
In the class header On Fri, Jun 3, 2011 at 11:41 PM, Guy Harris wrote: > > On Jun 3, 2011, at 4:18 PM, Flavio Truzzi wrote: > > >pcap_compile(handle,&filtro,filtroexp.c_str(),0,0); > > Where is filtro defined? > > - > This is the tcpdump-workers list. > Visit https://cod.sandelman.ca/ to uns

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-03 Thread Guy Harris
On Jun 3, 2011, at 4:18 PM, Flavio Truzzi wrote: >pcap_compile(handle,&filtro,filtroexp.c_str(),0,0); Where is filtro defined? - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-03 Thread Darren Reed
On 3/06/11 04:18 PM, Flavio Truzzi wrote: Hi, I am trying to compile a filter but I am getting a segmentation fault, anyone can help me out? Code: " ... handle = pcap_open_offline(".cap",errbuff); string filtroexp; filtroexp = "tcp port 80"; pcap_compile(handle,&filtr

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-03 Thread Flavio Truzzi
The handle ins't null, if I remove the compile statement I can sniff the packages ... On Fri, Jun 3, 2011 at 8:32 PM, Guy Harris wrote: > > On Jun 3, 2011, at 4:18 PM, Flavio Truzzi wrote: > > >handle = pcap_open_offline(".cap",errbuff); > > You're missing a > >if (handle == NULL

Re: [tcpdump-workers] pcap_compile Segmentation Fault

2011-06-03 Thread Guy Harris
On Jun 3, 2011, at 4:18 PM, Flavio Truzzi wrote: >handle = pcap_open_offline(".cap",errbuff); You're missing a if (handle == NULL) { report whatever error is in errbuff; stop; } there. What happens after you add it? - This is the tcpdump

[tcpdump-workers] pcap_compile Segmentation Fault

2011-06-03 Thread Flavio Truzzi
Hi, I am trying to compile a filter but I am getting a segmentation fault, anyone can help me out? Code: " ... handle = pcap_open_offline(".cap",errbuff); string filtroexp; filtroexp = "tcp port 80"; pcap_compile(handle,&filtro,filtroexp.c_str(),0,0); ... " Thanks, -- Fla