2012-10-26 2 views
0

JpCap Writer를 사용하여 파일에 파일을 저장하려고하면 JVM이 충돌합니다.JpCapWriter가 JVM을 충돌합니다.

코드 :

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. 
# 

어떤 생각? 또는 TCPDump 형식으로 패킷을 저장하는 다른 방법이 있습니까?

답변

0

내 질문에 대한 귀하의 의견을 보았습니다. 나는이 같은 문제가 있었는데 이미 닫힌 후에 필자가 닫으려고 할 때 발생했다. 무의식적으로 닫을 수 있습니다. 코드를 확인하고 writer.close();을 제거하면 어떤 영향이 있는지 확인하십시오.

패킷을 조작 할 필요가없는 경우 Wireshark을 사용하는 것이 좋습니다. 패킷을 TCPDumps로 캡처하고 캡처 필터를 추가하는 것이 매우 쉽습니다.

+0

이미 writer.close();을 (를) 삭제하려고 시도했습니다. 충돌을 막지 않습니다. 패킷을 TCP 덤프 형식의 파일에 저장하는 다른 방법이 있습니까? –

+0

특정 이유로 (패킷을 조작하는) Java가 필요하지 않다면 Wireshark 또는 이와 비슷한 것을 사용할 것입니다. –

관련 문제