| |

VerySource

 Forgot password?
 Register
Search
View: 1305|Reply: 6

Java grabbing data packet error

[Copy link]

2

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-9-28 15:30:01
| Show all posts |Read mode
import jpcap.Jpcap;
import jpcap.JpcapHandler;
import jpcap.Packet;

public class JpcapTip implements JpcapHandler {

public void handlePacket(Packet packet) {
System.out.println(packet);
}

public static void main(String[] args) throws java.io.IOException {
String[] devices = Jpcap.getDeviceList();

// for (int i = 0; i <devices.length; i++) {
// System.out.println(devices[i]);
//}

String deviceName = devices[0];
Jpcap jpcap = Jpcap.openDevice(deviceName, 1024, false, 1);
jpcap.processPacket(-1, new JpcapTip());

Packet packet = jpcap.getPacket();

System.out.println(packet.toString());

}
}


Why does the following strange error occur in jpcap.getPacket();?
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10001529, pid=756, tid=3128
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode, sharing)
# Problematic frame:
# C [Jpcap.dll+0x1529]
#
# An error report file with more information is saved as hs_err_pid756.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Reply

Use magic Report

0

Threads

39

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-9-29 09:00:02
| Show all posts
1.5.0_08-b03, please upgrade your JDK, or streamline the content of hs_err_pid756.log.
Reply

Use magic Report

1

Threads

51

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-9-29 11:45:01
| Show all posts
# An unexpected error has been detected by HotSpot Virtual Machine:
The problem with the JDK, is it reported an error once after running, or it happens occasionally~
Reply

Use magic Report

2

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-9-30 16:15:01
| Show all posts
Thank you brothers, my jdk is 1.5.0_08, it should not be a jdk problem. My JPcap uses jpcap1.4 downloaded from Sourceforge.net, which is a bit old, I don’t know if this is the problem?
Reply

Use magic Report

2

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-9-30 16:30:02
| Show all posts
The content of hs_err_pid756.log is like this:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10001529, pid=4084, tid=3644
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode, sharing)
# Problematic frame:
# C [Jpcap.dll+0x1529]
#

--------------- T H R E A D ---------------

Current thread (0x00823ab0): JavaThread "main" [_thread_in_native, id=3644]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000c

Registers:
EAX=0x00000001, EBX=0x26c26b78, ECX=0x0000000c, EDX=0x00000000
ESP=0x0006fa04, EBP=0x1000e2a0, ESI=0x00823b70, EDI=0x00000000
EIP=0x10001529, EFLAGS=0x00010246

Top of Stack: (sp=0x0006fa04)
0x0006fa04: 00823b70 00000000 0006fa7c 26c26b78
0x0006fa14: 00000001 02da8580 10001fde 00000000
0x0006fa24: 0006fa7c 00bd8215 00823ab0 00000000
0x0006fa34: 0006fa5c 00000000 00823ab0 26c26b78
0x0006fa44: 00000000 0006fa7c 00bd8215 00823ab0
0x0006fa54: 00bd832f 00823b70 0006fa8c 0006fa60
0x0006fa64: 26c26b78 0006fa8c 26c27090 00000000
0x0006fa74: 26c26b78 0006fa8c 0006faac 00bd2aba

Instructions: (pc=0x10001529)
0x10001519: 45 00 8b 0c 85 60 a1 00 10 57 8b 7c 24 2c 33 d2
0x10001529: 66 8b 14 39 89 7c 24 10 89 6c 24 34 52 ff 15 f0


Stack: [0x00030000,0x00070000), sp=0x0006fa04, free space=254k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [Jpcap.dll+0x1529]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j jpcap.Jpcap.getPacket()Ljpcap/Packet;+0
j subjectprogram.JpcapTip.main([Ljava/lang/String;)V+19
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: (=> current thread)
  0x00830510 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=984]
  0x0082f860 JavaThread "CompilerThread0" daemon [_thread_blocked, id=1268]
  0x0082e670 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=820]
  0x0082dbe0 JavaThread "Finalizer" daemon [_thread_blocked, id=3172]
  0x0082c9a0 JavaThread "Reference Handler" daemon [_thread_blocked, id=1640]
=>0x00823ab0 JavaThread "main" [_thread_in_native, id=3644]

Other Threads:
  0x0082bbc0 VMThread [id=3868]
  0x008310c0 WatcherThread [id=1136]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 576K, used 373K [0x22bd0000, 0x22c70000, 0x230b0000)
  eden space 512K, 72% used [0x22bd0000, 0x22c2d4a8, 0x22c50000)
  from space 64K, 0% used [0x22c50000, 0x22c50000, 0x22c60000)
  to space 64K, 0% used [0x22c60000, 0x22c60000, 0x22c70000)
tenured generation total 1408K, used 0K [0x230b0000, 0x23210000, 0x26bd0000)
   the space 1408K, 0% used [0x230b0000, 0x230b0000, 0x230b0200, 0x23210000)
