Java通过JNI调用libcurl导致JVM崩溃

问题描述

通过Java的JNI调用libcurl导致JVM崩溃,不知道什么原因大家帮看看,并不是刚上来就崩溃,而是执行一段就崩溃,JVM崩溃的log如下:##AfatalerrorhasbeendetectedbytheJavaRuntimeEnvironment:##SIGSEGV(0xb)atpc=0x0000003163221ca2,pid=12648,tid=47588522796480##JREversion:6.0_23-b05#JavaVM:JavaHotSpot(TM)64-BitServerVM(19.0-b09mixedmodelinux-amd64compressedoops)#Problematicframe:#C[libcurl.so.3+0x21ca2]##Ifyouwouldliketosubmitabugreport,pleasevisit:#http://java.sun.com/webapps/bugreport/crash.jsp#---------------THREAD---------------Currentthreadisnativethreadsiginfo:si_signo=SIGSEGV:si_errno=0,si_code=1(SEGV_MAPERR),si_addr=0x0000003100000500Registers:RAX=0x0000003100000500,RBX=0x0000003163234700,RCX=0x00000000438fc3a0,RDX=0x0000000000004000RSP=0x00000000438fad48,RBP=0x0000000000000000,RSI=0x00000000438fc370,RDI=0x000000000000006eR8=0x00000000438fc490,R9=0x0000000000000001,R10=0x0000000000000008,R11=0x0000000000000246R12=0x0000000000000000,R13=0x00000000438fc370,R14=0x0000003163221c90,R15=0x00002aaabc00b0e0RIP=0x0000003163221ca2,EFL=0x0000000000010287,CSGSFS=0x0000000000000033,ERR=0x0000000000000006TRAPNO=0x000000000000000eRegistertomemorymapping:RAX=0x00000031000005000x0000003100000500ispointingtounknownlocationRBX=0x00000031632347000x0000003163234700:<offset0x34700>in/usr/lib64/libcurl.so.3at0x0000003163200000RCX=0x00000000438fc3a00x00000000438fc3a0ispointingintothestackforthread:0x000000005aba3000[erroroccurredduringerrorreporting(printingregisters,topofstack,instructionsnearpc),id0xb]Stack:[0x00002b4811ad5000,0x00007fff99bde000],sp=0x00000000438fad48,freespace=18014352037410967kNativeframes:(J=compiledJavacode,j=interpreted,Vv=VMcode,C=nativecode)C[libcurl.so.3+0x21ca2][erroroccurredduringerrorreporting(printingnativestack),id0xb]---------------PROCESS---------------VMstate:notatsafepoint(normalexecution)VMMutex/Monitorcurrentlyownedbyathread:NoneHeapPSYoungGentotal152896K,used94414K[0x00000000eaab0000,0x00000000f5550000,0x0000000100000000)edenspace131072K,72%used[0x00000000eaab0000,0x00000000f06e38f0,0x00000000f2ab0000)fromspace21824K,0%used[0x00000000f4000000,0x00000000f4000000,0x00000000f5550000)tospace21824K,0%used[0x00000000f2ab0000,0x00000000f2ab0000,0x00000000f4000000)PSOldGentotal349568K,used0K[0x00000000c0000000,0x00000000d5560000,0x00000000eaab0000)objectspace349568K,0%used[0x00000000c0000000,0x00000000c0000000,0x00000000d5560000)PSPermGentotal131072K,used16158K[0x00000000b0000000,0x00000000b8000000,0x00000000c0000000)objectspace131072K,12%used[0x00000000b0000000,0x00000000b0fc7a10,0x00000000b8000000)Dynamiclibraries:40000000-40009000r-xp00000000fd:0033554530/usr/java/jdk1.6.0_23/bin/java40108000-4010a000rwxp00008000fd:0033554530/usr/java/jdk1.6.0_23/bin/java405e5000-405e6000---p405e500000:000405e6000-406e6000rwxp405e600000:000略去.........VMArguments:jvm_args:-Xms512m-Xmx1024m-XX:PermSize=128M-XX:MaxPermSize=256m-Dlog4j.configuration=file:./config/log4j.properties-Djava.ext.dirs=./libjava_command:cn.knet.kx.monitor.site.machine.App-startLauncherType:SUN_STANDARDEnvironmentVariables:JAVA_HOME=/usr/java/jdk1.6.0_23CLASSPATH=.:/usr/java/jdk1.6.0_23/lib/dt.jar:/usr/java/jdk1.6.0_23/lib/tools.jarPATH=/usr/java/jdk1.6.0_23/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/apache/bin:/home/kx_monitor/binSHELL=/bin/bashSignalHandlers:SIGSEGV:[libjvm.so+0x76a860],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGBUS:[libjvm.so+0x76a860],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGFPE:[libjvm.so+0x621870],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGPIPE:[libjvm.so+0x621870],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGXFSZ:[libjvm.so+0x621870],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGILL:[libjvm.so+0x621870],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGUSR1:SIG_DFL,sa_mask[0]=0x00000000,sa_flags=0x00000000SIGUSR2:[libjvm.so+0x624450],sa_mask[0]=0x00000000,sa_flags=0x10000004SIGHUP:[libjvm.so+0x624050],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGINT:SIG_IGN,sa_mask[0]=0x00000000,sa_flags=0x00000000SIGTERM:[libjvm.so+0x624050],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004SIGQUIT:[libjvm.so+0x624050],sa_mask[0]=0x7ffbfeff,sa_flags=0x10000004---------------SYSTEM---------------OS:RedHatEnterpriseLinuxServerrelease5.3(Tikanga)uname:Linux2.6.18-128.el5#1SMPWedDec1711:41:38EST2008x86_64libc:glibc2.5NPTL2.5rlimit:STACKinfinity,CORE0k,NPROC268288,NOFILE65535,ASinfinityloadaverage:0.070.030.01/proc/meminfo:MemTotal:32950012kBMemFree:26245316kBBuffers:191892kBCached:4575968kBSwapCached:0kBActive:2425692kBInactive:4001500kBHighTotal:0kBHighFree:0kBLowTotal:32950012kBLowFree:26245316kBSwapTotal:34996216kBSwapFree:34996216kBDirty:188kBWriteback:0kBAnonPages:1659260kBMapped:124168kBSlab:203896kBPageTables:16740kBNFS_Unstable:0kBBounce:0kBCommitLimit:51471220kBCommitted_AS:5603664kBVmallocTotal:34359738367kBVmallocUsed:280396kBVmallocChunk:34359456683kBHugePages_Total:0HugePages_Free:0HugePages_Rsvd:0Hugepagesize:2048kBCPU:total24(6corespercpu,2threadspercore)family6model44stepping2,cmov,cx8,fxsr,mmx,sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,htMemory:4kpage,physical32950012k(26245316kfree),swap34996216k(34996216kfree)vm_info:JavaHotSpot(TM)64-BitServerVM(19.0-b09)forlinux-amd64JRE(1.6.0_23-b05),builtonNov12201014:12:21by"java_re"withgcc3.2.2(SuSELinux)time:FriJul2216:32:532011elapsedtime:338seconds

