Crash JpCapWriter崩溃JVM
当我尝试使用JpCap Writer将数据包保存到文件时,它会导致JVM崩溃 代码:Crash JpCapWriter崩溃JVM,crash,jvm,writer,jpcap,Crash,Jvm,Writer,Jpcap,当我尝试使用JpCap Writer将数据包保存到文件时,它会导致JVM崩溃 代码: 你知道怎么解决吗?或者以TCPDump格式保存数据包的任何其他替代方法?我看到了您对我的问题的评论。我也遇到了同样的问题,这是在我试图关闭writer时造成的,当时writer已经关闭了。你可能在不知不觉中关闭了它。检查您的代码,并查看删除writer.close()的效果已经为您准备好了 如果您不需要操纵数据包,我建议使用。它可以很容易地将数据包捕获为tcpdump并添加捕获筛选器。已经尝试删除writer.
你知道怎么解决吗?或者以TCPDump格式保存数据包的任何其他替代方法?我看到了您对我的问题的评论。我也遇到了同样的问题,这是在我试图关闭writer时造成的,当时writer已经关闭了。你可能在不知不觉中关闭了它。检查您的代码,并查看删除
writer.close()的效果代码>已经为您准备好了
如果您不需要操纵数据包,我建议使用。它可以很容易地将数据包捕获为tcpdump并添加捕获筛选器。已经尝试删除writer.close();。这并不能防止撞车。是否有其他方法将数据包存储到TCPDump格式的文件中?如果出于特定原因(操作数据包)不需要Java,我只会使用Wireshark或类似的方法。
captor=JpcapCaptor.openDevice(interfaceList[interfaceNumber], 65535, true, 20);
captor.setFilter("ip and tcp",true);
JpcapWriter writer=JpcapWriter.openDumpFile(captor,"write.txt");
for(int i=0;i<10;i++){
Packet packet=captor.getPacket();
writer.writePacket(packet);
}
writer.close();
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f283105953a, pid=3060, tid=139810797537024
#
# JRE version: 6.0_24-b24
# Java VM: OpenJDK 64-Bit Server VM (20.0-b12 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea6 1.11.4
# Distribution: Ubuntu 12.04 LTS, package 6b24-1.11.4-1ubuntu0.12.04.1
# Problematic frame:
# v ~BufferBlob::jni_fast_GetLongField
#
# An error report file with more information is saved as:
# /root/workspace/Sniff/hs_err_pid3060.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
# https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#