compacting perm gen total 8192K, used 375K [0x26bd0000, 0x273d0000, 0x2abd0000)
   the space 8192K, 4% used [0x26bd0000, 0x26c2de68, 0x26c2e000, 0x273d0000)
    ro space 8192K, 63% used [0x2abd0000, 0x2b0dd608, 0x2b0dd800, 0x2b3d0000)
    rw space 12288K, 46% used [0x2b3d0000, 0x2b970608, 0x2b970800, 0x2bfd0000)

Dynamic libraries:
0x00400000-0x0040d000 C:\Program Files\Java\jre1.5.0_08\bin\javaw.exe
0x7c920000-0x7c9b4000 C:\WINDOWS\system32\ntdll.dll
0x7c800000-0x7c91c000 C:\WINDOWS\system32\kernel32.dll
0x77da0000-0x77e49000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e50000-0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll
0x77d10000-0x77d9f000 C:\WINDOWS\system32\USER32.dll
0x77ef0000-0x77f37000 C:\WINDOWS\system32\GDI32.dll
0x77be0000-0x77c38000 C:\WINDOWS\system32\MSVCRT.dll
0x76300000-0x7631d000 C:\WINDOWS\system32\IMM32.DLL
0x62c20000-0x62c29000 C:\WINDOWS\system32\LPK.DLL
0x73fa0000-0x7400b000 C:\WINDOWS\system32\USP10.dll
0x6d6c0000-0x6d85b000 C:\Program Files\Java\jre1.5.0_08\bin\client\jvm.dll
0x76b10000-0x76b3a000 C:\WINDOWS\system32\WINMM.dll
0x6d280000-0x6d288000 C:\Program Files\Java\jre1.5.0_08\bin\hpi.dll
0x76bc0000-0x76bcb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d690000-0x6d69c000 C:\Program Files\Java\jre1.5.0_08\bin\verify.dll
0x6d300000-0x6d31d000 C:\Program Files\Java\jre1.5.0_08\bin\java.dll
0x6d6b0000-0x6d6bf000 C:\Program Files\Java\jre1.5.0_08\bin\zip.dll
0x10000000-0x10012000 C:\Program Files\Java\jre1.5.0_08\bin\Jpcap.dll
0x71a20000-0x71a37000 C:\WINDOWS\system32\WS2_32.dll
0x71a10000-0x71a18000 C:\WINDOWS\system32\WS2HELP.dll
0x02da0000-0x02de1000 C:\WINDOWS\system32\wpcap.dll
0x02df0000-0x02e05000 C:\WINDOWS\system32\packet.dll
0x02e10000-0x02e20000 C:\WINDOWS\system32\WanPacket.dll
0x5a740000-0x5a751000 C:\WINDOWS\system32\NPPTools.dll
0x727a0000-0x7289e000 C:\WINDOWS\system32\MFC42u.DLL
0x76990000-0x76acd000 C:\WINDOWS\system32\ole32.dll
0x770f0000-0x7717c000 C:\WINDOWS\system32\OLEAUT32.dll
0x76d30000-0x76d48000 C:\WINDOWS\system32\iphlpapi.dll
0x77bd0000-0x77bd8000 C:\WINDOWS\system32\VERSION.dll
0x61be0000-0x61bed000 C:\WINDOWS\system32\MFC42LOC.DLL
0x610c0000-0x610d1000 C:\WINDOWS\system32\npp\ndisnpp.dll
0x5adc0000-0x5adf7000 C:\WINDOWS\system32\uxtheme.dll
0x74680000-0x746cb000 C:\WINDOWS\system32\MSCTF.dll
0x76fa0000-0x7701f000 C:\WINDOWS\system32\CLBCATQ.DLL
0x77020000-0x770ba000 C:\WINDOWS\system32\COMRes.dll
0x77fc0000-0x77fd1000 C:\WINDOWS\system32\Secur32.dll

VM Arguments:
java_command: subjectprogram.JpcapTip
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_08
CLASSPATH=.;C:\Program Files\Java\jdk1.5.0_08\lib\tools.jar;C:\Program Files\Java\jdk1.5.0_08\lib\dt.jar;
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Java\jdk1uo Filesuo\Common\uo\uo1CommonFiles:\uo1CommonFiles:\uo1Common\Common FilesC:\ui1
USERNAME=Xia Zhixiong
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 1, AuthenticAMD



--------------- S Y S T E M ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU: total 1 (cores per cpu 1, threads per core 1) family 6 model 8 stepping 1, cmov, cx8, fxsr, mmx, sse, mmxext, 3dnowext, 3dnow

Memory: 4k page, physical 523760k(103052k free), swap 1279916k(831972k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_08-b03) for windows-x86, built on Jul 26 2016 01:10:50 by "java_re" with MS VC++ 6.0
Reply

Use magic Report

0

Threads

39

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-9-30 18:30:02
| Show all posts
Khan, never got Jpcap
Try another operating system and JDK.
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-10-1 10:15:01
| Show all posts
Oh, by the way, there seems to be two versions of Jpcap now, http://jpcap.sourceforge.net/ is written above

Jpcap development is hosted at http://www.sf.net/projects/jpcap. After I downloaded jpcap-0.5.1, I found a sentence in F&Q:

Q: Is this Jpcap related to the Jpcap on sourceforge?

A: No. They are independently developed, and thus are totally different products.


Damn, I'm so confused~~~~~~~~`
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list