时间: 2024-09-27 13:06:25

Java通过JNI调用libcurl导致JVM崩溃的相关文章

Java通过JNI调用C语言的方法

JAVA以其跨平台的特性深受人们喜爱,而又正由于它的跨平台的目的,使得它和本地机器的各种内部联系变得很少,约束了它的功能. 解决JAVA对本地操作的一种方法就是JNI. JAVA通过JNI调用本地方法,而本地方法是以库文件的形式存放的(在WINDOWS平台上是DLL文件形式,在UNIX机器上是SO文件形式).通过调用本地的库文件的内部方法,使JAVA可以实现和本地机器的紧密联系,调用系统级的各接口方法. 简单介绍及应用如下: 一.JAVA中所需要做的工作 在JAVA程序中,首先需要在类中声明所调

java用jni调用下面C++,如何传参取值

问题描述 java用jni调用下面C++,如何传参取值 #include <iostream> #include <afx.h> #include <tchar.h> #include <ctime> #include<winsock.h> unsigned char posmstkey[9]={0x12,0x23,0x35,0x56,0x55,0x33,0x98,0x11}; char starC[56],starD[56],starK[17]

linux java 通过jni调用 中文出现乱码

问题描述 linuxjava通过jni调用传递字符串到c++,或是从c++传递到java,中文出现乱码系统的编码如下:-bash-3.2$vim/etc/sysconfig/i18n1LANG="en_US"2SUPPORTED="en_US:en"3SYSFONT="lat0-sun16"4SYSFONTACM="iso01"在网上查了些资料,windows下的可以解决了,调用size=WideCharToMultiByte

