最近一段时间,项目组的后端和APP端进行联调的时候,会发现测试服务器的后端服务器会经常莫名其妙地崩溃,最后会生成一份崩溃日志(hs_err_pid.log)。日志的大概信息如下:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=xxxxxxxxxxxxxxxxx, pid=xxxxxxxxxxxxx, tid=xxxxxxxxxxxxxxxxx
#
# JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libresolv.so.2+0x7a91] __libc_res_nquery+0x1c1
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
……
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j java.net.Inet6AddressImpl.lookupAllHostAddr(Ljava/lang/String;)[Ljava/net/InetAddress;+0
j java.net.InetAddress$2.lookupAllHostAddr(Ljava/lang/String;)[Ljava/net/InetAddress;+4
j java.net.InetAddress.getAddressesFromNameService(Ljava/lang/String;Ljava/net/InetAddress;)[Ljava/net/InetAddress;+51
J 20054 C1 java.net.InetAddress.getAllByName0(Ljava/lang/String;Ljava/net/InetAddress;Z)[Ljava/net/InetAddress; (57 bytes)
J 19009 C1 java.net.InetAddress.getAllByName(Ljava/lang/String;Ljava/net/InetAddress;)[Ljava/net/InetAddress; (387 bytes)
J 19451 C1 java.net.InetSocketAddress.<init>(Ljava/lang/String;I)V (47 bytes)
J 19459 C1 sun.net.NetworkClient.doConnect(Ljava/lang/String;I)Ljava/net/Socket; (176 bytes)
根据日志中的“java.net.Inet6AddressImpl.lookupAllHostAddr”,可以初步怀疑是跟JVM在接收跟IPv6的时候出的错误导致的崩溃。再结合“C [libresolv.so.2+0x7a91] __libc_res_nquery+0x1c1” 这部分日志,可以认为,是 由于JVM的本地方法导致的问题。
libresolv.so.2 是glibc编译后的的库。由此我们可能可以怀疑是由于glibc
未完待续
标签:Ljava,Java,String,java,glibc,InetAddress,崩溃,net From: https://www.cnblogs.com/sitr/p/17100262.html