大家能不能帮忙看一下这份java的错误日志,是关于jni的,跪求帮忙
这里贴不了全部的内容,如果想看全部内容的话可以发给你,大家帮帮忙,具体情况是开一条线程调用时是正常,但是线程越多就越容易出错。
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f7bf46580e6, pid=2343, tid=140170493765376
#
# JRE version: 6.0_31-b04
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.6-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libResizerJni2.so+0x10e6] long double restrict+0x3ba
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x00007f7bf80b6000): JavaThread "Thread-0" [_thread_in_native, id=2357, stack(0x00007f7bfc6d2000,0x00007f7bfc7d3000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00007f7ba9247be2
Registers:
RAX=0x00007f7bb4027409, RBX=0x0000000000000cc0, RCX=0x00000000016dc400, RDX=0x00007f7ba9247be2
RSP=0x00007f7bfc7d12c0, RBP=0x00007f7bfc7d16b0, RSI=0x0000000000000000, RDI=0x00007f7bfc7d13b0
R8 =0x000000000000000f, R9 =0x0000000000000002, R10=0x0000000000000001, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x0000000701ca6500, R14=0x00007f7bfc7d1830, R15=0x00007f7bf80b6000
RIP=0x00007f7bf46580e6, EFLAGS=0x0000000000010206, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007f7bfc7d12c0)
0x00007f7bfc7d12c0: 0000000100000000 037f0f7f00000002
0x00007f7bfc7d12d0: 0000000300000000 0000009400000070
0x00007f7bfc7d12e0: 00000cc000000990 00007f7ba7b691a0
0x00007f7bfc7d12f0: 0000000800000000 00007f7bf4a8cd20
0x00007f7bfc7d1300: 00007f7bf4df7d40 00007f7bf4df7ab0
0x00007f7bfc7d1310: 00007f7bf4df7cd0 00007f7bf4df7bb0
0x00007f7bfc7d1320: 00007f7bf4df7b00 00007f7b00000000
0x00007f7bfc7d1330: 00007f7bb4001a58 00007f7bb40092f0
0x00007f7bfc7d1340: 00007f7bb4008f70 00007f7bb40076e8
0x00007f7bfc7d1350: 0000000000000000 0000000000000000
0x00007f7bfc7d1360: 00007f7bf48a7450 00007f7bf4924e30
0x00007f7bfc7d1370: 00007f7bf48a72a0 00000000f4924f30
0x00007f7bfc7d1380: 0000000000000000 00007f7bf4fff0c0
0x00007f7bfc7d1390: 000000000000007b 0000000000000000
0x00007f7bfc7d13a0: 0000000000000000 00007f7bfc7d1440
0x00007f7bfc7d13b0: 00007f7bfc7d1300 00007f7bb401a090
0x00007f7bfc7d13c0: 0000000000000000 00000036d8a09ba7
0x00007f7bfc7d13d0: 0000006500000000 00007f7bb401d348
0x00007f7bfc7d13e0: 0000007000000094 0000000200000003
0x00007f7bfc7d13f0: 3ff0000000000000 0000000300000008
0x00007f7bfc7d1400: 0000000000000003 00007f7bb401d380
0x00007f7bfc7d1410: 00007f7bb401d740 00007f7bb401d7c8
0x00007f7bfc7d1420: 0000000000000000 0000000000000000
0x00007f7bfc7d1430: 00007f7bb401d850 00007f7bb401a298
0x00007f7bfc7d1440: 0000000000000000 0000000000000000
0x00007f7bfc7d1450: 00007f7bb401a158 00007f7bb401d9e8
0x00007f7bfc7d1460: 0000000000000000 0000000000000000
0x00007f7bfc7d1470: 0000000000000000 0000000000000000
0x00007f7bfc7d1480: 0101010101010101 0101010101010101
0x00007f7bfc7d1490: 0505050505050505 0505050505050505
0x00007f7bfc7d14a0: 0000000000000001 0000000000000000
0x00007f7bfc7d14b0: 0000000000000000 0000000000000000
Instructions: (pc=0x00007f7bf46580e6)
0x00007f7bf46580c6: 48 98 48 03 85 78 ff ff ff 8b 55 a0 8b 4d 98 8d
0x00007f7bf46580d6: 14 11 48 63 d2 48 83 c2 02 48 03 95 38 fc ff ff
0x00007f7bf46580e6: 0f b6 12 0f b6 d2 89 95 20 fc ff ff db 85 20 fc
0x00007f7bf46580f6: ff ff db 6d c0 de c9 8b 55 a4 8b 4d 98 8d 14 11
Register to memory mapping:
RAX=0x00007f7bb4027409 is an unknown value
RBX=0x0000000000000cc0 is an unknown value
RCX=0x00000000016dc400 is an unknown value
RDX=0x00007f7ba9247be2 is an unknown value
RSP=0x00007f7bfc7d12c0 is pointing into the stack for thread: 0x00007f7bf80b6000
RBP=0x00007f7bfc7d16b0 is pointing into the stack for thread: 0x00007f7bf80b6000
RSI=0x0000000000000000 is an unknown value
RDI=0x00007f7bfc7d13b0 is pointing into the stack for thread: 0x00007f7bf80b6000
R8 =0x000000000000000f is an unknown value
R9 =0x0000000000000002 is an unknown value
R10=0x0000000000000001 is an unknown value
R11=0x0000000000000000 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000701ca6500 is an oop
{method}
- klass: {other class}
R14=0x00007f7bfc7d1830 is pointing into the stack for thread: 0x00007f7bf80b6000
R15=0x00007f7bf80b6000 is a thread
Stack: [0x00007f7bfc6d2000,0x00007f7bfc7d3000], sp=0x00007f7bfc7d12c0, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libResizerJni2.so+0x10e6] long double restrict+0x3ba
C [libResizerJni2.so+0x1565] Java_com_netease_wgfresizer2_util_Resizer_resizeWidth+0x12a
j com.netease.wgfresizer2.util.Resizer.resizeWidth(Ljava/lang/String;IILjava/lang/String;II)I+0
j com.netease.wgfresizer2.util.Resizer.resizeWidth(Ljava/lang/String;IILjava/lang/String;)I+32
j ResizerThread2.run()V+99
v ~StubRoutines::call_stub
V [libjvm.so+0x4df470] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x1e0
V [libjvm.so+0x70f729] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle*, JavaCallArguments*, Thread*), JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x19
V [libjvm.so+0x4dedb6] JavaCalls::call_virtual(JavaValue*, KlassHandle, symbolHandle, symbolHandle, JavaCallArguments*, Thread*)+0x126
V [libjvm.so+0x4dee67] JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, symbolHandle, symbolHandle, Thread*)+0x47
V [libjvm.so+0x572a60] thread_entry(JavaThread*, Thread*)+0xa0
V [libjvm.so+0x8191f1] JavaThread::run()+0x121
V [libjvm.so+0x710bdf] java_start(Thread*)+0x13f
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.netease.wgfresizer2.util.Resizer.resizeWidth(Ljava/lang/String;IILjava/lang/String;II)I+0
j com.netease.wgfresizer2.util.Resizer.resizeWidth(Ljava/lang/String;IILjava/lang/String;)I+32
j ResizerThread2.run()V+99
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00007f7bf8006800 JavaThread "DestroyJavaVM" [_thread_blocked, id=2344, stack(0x00007f7bfee5a000,0x00007f7bfef5b000)]
0x00007f7bf80bc000 JavaThread "Thread-3" [_thread_in_native, id=2360, stack(0x00007f7bfc3cf000,0x00007f7bfc4d0000)]
0x00007f7bf80ba000 JavaThread "Thread-2" [_thread_in_native, id=2359, stack(0x00007f7bfc4d0000,0x00007f7bfc5d1000)]
0x00007f7bf80b8000 JavaThread "Thread-1" [_thread_in_native, id=2358, stack(0x00007f7bfc5d1000,0x00007f7bfc6d2000)]
=>0x00007f7bf80b6000 JavaThread "Thread-0" [_thread_in_native, id=2357, stack(0x00007f7bfc6d2000,0x00007f7bfc7d3000)]
0x00007f7bf8090000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2355, stack(0x00007f7bfc8d6000,0x00007f7bfc9d7000)]
0x00007f7bf808e000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=2354, stack(0x00007f7bfc9d7000,0x00007f7bfcad8000)]
0x00007f7bf808b000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=2353, stack(0x00007f7bfcad8000,0x00007f7bfcbd9000)]
0x00007f7bf8089000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2352, stack(0x00007f7bfcbd9000,0x00007f7bfccda000)]
0x00007f7bf806d000 JavaThread "Finalizer" daemon [_thread_blocked, id=2351, stack(0x00007f7bfccda000,0x00007f7bfcddb000)]
0x00007f7bf806b000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2350, stack(0x00007f7bfcddb000,0x00007f7bfcedc000)]
Other Threads:
0x00007f7bf8064000 VMThread [stack: 0x00007f7bfcedc000,0x00007f7bfcfdd000] [id=2349]
0x00007f7bf8093000 WatcherThread [stack: 0x00007f7bfc7d5000,0x00007f7bfc8d6000] [id=2356]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
PSYoungGen total 74432K, used 7657K [0x00000007aceb0000, 0x00000007b21c0000, 0x0000000800000000)
eden space 63808K, 12% used [0x00000007aceb0000,0x00000007ad62a4c0,0x00000007b0d00000)
from space 10624K, 0% used [0x00000007b1760000,0x00000007b1760000,0x00000007b21c0000)
to space 10624K, 0% used [0x00000007b0d00000,0x00000007b0d00000,0x00000007b1760000)
PSOldGen total 170176K, used 0K [0x0000000706c00000, 0x0000000711230000, 0x00000007aceb0000)
object space 170176K, 0% used [0x0000000706c00000,0x0000000706c00000,0x0000000711230000)
PSPermGen total 21248K, used 2733K [0x0000000701a00000, 0x0000000702ec0000, 0x0000000706c00000)
object space 21248K, 12% used [0x0000000701a00000,0x0000000701cab710,0x0000000702ec0000)
Code Cache [0x00007f7bf5000000, 0x00007f7bf5270000, 0x00007f7bf8000000)
total_blobs=175 nmethods=2 adapters=128 free_code_cache=49938240 largest_free_block=11392 jni java 多线程 C语言
[解决办法]
开了多少线程,貌似线程的栈空间不够
设下 stack大小
-----------------来源于网络----------------------
Stack的设定
每个线程都有他自己的Stack。
-Xss
每个线程的Stack大小
Stack的大小限制着线程的数量。如果Stack过大就好导致内存溢漏。-Xss参数决定Stack大小,例如-Xss1024K。如果Stack太小,也会导致Stack溢漏。