求救,java通过JNI调用C++ dll

问题描述 环境:win7+VS2008+eclipse问题:java调用release的dll中的一个函数第三次时出错,前两次都正常,第三次调用时Java代码进入调用dll中该函数的地方编辑器就死掉了,只能强制停止才能结束调试,没有报任何错误,dll也没反馈任何值.vs附加进行方式调试,每次都能正常运行注:在三次调用该函数时,dll的其它函数也被调用,没有出现什么异常.环境:server2003+eclipse同样的代码,dll为release版,第一次调用报错,重新调用就会正常代码无法往外考,

Java通过JNI调用C++程序

JNI是Java Native Interface的缩写,中文为JAVA本地调用.使用JNI可以很方便的用我们的Java程序调用C/C++程序.很多时候,某些功能用Java无法 实现,比如说涉及到底层驱动的一些功能,这时候我们就可以利用JNI来调用C或者C++程序来实现,这就是JNI的强大之处.但是JNI也有它的缺点,使 用java与本地已编译的代码交互,通常会丧失平台可移植性. 下面是一个JNI例子,调用C++输出"hello world":   第一步:创建Java类,在里面定义一

关于Java使用JNI调用C++动态库进行回调的问题

问题描述 最近需要学习JNI去调用C++动态链接库,所以写了个小实例试下JAVA调用C++库中的回调问题.代码如下JAVA层代码packagezm.com;publicclassLog{/***@paramargs*/static{//System.loadLibrary("JniLib");System.load("C:\VC_TEST\JniLib\Debug\JniLib.dll");}publicvoidoutput(Stringout){System.ou

java 通过jni调用c#dll ,抛出异常

问题描述 ##AfatalerrorhasbeendetectedbytheJavaRuntimeEnvironment:##InternalError(0xe0434352),pid=8256,tid=6488##JREversion:7.0_13-b20#JavaVM:JavaHotSpot(TM)ClientVM(23.7-b01mixedmode,sharingwindows-x86)#Problematicframe:#C[KERNELBASE.dll+0xc6e3]RaiseExce

jni调用java方法报错!!!

问题描述 jni调用java方法报错!!! 12-04 11:33:08.818: A/art(23825): art/runtime/check_jni.cc:70] JNI DETECTED ERROR IN APPLICATION: calling static method java.lang.String com.library.utils.MD5Utils.md5(java.lang.String) with CallObjectMethod 12-04 11:33:08.818:

JAVA中JNI的简单使用分享_java

了解JNI:JAVA因其跨平台特性而受人们喜爱,也正因此,使得它和本机各种内部联系变得很少,所以JNI(Java Native Interface)就是用来解决JAVA本地操作的一种方式.JAVA通过JNI调用本地方法,而本地方法是以库文件的形式存放的(在WINDOWS平台上是DLL文件形式,在UNIX机器上是SO文件形式).通过调用本地的库文件的内部方法,使JAVA可以实现和本地机器的紧密联系,调用系统级的各接口方法. 步骤如下: 1.写好.java源文件: 复制代码 代码如下: packag