October 2016

Using jnetpcap in linux throwing "glibc detected java: malloc(): memory corruption" Error

Hi,

I'm currently using jnetpcap1.4 r1425 version in my project. I'm using offline capture on a pcap file and getting all the sip packets details from the capture file.
I've developed this project on Windows using Eclipse. The project was working fine and I've exported the application as jar and passed the pcap file as argument and i'm getting the desired output and writing it into an external text file.

But now i need to use this application on a linux platform. I've followed all the steps from the link : http://jnetpcap.com/?q=compile/redhat

And i could get the .so files in my usr/lib folder.

When i use the jar file of my application here on linux machine i could see the iteration only on the first few packets (around 2-5) of the capture file and then gets an error.

Even with the sample ClassicPcapExampleOfflineCapture example i get the same error

OUTPUT:

cb_pcap_packet_dispatch() - ENTER
cb_pcap_packet_dispatch() - Java_org_jnetpcap_packet_JScanner_scan
cb_pcap_packet_dispatch() - transferToNewBuffer
cb_pcap_packet_dispatch() - CallVoidMethod
cb_pcap_packet_dispatch() - obj=0x7f6ab455beb8, mid=0x7f6ab036a010, pcap_packet=0x7f6ab009cc30, user=0x7f6ab455beb0
cb_pcap_packet_dispatch() - DeleteLocalRef
cb_pcap_packet_dispatch() - ExceptionCheck
cb_pcap_packet_dispatch() - ENTER
cb_pcap_packet_dispatch() - Java_org_jnetpcap_packet_JScanner_scan
cb_pcap_packet_dispatch() - transferToNewBuffer
cb_pcap_packet_dispatch() - CallVoidMethod
cb_pcap_packet_dispatch() - obj=0x7f6ab455beb8, mid=0x7f6ab036a010, pcap_packet=0x7f6ab009cc48, user=0x7f6ab455beb0
cb_pcap_packet_dispatch() - DeleteLocalRef
cb_pcap_packet_dispatch() - ExceptionCheck
cb_pcap_packet_dispatch() - ENTER
cb_pcap_packet_dispatch() - Java_org_jnetpcap_packet_JScanner_scan
*** glibc detected *** java: malloc(): memory corruption: 0x00007f6ab0c10eb0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3ab5075f4e]
/lib64/libc.so.6[0x3ab507a41a]