JDK bug:ciObjectFactory::create_new_metadata:原因完全解析

文章目录

    • 1、问题
    • 2.详细日志
    • 2.关键日志
    • 3.结论
    • 4.JDK:bug
      • 最终bug链接:
    • 京东遇到过类似bug
    • 各位大佬如果有更详细的解答可以留言。

1、问题

服务不通,接口404,查看日志有一下截图,还有一个更详细的日志
日志截图

2.详细日志

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f49157f4067, pid=17437, tid=0x00007f48b8ffe700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x438067]  ciObjectFactory::create_new_metadata(Metadata*)+0x327
#
# 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
#

---------------  T H R E A D  ---------------

Current thread (0x00007f4910806800):  JavaThread "C1 CompilerThread3" daemon [_thread_in_vm, id=17480, stack(0x00007f48b8efe000,0x00007f48b8fff000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000013

Registers:
RAX=0x000000000000000b, RBX=0x000000000000008a, RCX=0x00000037800182a0, RDX=0x00007f48b8ffea20
RSP=0x00007f48b8ffc300, RBP=0x00007f48b8ffc370, RSI=0x00007f48e0c25ce8, RDI=0x00007f48e0c25ce8
R8 =0x0000000000000089, R9 =0x00007f491638e200, R10=0x0000000000000000, R11=0x000000377f75a290
R12=0x00007f48e0c25ce8, R13=0x00007f48a9ad7240, R14=0x00007f4910806800, R15=0x00007f48a9ad7240
RIP=0x00007f49157f4067, EFLAGS=0x0000000000010202, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007f48b8ffc300)
0x00007f48b8ffc300:   00007f48a8853080 00007f48b8ffc420
0x00007f48b8ffc310:   00007f48a88513d0 00007f48b8ffd9f0
0x00007f48b8ffc320:   00007f4910008660 00007f49106c4150
0x00007f48b8ffc330:   0000000000000001 00007f48b8ffc400
0x00007f48b8ffc340:   00007f4910806800 000000000000008a
0x00007f48b8ffc350:   00007f48e0c25ce8 00007f48a9ad7240
0x00007f48b8ffc360:   000000000000008a 00007f48a88c38b0
0x00007f48b8ffc370:   00007f48b8ffc3b0 00007f49157f4495
0x00007f48b8ffc380:   00007f48b8ffc3c0 0000000000000000
0x00007f48b8ffc390:   00007f48e0c25ce8 0000000000000000
0x00007f48b8ffc3a0:   00007f491633aaa0 00007f48a88c38b0
0x00007f48b8ffc3b0:   00007f48b8ffc3f0 00007f49157ec167
0x00007f48b8ffc3c0:   0000000000000010 00007f48a88c38b0
0x00007f48b8ffc3d0:   00007f48a8853260 00007f48b94c5c60
0x00007f48b8ffc3e0:   00007f48b8ffc400 00007f48b94c5b30
0x00007f48b8ffc3f0:   00007f48b8ffc530 00007f49157ec478
0x00007f48b8ffc400:   00007f48e0a801c0 00007f48a88532b0
0x00007f48b8ffc410:   00000001000ef3e0 00007f48a88532b0
0x00007f48b8ffc420:   00007f4910806800 00007f48a9ad7240
0x00007f48b8ffc430:   00007f48b8ffc4b0 00007f49157f3dd5
0x00007f48b8ffc440:   00007f48a8852f20 00007f491633aaa0
0x00007f48b8ffc450:   00007f48b8ffc510 00007f48e0bca418
0x00007f48b8ffc460:   00007f48b8ffc4e0 00007f49157e22ce
0x00007f48b8ffc470:   00007f48b8ffc500 00007f48b8ffd9f0
0x00007f48b8ffc480:   00007f48a8852fe0 000000000000006f
0x00007f48b8ffc490:   00000001000ef3e0 00007f48a9ad7240
0x00007f48b8ffc4a0:   0000000000000089 00007f48a9f10ca0
0x00007f48b8ffc4b0:   00007f48b8ffc4f0 00007f49157f44ab
0x00007f48b8ffc4c0:   00007f48b8ffc4e0 0000000000000003
0x00007f48b8ffc4d0:   00000001000ef3e0 0000000000000003
0x00007f48b8ffc4e0:   0000000000000003 00007f48a88532b0
0x00007f48b8ffc4f0:   00007f48b8ffc530 00007f49157ef062 

Instructions: (pc=0x00007f49157f4067)
0x00007f49157f4047:   83 c6 08 39 c7 7c e2 44 8d 48 ff 45 89 08 e9 7b
0x00007f49157f4057:   fd ff ff 66 0f 1f 44 00 00 49 8b 04 24 4c 89 e7
0x00007f49157f4067:   ff 50 08 84 c0 0f 84 05 fd ff ff 41 8b 44 24 08
0x00007f49157f4077:   85 c0 0f 8e f8 fc ff ff 41 f6 84 24 0e 01 00 00 

Register to memory mapping:

RAX=0x000000000000000b is an unknown value
RBX=0x000000000000008a is an unknown value
RCX=0x00000037800182a0: <offset 0x2182a0> in /lib64/libpthread.so.0 at 0x000000377fe00000
RDX=0x00007f48b8ffea20 is pointing into the stack for thread: 0x00007f4910806800
RSP=0x00007f48b8ffc300 is pointing into the stack for thread: 0x00007f4910806800
RBP=0x00007f48b8ffc370 is pointing into the stack for thread: 0x00007f4910806800
RSI=0x00007f48e0c25ce8 is pointing into metadata
RDI=0x00007f48e0c25ce8 is pointing into metadata
R8 =0x0000000000000089 is an unknown value
R9 =0x00007f491638e200: <offset 0xfd2200> in /opt/soft/java/jre/lib/amd64/server/libjvm.so at 0x00007f49153bc000
R10=0x0000000000000000 is an unknown value
R11=0x000000377f75a290: <offset 0x15a290> in /lib64/libc.so.6 at 0x000000377f600000
R12=0x00007f48e0c25ce8 is pointing into metadata
R13=0x00007f48a9ad7240 is an unknown value
R14=0x00007f4910806800 is a thread
R15=0x00007f48a9ad7240 is an unknown value


Stack: [0x00007f48b8efe000,0x00007f48b8fff000],  sp=0x00007f48b8ffc300,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x438067]  ciObjectFactory::create_new_metadata(Metadata*)+0x327
V  [libjvm.so+0x438495]  ciObjectFactory::get_metadata(Metadata*)+0x85
V  [libjvm.so+0x430167]  ciSpeculativeTrapData::translate_from(ProfileData const*)+0x67
V  [libjvm.so+0x430478]  ciMethodData::load_extra_data()+0xa8
V  [libjvm.so+0x4325e8]  ciMethodData::load_data()+0x268
V  [libjvm.so+0x424b17]  ciMethod::ensure_method_data(methodHandle)+0xa7
V  [libjvm.so+0x425d67]  ciMethod::ensure_method_data()+0xa7
V  [libjvm.so+0x370e65]  GraphBuilder::try_inline_full(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x545
V  [libjvm.so+0x36d2cf]  GraphBuilder::try_inline(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x11f
V  [libjvm.so+0x36e412]  GraphBuilder::invoke(Bytecodes::Code)+0xbc2
V  [libjvm.so+0x36ed8d]  GraphBuilder::iterate_bytecodes_for_block(int)+0x6ad
V  [libjvm.so+0x37091b]  GraphBuilder::iterate_all_blocks(bool)+0x14b
V  [libjvm.so+0x3712b6]  GraphBuilder::try_inline_full(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x996
V  [libjvm.so+0x36d2cf]  GraphBuilder::try_inline(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x11f
V  [libjvm.so+0x36e412]  GraphBuilder::invoke(Bytecodes::Code)+0xbc2
V  [libjvm.so+0x36ed8d]  GraphBuilder::iterate_bytecodes_for_block(int)+0x6ad
V  [libjvm.so+0x37091b]  GraphBuilder::iterate_all_blocks(bool)+0x14b
V  [libjvm.so+0x3712b6]  GraphBuilder::try_inline_full(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x996
V  [libjvm.so+0x36d2cf]  GraphBuilder::try_inline(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x11f
V  [libjvm.so+0x36e412]  GraphBuilder::invoke(Bytecodes::Code)+0xbc2
V  [libjvm.so+0x36ed8d]  GraphBuilder::iterate_bytecodes_for_block(int)+0x6ad
V  [libjvm.so+0x37091b]  GraphBuilder::iterate_all_blocks(bool)+0x14b
V  [libjvm.so+0x3712b6]  GraphBuilder::try_inline_full(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x996
V  [libjvm.so+0x36d2cf]  GraphBuilder::try_inline(ciMethod*, bool, Bytecodes::Code, Instruction*)+0x11f
V  [libjvm.so+0x36e412]  GraphBuilder::invoke(Bytecodes::Code)+0xbc2
V  [libjvm.so+0x36ed8d]  GraphBuilder::iterate_bytecodes_for_block(int)+0x6ad
V  [libjvm.so+0x3708c2]  GraphBuilder::iterate_all_blocks(bool)+0xf2
V  [libjvm.so+0x3724e7]  GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x527
V  [libjvm.so+0x37a817]  IRScope::IRScope(Compilation*, IRScope*, int, ciMethod*, int, bool)+0x1e7
V  [libjvm.so+0x37a92f]  IR::IR(Compilation*, ciMethod*, int)+0x9f
V  [libjvm.so+0x358edb]  Compilation::build_hir()+0xdb
V  [libjvm.so+0x35929e]  Compilation::compile_java_method()+0x6e
V  [libjvm.so+0x3593ce]  Compilation::compile_method()+0x4e
V  [libjvm.so+0x35973e]  Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*)+0x25e
V  [libjvm.so+0x35a4e9]  Compiler::compile_method(ciEnv*, ciMethod*, int)+0xa9
V  [libjvm.so+0x4aea9a]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc9a
V  [libjvm.so+0x4afa46]  CompileBroker::compiler_thread_loop()+0x5d6
V  [libjvm.so+0xa6cc5f]  JavaThread::thread_main_inner()+0xdf
V  [libjvm.so+0xa6cd8c]  JavaThread::run()+0x11c
V  [libjvm.so+0x91fad8]  java_start(Thread*)+0x108
C  [libpthread.so.0+0x79d1]


**Current CompileTask:
C1: 319967 19019   !   3       com.mysql.jdbc.Buffer::readString (121 bytes)**


---------------  P R O C E S S  --------------

2.关键日志

1、SIGSEGV (0xb) at pc=0x00007f49157f4067, pid=17437, tid=0x00007f48b8ffe700:中断异常信号量
2、Problematic frame: V [libjvm.so+0x438067] ciObjectFactory::create_new_metadata(Metadata*)+0x327:表示发生的c方法
3、Current thread (0x00007f4910806800): JavaThread “C1 CompilerThread3” daemon [_thread_in_vm, id=17480, stack(0x00007f48b8efe000,0x00007f48b8fff000)]:详细日志中发现当前任务线程:C1 CompilerThread3
4、Current CompileTask:
C1: 319967 19019 ! 3 com.mysql.jdbc.Buffer::readString (121 bytes):详细日志中发现当前任务线程当前任务

3.结论

C1编译器】通过线程【C1 CompilerThread3】JIT优化热点方法【com.mysql.jdbc.Buffer::readString】代码时,在调用【libjvm.so】中的代码【ciObjectFactory::create_new_metadata】方法时,【试图访问未分配给自己的内存, 或试图往没有写权限的内存地址写数据】,导致的崩溃

4.JDK:bug

直接去搜索关键字:create_new_metadata,出现一下内容
oracle-bug截图

最终bug链接:

https://bugs.java.com/bugdatabase/view_bug?bug_id=8156137
解释:
I tested with a fix for _previous_version_count, but put in an artificial delay for classes to move from the previous versions list to the deallocate list (simulating on_stack metadata), and I was able to get the same crash, so this is evidence that JDK-8164692 is a separate (but contributing) bug. I’m testing my proposed fix, which is to process previous versions in Klass::clean_weak_klass_links().
翻译:
InstanceKlass::_previous_version_count的问题可能是根本原因。 如果计数错误,则ClassLoaderDataGraph::do_unloading()可能会跳过调用InstanceKlass::purge_previous_versions(),从而允许ClassLoaderDataGraphKlassIteratorAtomic和G1ConcurrentMark看到这些临时类。
InstanceKlass::_previous_version_count计数错误的一个bug,导致G1ConcurrentMark能调用临时类。

京东遇到过类似bug

链接地址:https://zhuanlan.zhihu.com/p/665260001
很巧合的都是在C1编译jdbc驱动的场景出现的
Current CompileTask:
C1: 319967 19019 ! 3 com.mysql.jdbc.Buffer::readString (121 bytes)
京东:Current CompileTask:
C2:43781461 13331 ! 4 com.mysql.cj.NativeSession::execSQL (579 bytes)

各位大佬如果有更详细的解答可以留言。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/259162.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Missing artifact org.wltea.analyzer:ik-analyzer:jar:5.0

没有找到【org.wltea.analyzer】 找到了【org.wltea.ik-analyzer】 https://github.com/wks/ik-analyzer https://github.com/wks/ik-analyzer.git https://code.google.com/archive/p/ik-analyzer/downloads?page2 C:\Users\Administrator\Desktop\ik-analyzer-master>m…

java实现回文数算法

判断一个数是否为回文数可以使用以下算法&#xff1a; 将数字转化为字符串&#xff1b;初始化左右两个指针&#xff0c;分别指向字符串的首尾&#xff1b;循环比较左右指针指向的字符&#xff0c;如果相等则继续比较&#xff0c;直到左右指针相遇或者发现不相等的字符为止&…

《opencv实用探索·二十一》人脸识别

Haar级联分类器 在OpenCV中主要使用了两种特征&#xff08;即两种方法&#xff09;进行人脸检测&#xff0c;Haar特征和LBP特征。用的最多的是Haar特征人脸检测。 Haar级联分类器是一种用于目标检测的机器学习方法&#xff0c;它是一种基于机器学习的特征选择方法&#xff0c;…

【halcon深度学习】create_dl_model_detection

基本介绍 create_dl_model_detection 不是一个封装的库函数&#xff0c;是一个算子。用于创建用于目标检测或实例分割任务的深度学习模型。 输入参数&#xff1a; Backbone (input_control): 指定用作背骨网络的深度学习分类器&#xff0c;充当模型的基础。用户可以选择不同的…

python+pytest接口自动化之测试函数、测试类/测试方法的封装

前言 今天呢&#xff0c;笔者想和大家聊聊pythonpytest接口自动化中将代码进行封装&#xff0c;只有将测试代码进行封装&#xff0c;才能被测试框架识别执行。 例如单个接口的请求代码如下&#xff1a; import requestsheaders {"user-agent": "Mozilla/5.0…

国标28181平台只能连接视频监控吗?

在一些视频监控项目中&#xff0c;国标28181平台成为了必不可少的工具。这个平台的主要作用在于将分布在不同区域的视频监控录像机、摄像头等设备进行联网管理&#xff0c;同时还能将视频监控连接到上一级的国标监控平台。 可以说&#xff0c;国标监控平台是一个非常重要的承上…

【QT】解决QTableView修改合并单元格内容无法修改到合并范围内的单元格

问题:修改合并单元格的内容 修改合并单元格的内容时,希望直接修改到合并范围内的单元格,Qt没有实现这个功能,需要自己写出 Delegate来实现 方案:Delegate class EditDelegate : public QStyledItemDelegate {public:EditDelegate(QTableView *view): tableView(view){}pu…

【Spring Security】让你的项目更加安全的框架

&#x1f389;&#x1f389;欢迎来到我的CSDN主页&#xff01;&#x1f389;&#x1f389; &#x1f3c5;我是Java方文山&#xff0c;一个在CSDN分享笔记的博主。&#x1f4da;&#x1f4da; &#x1f31f;推荐给大家我的专栏《MyBatis-Plus》。&#x1f3af;&#x1f3af; &am…

【halcon深度学习之那些封装好的库函数】determine_dl_model_detection_param

determine_dl_model_detection_param 目标检测的数据准备过程中的有一个库函数determine_dl_model_detection_param “determine_dl_model_detection_param” 直译为 “确定深度学习模型检测参数”。 这个过程会自动针对给定数据集估算模型的某些高级参数&#xff0c;强烈建议…

kafka offset sasl加密连接

kafka-tool&#xff08;offset&#xff09; 进行SCRAM连接&#xff0c;直接上图 填写jaas的认证&#xff08;账密 引用包&#xff09;

【Java】网络编程-UDP字典服务器客户端简单代码编写

上文讲了UDP回响服务器客户端简单代码编写 本文将讲述UDP字典服务器客户端简单代码编写。所谓回显&#xff0c;就是指客户端向服务器发送一个报文&#xff0c;从服务器那里得到一条一模一样的回响报文 而我们的字典功能呢&#xff0c;则是实现了输入中文&#xff0c;得到对应…

力扣 面试经典150算法题

1合并两个有序数组88. 合并两个有序数组-CSDN博客简单23

Backend - Django 项目创建 运行

目录 一、配置环境 二、创建 Django 项目 &#xff08;一&#xff09;新建文件夹 &#xff08;二&#xff09;打开文件夹 &#xff08;三&#xff09;打开运行终端 &#xff08;四&#xff09;创建基础项目 &#xff08;五&#xff09;创建app 1. 安装Django &#xf…

分析某款go扫描器之四

一、概述 上文提到实现IP的探测存活以及tcp扫描的实现&#xff0c;这部分来分析实现本机网卡信息获取&#xff0c;以及维护一张mac地址表以及ip扫描端口状态表&#xff0c;同时实现syn扫描功能。 项目来源&#xff1a;https://github.com/XinRoom/go-portScan/blob/main/util…

PY32F072片内闪存读写 HAL库

我这个hal库底层是一次写一页&#xff0c;擦除也是以页为单位的。这个芯片太偏了&#xff0c;有点小恶心。 flash.c uint8_t flash_read(uint32_t add) {uint8_t temp;temp *(__IO uint8_t *)(add);return temp; }void flash_read_buf(uint32_t add, uint8_t *data, uint8_t…

【ICCV 2023】MPI-Flow:什么,只需要单张图片就能训练光流估计模型了?

ICCV 2023 | MPI-Flow&#xff1a;从单视角构建的多平面图像中学习光流 引言&#xff1a;主要贡献&#xff1a;Motivation&#xff1a;算法细节&#xff1a;Optical Flow Data GenerationIndependent Object MotionsDepth-Aware Inpainting 实验结果&#xff1a; 来源&#xff…

Python实现多元线性回归模型信用卡客户价值预测项目源码+数据+项目设计报告

多元线性回归——信用卡客户价值预测 一、背景 这里以信用卡客户的客户价值为例来解释客户价值预测的具体含义&#xff1a; 客户价值预测就是指预测客户在未来一段时间内能带来多少利润&#xff0c;其利润可能来自信用卡的年费、取现手续费、分期手续费、境外交易手续费等。分…

《C++ Primer》第13章 拷贝控制(三)

参考资料&#xff1a; 《C Primer》第5版《C Primer 习题集》第5版 13.5 动态内存管理类&#xff08;P464&#xff09; 某些类需要在运行时分配可变大小的内存空间。这种类通常可以用使用标准库容器来保存它们的数据。有些时候&#xff0c;我们希望类自己进行内存分配&#…

TypeScript【泛型1、泛型2、声明合并、命名空间 、模块1、模块2、声明文件简介】(五)-全面详解(学习总结---从入门到深化)

文章目录 泛型1 泛型2 声明合并 命名空间 模块1 模块2 声明文件简介 泛型1 泛型&#xff08;Generics&#xff09;是指在定义函数、接口或类的时候&#xff0c;不预先指定具体的类型&#xff0c;而在使用的时候再指定类型的一种特性 首先&#xff0c;我们来实现一个函数…

小黑南京归来,参加部里的公务员培训,有点儿社死认识了好多小伙伴的leetcode之旅13. 罗马数字转整数

小黑代码 class Solution:def romanToInt(self, s: str) -> int:chars [M, CM, D, CD, C, XC, L, XL, X, IX, V, IV,I]nums [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]map_ dict((k, v) for k,v in zip(chars, nums))# 字符串长度n len(s)# 结果变量res …
最新文章