tcpdump mailing list archives
Fw: [WinPcap-users] Winpcap/JPcap crashing Java
From: "Loris Degioanni" <loris () netgroup-serv polito it>
Date: Fri, 25 Oct 2002 11:28:36 +0200
I forward this mail to the tcpdump-workers list because I think that the problem is not winpcap-specific. Actually, pcap_loop (and pcap_read?) don't check the validity of the adapter while they are running, therefore problems like the ones you describe happen if someone closes it asynchronously. Should we adopt some solution for this? Loris
Hi, I am using Jpcap written by Keita Fujii from the web site http://www.goto.info.waseda.ac.jp/~fujii/jpcap/. I wrote a multithreaded app in Java, where one thread called loopPacket, which calls pcap_loop and waits forever, the other thread sleeps for sometime and calls pcap_close. This would cause the JVM to crash. I did looked at the wpcap code and
added
a check in pcap_loop do-while statement to check if p->adaptor is NULL. Because pcap_close make the adaptor NULL. I also added the same check in the while loop inside pcap_read. This has solved the problem and I never get this problem anymore. I would like to hear your comments on this and whether I am doing the right thing? Thanks, Abhijeet
- This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe
Current thread:
- Fw: [WinPcap-users] Winpcap/JPcap crashing Java Loris Degioanni (Oct 25)
- Re: Fw: [WinPcap-users] Winpcap/JPcap crashing Java Guy Harris (Oct 25)