style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-7505528228218001"
data-ad-slot="1225241371">

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

No replies
aboyapati
Offline
Joined: 10/24/2016

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]
/lib64/libc.so.6(__libc_malloc+0x5c)[0x3ab507ab1c]
/lib64/ld-linux-x86-64.so.2[0x3ab4c0e395]
/lib64/ld-linux-x86-64.so.2[0x3ab4c0e55a]
/lib64/ld-linux-x86-64.so.2[0x3ab4c0a37a]
/lib64/libc.so.6[0x3ab5127016]
/lib64/libdl.so.2[0x3ab58010c4]
/lib64/ld-linux-x86-64.so.2[0x3ab4c0e286]
/lib64/libdl.so.2[0x3ab580129c]
/lib64/libdl.so.2(dlsym+0x4a)[0x3ab580107a]
/opt/jdk1.8.0_60/jre/lib/amd64/server/libjvm.so(+0x91724d)[0x7f6ab4e7524d]
/opt/jdk1.8.0_60/jre/lib/amd64/libjava.so(Java_java_lang_ClassLoader_00024NativeLibrary_find+0x6e)[0x7f6ab403102e]
[0x7f6aa0bec914]
======= Memory map: ========
00400000-00401000 r-xp 00000000 fd:00 1448140 /opt/jdk1.8.0_60/bin/java
00600000-00601000 rw-p 00000000 fd:00 1448140 /opt/jdk1.8.0_60/bin/java
01139000-0115a000 rw-p 00000000 00:00 0 [heap]
c4000000-c5400000 rw-p 00000000 00:00 0
c5400000-d8000000 ---p 00000000 00:00 0
d8000000-da800000 rw-p 00000000 00:00 0
da800000-100000000 ---p 00000000 00:00 0
100000000-1000e0000 rw-p 00000000 00:00 0
1000e0000-140000000 ---p 00000000 00:00 0
3532200000-3532216000 r-xp 00000000 fd:00 133995 /lib64/libgcc_s-4.4.7-20120601.so.1
3532216000-3532415000 ---p 00016000 fd:00 133995 /lib64/libgcc_s-4.4.7-20120601.so.1
3532415000-3532416000 rw-p 00015000 fd:00 133995 /lib64/libgcc_s-4.4.7-20120601.so.1
3532600000-35326e8000 r-xp 00000000 fd:00 402863 /usr/lib64/libstdc++.so.6.0.13
35326e8000-35328e8000 ---p 000e8000 fd:00 402863 /usr/lib64/libstdc++.so.6.0.13
35328e8000-35328ef000 r--p 000e8000 fd:00 402863 /usr/lib64/libstdc++.so.6.0.13
35328ef000-35328f1000 rw-p 000ef000 fd:00 402863 /usr/lib64/libstdc++.so.6.0.13
35328f1000-3532906000 rw-p 00000000 00:00 0
3ab4c00000-3ab4c20000 r-xp 00000000 fd:00 131114 /lib64/ld-2.12.so
3ab4e1f000-3ab4e20000 r--p 0001f000 fd:00 131114 /lib64/ld-2.12.so
3ab4e20000-3ab4e21000 rw-p 00020000 fd:00 131114 /lib64/ld-2.12.so
3ab4e21000-3ab4e22000 rw-p 00000000 00:00 0
3ab5000000-3ab518a000 r-xp 00000000 fd:00 131164 /lib64/libc-2.12.so
3ab518a000-3ab538a000 ---p 0018a000 fd:00 131164 /lib64/libc-2.12.so
3ab538a000-3ab538e000 r--p 0018a000 fd:00 131164 /lib64/libc-2.12.so
3ab538e000-3ab538f000 rw-p 0018e000 fd:00 131164 /lib64/libc-2.12.so
3ab538f000-3ab5394000 rw-p 00000000 00:00 0
3ab5400000-3ab5417000 r-xp 00000000 fd:00 131219 /lib64/libpthread-2.12.so
3ab5417000-3ab5617000 ---p 00017000 fd:00 131219 /lib64/libpthread-2.12.so
3ab5617000-3ab5618000 r--p 00017000 fd:00 131219 /lib64/libpthread-2.12.so
3ab5618000-3ab5619000 rw-p 00018000 fd:00 131219 /lib64/libpthread-2.12.so
3ab5619000-3ab561d000 rw-p 00000000 00:00 0
3ab5800000-3ab5802000 r-xp 00000000 fd:00 131167 /lib64/libdl-2.12.so
3ab5802000-3ab5a02000 ---p 00002000 fd:00 131167 /lib64/libdl-2.12.so
3ab5a02000-3ab5a03000 r--p 00002000 fd:00 131167 /lib64/libdl-2.12.so
3ab5a03000-3ab5a04000 rw-p 00003000 fd:00 131167 /lib64/libdl-2.12.so
3ab5c00000-3ab5c07000 r-xp 00000000 fd:00 131242 /lib64/librt-2.12.so
3ab5c07000-3ab5e06000 ---p 00007000 fd:00 131242 /lib64/librt-2.12.so
3ab5e06000-3ab5e07000 r--p 00006000 fd:00 131242 /lib64/librt-2.12.so
3ab5e07000-3ab5e08000 rw-p 00007000 fd:00 131242 /lib64/librt-2.12.so
3ab6000000-3ab6083000 r-xp 00000000 fd:00 133444 /lib64/libm-2.12.so
3ab6083000-3ab6282000 ---p 00083000 fd:00 133444 /lib64/libm-2.12.so
3ab6282000-3ab6283000 r--p 00082000 fd:00 133444 /lib64/libm-2.12.so
3ab6283000-3ab6284000 rw-p 00083000 fd:00 133444 /lib64/libm-2.12.so
7f6a74000000-7f6a74021000 rw-p 00000000 00:00 0
7f6a74021000-7f6a78000000 ---p 00000000 00:00 0
7f6a7c000000-7f6a7c188000 rw-p 00000000 00:00 0
7f6a7c188000-7f6a80000000 ---p 00000000 00:00 0
7f6a80000000-7f6a802bb000 rw-p 00000000 00:00 0
7f6a802bb000-7f6a84000000 ---p 00000000 00:00 0
7f6a84000000-7f6a84021000 rw-p 00000000 00:00 0
7f6a84021000-7f6a88000000 ---p 00000000 00:00 0
7f6a8a16f000-7f6a90000000 r--p 00000000 fd:00 397078 /usr/lib/locale/locale-archive
7f6a90000000-7f6a90021000 rw-p 00000000 00:00 0
7f6a90021000-7f6a94000000 ---p 00000000 00:00 0
7f6a94000000-7f6a94021000 rw-p 00000000 00:00 0
7f6a94021000-7f6a98000000 ---p 00000000 00:00 0
7f6a98000000-7f6a98021000 rw-p 00000000 00:00 0
7f6a98021000-7f6a9c000000 ---p 00000000 00:00 0
7f6a9e7c3000-7f6a9e7c6000 ---p 00000000 00:00 0
7f6a9e7c6000-7f6a9e8c4000 rw-p 00000000 00:00 0
7f6a9e8c4000-7f6a9e901000 r-xp 00000000 fd:00 393638 /usr/lib64/libpcap.so.1.4.0
7f6a9e901000-7f6a9eb01000 ---p 0003d000 fd:00 393638 /usr/lib64/libpcap.so.1.4.0
7f6a9eb01000-7f6a9eb03000 rw-p 0003d000 fd:00 393638 /usr/lib64/libpcap.so.1.4.0
7f6a9eb03000-7f6a9eb04000 rw-p 00000000 00:00 0
7f6a9eb15000-7f6a9eb3e000 r-xp 00000000 fd:00 409342 /usr/lib/libjnetpcap.so.1.4.r1425
7f6a9eb3e000-7f6a9ed3e000 ---p 00029000 fd:00 409342 /usr/lib/libjnetpcap.so.1.4.r1425
7f6a9ed3e000-7f6a9ed3f000 rw-p 00029000 fd:00 409342 /usr/lib/libjnetpcap.so.1.4.r1425
7f6a9ed3f000-7f6a9edc3000 rw-p 00000000 00:00 0
7f6a9edc3000-7f6a9edcd000 r--s 0005e000 fd:00 1056679 /tmp/jar_cache5132232654051273470.tmp (deleted)
7f6a9edcd000-7f6a9ede3000 r-xp 00000000 fd:00 1447994 /opt/jdk1.8.0_60/jre/lib/amd64/libnet.so
7f6a9ede3000-7f6a9efe3000 ---p 00016000 fd:00 1447994 /opt/jdk1.8.0_60/jre/lib/amd64/libnet.so
7f6a9efe3000-7f6a9efe4000 rw-p 00016000 fd:00 1447994 /opt/jdk1.8.0_60/jre/lib/amd64/libnet.so
7f6a9efe4000-7f6a9eff5000 r-xp 00000000 fd:00 1448021 /opt/jdk1.8.0_60/jre/lib/amd64/libnio.so
7f6a9eff5000-7f6a9f1f4000 ---p 00011000 fd:00 1448021 /opt/jdk1.8.0_60/jre/lib/amd64/libnio.so
7f6a9f1f4000-7f6a9f1f5000 rw-p 00010000 fd:00 1448021 /opt/jdk1.8.0_60/jre/lib/amd64/libnio.soAborted (core dumped)

------------------------------------------------------------------------------------------------------------------------

I'm not sure where i'm going wrong because the code works perfectly fine in windows but the problem comes only when i try to run on a linux machine.

Can some one please help me out. It's really urgent.

aboyapati