Menu

#123 BufferUnderflowException in 1.4.r1390

Version 1.4
pending
nobody
None
5
2013-08-19
2012-12-10
Nan Wang
No

Hi,

We encountered this exception while running jnetpcap 1.4.r1390. Could you please take a look?

[java] Exception in thread "Thread-2" java.nio.BufferUnderflowException
[java] at org.jnetpcap.nio.JBuffer.check(Unknown Source)
[java] at org.jnetpcap.nio.JBuffer.getUByte(Unknown Source)
[java] at org.jnetpcap.protocol.tcpip.Tcp.hlen(Unknown Source)
[java] at org.jnetpcap.protocol.tcpip.Tcp.decodeHeader(Unknown Source)
[java] at org.jnetpcap.packet.JHeader.decode(Unknown Source)
[java] at org.jnetpcap.packet.JPacket.getHeaderByIndex(Unknown Source)
[java] at org.jnetpcap.packet.JPacket.getHeader(Unknown Source)
[java] at org.jnetpcap.packet.JPacket.hasHeader(Unknown Source)
[java] at com.lmax.probe.pcap.PacketTranslator.isTcpIp(PacketTranslator.java:50)
[java] at com.lmax.probe.pcap.PcapPacketSourceHandler.nextPacket(PcapPacketSourceHandler.java:47)
[java] at com.lmax.probe.pcap.PcapPacketSourceHandler.nextPacket(PcapPacketSourceHandler.java:12)
[java] at org.jnetpcap.Pcap.loop(Native Method)
[java] at org.jnetpcap.Pcap.loop(Unknown Source)
[java] at com.lmax.probe.pcap.PcapEventSource.run(PcapEventSource.java:37)

LIB CAP:
libpcap-1.0.0-6.20091201git117cb5.el6.x86_64

OS:
Centos 6.3

Jvm Params:
/usr/lib/jvm/java-1.6.0-sun-1.6.0.33.x86_64/jre/bin/java
-Xmx2048m -Xms2048m
-XX:MaxNewSize=256m -XX:NewSize=256m -XX:MaxPermSize=128m
-XX:+UseParallelOldGC -XX:+HeapDumpOnOutOfMemoryError

Discussion

  • Sly Technologies

    • status: open --> pending
     
  • Sly Technologies

    Thanks for the feedback. However I do need a specific capture file that triggers this bug. We also need, in this and any similar errors, the debug dump of the packet structure using the following call: System.out.println(packet.getState().toDebugString()). This will print out a table of the state of the packet as generated by the native scanner. It is essential, to debugging. Having a capture file usually means we can reproduce this error and the packet state.

     

Log in to post a comment.