openjdk17 jvm加载class文件,解析字段和方法,C++源码展示

##构造方法ClassFileParser,parse_stream解析文件流

ClassFileParser::ClassFileParser(ClassFileStream* stream,Symbol* name,ClassLoaderData* loader_data,const ClassLoadInfo* cl_info,Publicity pub_level,TRAPS) :_stream(stream),_class_name(NULL),_loader_data(loader_data),_is_hidden(cl_info->is_hidden()),_can_access_vm_annotations(cl_info->can_access_vm_annotations()),_orig_cp_size(0),_super_klass(),_cp(NULL),_fields(NULL),_methods(NULL),_inner_classes(NULL),_nest_members(NULL),_nest_host(0),_permitted_subclasses(NULL),_record_components(NULL),_local_interfaces(NULL),_transitive_interfaces(NULL),_combined_annotations(NULL),_class_annotations(NULL),_class_type_annotations(NULL),_fields_annotations(NULL),_fields_type_annotations(NULL),_klass(NULL),_klass_to_deallocate(NULL),_parsed_annotations(NULL),_fac(NULL),_field_info(NULL),_method_ordering(NULL),_all_mirandas(NULL),_vtable_size(0),_itable_size(0),_num_miranda_methods(0),_rt(REF_NONE),_protection_domain(cl_info->protection_domain()),_access_flags(),_pub_level(pub_level),_bad_constant_seen(0),_synthetic_flag(false),_sde_length(false),_sde_buffer(NULL),_sourcefile_index(0),_generic_signature_index(0),_major_version(0),_minor_version(0),_this_class_index(0),_super_class_index(0),_itfs_len(0),_java_fields_count(0),_need_verify(false),_relax_verify(false),_has_nonstatic_concrete_methods(false),_declares_nonstatic_concrete_methods(false),_has_final_method(false),_has_contended_fields(false),_has_finalizer(false),_has_empty_finalizer(false),_has_vanilla_constructor(false),_max_bootstrap_specifier_index(-1) {_class_name = name != NULL ? name : vmSymbols::unknown_class_name();_class_name->increment_refcount();assert(_loader_data != NULL, "invariant");assert(stream != NULL, "invariant");assert(_stream != NULL, "invariant");assert(_stream->buffer() == _stream->current(), "invariant");assert(_class_name != NULL, "invariant");assert(0 == _access_flags.as_int(), "invariant");// Figure out whether we can skip format checking (matching classic VM behavior)if (DumpSharedSpaces) {// verify == true means it's a 'remote' class (i.e., non-boot class)// Verification decision is based on BytecodeVerificationRemote flag// for those classes._need_verify = (stream->need_verify()) ? BytecodeVerificationRemote :BytecodeVerificationLocal;}else {_need_verify = Verifier::should_verify_for(_loader_data->class_loader(),stream->need_verify());}// synch back verification state to streamstream->set_verify(_need_verify);// Check if verification needs to be relaxed for this class file// Do not restrict it to jdk1.0 or jdk1.1 to maintain backward compatibility (4982376)_relax_verify = relax_format_check_for(_loader_data);parse_stream(stream, CHECK);post_process_parsed_stream(stream, _cp, CHECK);
}

 ##parse_stream方法

void ClassFileParser::parse_stream(const ClassFileStream* const stream,TRAPS) {assert(stream != NULL, "invariant");assert(_class_name != NULL, "invariant");// BEGIN STREAM PARSINGstream->guarantee_more(8, CHECK);  // magic, major, minor// Magic valueconst u4 magic = stream->get_u4_fast();guarantee_property(magic == JAVA_CLASSFILE_MAGIC,"Incompatible magic value %u in class file %s",magic, CHECK);// Version numbers_minor_version = stream->get_u2_fast();_major_version = stream->get_u2_fast();// Check version numbers - we check this even with verifier offverify_class_version(_major_version, _minor_version, _class_name, CHECK);stream->guarantee_more(3, CHECK); // length, first cp tagu2 cp_size = stream->get_u2_fast();guarantee_property(cp_size >= 1, "Illegal constant pool size %u in class file %s",cp_size, CHECK);_orig_cp_size = cp_size;if (is_hidden()) { // Add a slot for hidden class name.cp_size++;}_cp = ConstantPool::allocate(_loader_data,cp_size,CHECK);ConstantPool* const cp = _cp;parse_constant_pool(stream, cp, _orig_cp_size, CHECK);assert(cp_size == (const u2)cp->length(), "invariant");// ACCESS FLAGSstream->guarantee_more(8, CHECK);  // flags, this_class, super_class, infs_len// Access flagsjint flags;// JVM_ACC_MODULE is defined in JDK-9 and later.if (_major_version >= JAVA_9_VERSION) {flags = stream->get_u2_fast() & (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_MODULE);} else {flags = stream->get_u2_fast() & JVM_RECOGNIZED_CLASS_MODIFIERS;}if ((flags & JVM_ACC_INTERFACE) && _major_version < JAVA_6_VERSION) {// Set abstract bit for old class files for backward compatibilityflags |= JVM_ACC_ABSTRACT;}verify_legal_class_modifiers(flags, CHECK);short bad_constant = class_bad_constant_seen();if (bad_constant != 0) {// Do not throw CFE until after the access_flags are checked because if// ACC_MODULE is set in the access flags, then NCDFE must be thrown, not CFE.classfile_parse_error("Unknown constant tag %u in class file %s", bad_constant, THREAD);return;}_access_flags.set_flags(flags);// This class and superclass_this_class_index = stream->get_u2_fast();check_property(valid_cp_range(_this_class_index, cp_size) &&cp->tag_at(_this_class_index).is_unresolved_klass(),"Invalid this class index %u in constant pool in class file %s",_this_class_index, CHECK);Symbol* const class_name_in_cp = cp->klass_name_at(_this_class_index);assert(class_name_in_cp != NULL, "class_name can't be null");// Don't need to check whether this class name is legal or not.// It has been checked when constant pool is parsed.// However, make sure it is not an array type.if (_need_verify) {guarantee_property(class_name_in_cp->char_at(0) != JVM_SIGNATURE_ARRAY,"Bad class name in class file %s",CHECK);}#ifdef ASSERT// Basic sanity checksif (_is_hidden) {assert(_class_name != vmSymbols::unknown_class_name(), "hidden classes should have a special name");}
#endif// Update the _class_name as needed depending on whether this is a named, un-named, or hidden class.if (_is_hidden) {assert(_class_name != NULL, "Unexpected null _class_name");
#ifdef ASSERTif (_need_verify) {verify_legal_class_name(_class_name, CHECK);}
#endif} else {// Check if name in class file matches given nameif (_class_name != class_name_in_cp) {if (_class_name != vmSymbols::unknown_class_name()) {ResourceMark rm(THREAD);Exceptions::fthrow(THREAD_AND_LOCATION,vmSymbols::java_lang_NoClassDefFoundError(),"%s (wrong name: %s)",class_name_in_cp->as_C_string(),_class_name->as_C_string());return;} else {// The class name was not known by the caller so we set it from// the value in the CP.update_class_name(class_name_in_cp);}// else nothing to do: the expected class name matches what is in the CP}}// Verification prevents us from creating names with dots in them, this// asserts that that's the case.assert(is_internal_format(_class_name), "external class name format used internally");if (!is_internal()) {LogTarget(Debug, class, preorder) lt;if (lt.is_enabled()){ResourceMark rm(THREAD);LogStream ls(lt);ls.print("%s", _class_name->as_klass_external_name());if (stream->source() != NULL) {ls.print(" source: %s", stream->source());}ls.cr();}}// SUPERKLASS_super_class_index = stream->get_u2_fast();_super_klass = parse_super_class(cp,_super_class_index,_need_verify,CHECK);// Interfaces_itfs_len = stream->get_u2_fast();parse_interfaces(stream,_itfs_len,cp,&_has_nonstatic_concrete_methods,CHECK);assert(_local_interfaces != NULL, "invariant");// Fields (offsets are filled in later)_fac = new FieldAllocationCount();parse_fields(stream,_access_flags.is_interface(),_fac,cp,cp_size,&_java_fields_count,CHECK);assert(_fields != NULL, "invariant");// MethodsAccessFlags promoted_flags;parse_methods(stream,_access_flags.is_interface(),&promoted_flags,&_has_final_method,&_declares_nonstatic_concrete_methods,CHECK);assert(_methods != NULL, "invariant");// promote flags from parse_methods() to the klass' flags_access_flags.add_promoted_flags(promoted_flags.as_int());if (_declares_nonstatic_concrete_methods) {_has_nonstatic_concrete_methods = true;}// Additional attributes/annotations_parsed_annotations = new ClassAnnotationCollector();parse_classfile_attributes(stream, cp, _parsed_annotations, CHECK);assert(_inner_classes != NULL, "invariant");// Finalize the Annotations metadata object,// now that all annotation arrays have been created.create_combined_annotations(CHECK);// Make sure this is the end of class file streamguarantee_property(stream->at_eos(),"Extra bytes at the end of class file %s",CHECK);// all bytes in stream read and parsed
}

##parse_fields解析class文件字段

// Side-effects: populates the _fields, _fields_annotations,
// _fields_type_annotations fields
void ClassFileParser::parse_fields(const ClassFileStream* const cfs,bool is_interface,FieldAllocationCount* const fac,ConstantPool* cp,const int cp_size,u2* const java_fields_count_ptr,TRAPS) {assert(cfs != NULL, "invariant");assert(fac != NULL, "invariant");assert(cp != NULL, "invariant");assert(java_fields_count_ptr != NULL, "invariant");assert(NULL == _fields, "invariant");assert(NULL == _fields_annotations, "invariant");assert(NULL == _fields_type_annotations, "invariant");cfs->guarantee_more(2, CHECK);  // lengthconst u2 length = cfs->get_u2_fast();*java_fields_count_ptr = length;int num_injected = 0;const InjectedField* const injected = JavaClasses::get_injected(_class_name,&num_injected);const int total_fields = length + num_injected;// The field array starts with tuples of shorts// [access, name index, sig index, initial value index, byte offset].// A generic signature slot only exists for field with generic// signature attribute. And the access flag is set with// JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE for that field. The generic// signature slots are at the end of the field array and after all// other fields data.////   f1: [access, name index, sig index, initial value index, low_offset, high_offset]//   f2: [access, name index, sig index, initial value index, low_offset, high_offset]//       ...//   fn: [access, name index, sig index, initial value index, low_offset, high_offset]//       [generic signature index]//       [generic signature index]//       ...//// Allocate a temporary resource array for field data. For each field,// a slot is reserved in the temporary array for the generic signature// index. After parsing all fields, the data are copied to a permanent// array and any unused slots will be discarded.ResourceMark rm(THREAD);u2* const fa = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD,u2,total_fields * (FieldInfo::field_slots + 1));// The generic signature slots start after all other fields' data.int generic_signature_slot = total_fields * FieldInfo::field_slots;int num_generic_signature = 0;for (int n = 0; n < length; n++) {// access_flags, name_index, descriptor_index, attributes_countcfs->guarantee_more(8, CHECK);AccessFlags access_flags;const jint flags = cfs->get_u2_fast() & JVM_RECOGNIZED_FIELD_MODIFIERS;verify_legal_field_modifiers(flags, is_interface, CHECK);access_flags.set_flags(flags);const u2 name_index = cfs->get_u2_fast();check_property(valid_symbol_at(name_index),"Invalid constant pool index %u for field name in class file %s",name_index, CHECK);const Symbol* const name = cp->symbol_at(name_index);verify_legal_field_name(name, CHECK);const u2 signature_index = cfs->get_u2_fast();check_property(valid_symbol_at(signature_index),"Invalid constant pool index %u for field signature in class file %s",signature_index, CHECK);const Symbol* const sig = cp->symbol_at(signature_index);verify_legal_field_signature(name, sig, CHECK);u2 constantvalue_index = 0;bool is_synthetic = false;u2 generic_signature_index = 0;const bool is_static = access_flags.is_static();FieldAnnotationCollector parsed_annotations(_loader_data);const u2 attributes_count = cfs->get_u2_fast();if (attributes_count > 0) {parse_field_attributes(cfs,attributes_count,is_static,signature_index,&constantvalue_index,&is_synthetic,&generic_signature_index,&parsed_annotations,CHECK);if (parsed_annotations.field_annotations() != NULL) {if (_fields_annotations == NULL) {_fields_annotations = MetadataFactory::new_array<AnnotationArray*>(_loader_data, length, NULL,CHECK);}_fields_annotations->at_put(n, parsed_annotations.field_annotations());parsed_annotations.set_field_annotations(NULL);}if (parsed_annotations.field_type_annotations() != NULL) {if (_fields_type_annotations == NULL) {_fields_type_annotations =MetadataFactory::new_array<AnnotationArray*>(_loader_data,length,NULL,CHECK);}_fields_type_annotations->at_put(n, parsed_annotations.field_type_annotations());parsed_annotations.set_field_type_annotations(NULL);}if (is_synthetic) {access_flags.set_is_synthetic();}if (generic_signature_index != 0) {access_flags.set_field_has_generic_signature();fa[generic_signature_slot] = generic_signature_index;generic_signature_slot ++;num_generic_signature ++;}}FieldInfo* const field = FieldInfo::from_field_array(fa, n);field->initialize(access_flags.as_short(),name_index,signature_index,constantvalue_index);const BasicType type = cp->basic_type_for_signature_at(signature_index);// Update FieldAllocationCount for this kind of fieldfac->update(is_static, type);// After field is initialized with type, we can augment it with aux infoif (parsed_annotations.has_any_annotations()) {parsed_annotations.apply_to(field);if (field->is_contended()) {_has_contended_fields = true;}}}int index = length;if (num_injected != 0) {for (int n = 0; n < num_injected; n++) {// Check for duplicatesif (injected[n].may_be_java) {const Symbol* const name      = injected[n].name();const Symbol* const signature = injected[n].signature();bool duplicate = false;for (int i = 0; i < length; i++) {const FieldInfo* const f = FieldInfo::from_field_array(fa, i);if (name      == cp->symbol_at(f->name_index()) &&signature == cp->symbol_at(f->signature_index())) {// Symbol is desclared in Java so skip this oneduplicate = true;break;}}if (duplicate) {// These will be removed from the field array at the endcontinue;}}// Injected fieldFieldInfo* const field = FieldInfo::from_field_array(fa, index);field->initialize((u2)JVM_ACC_FIELD_INTERNAL,(u2)(injected[n].name_index),(u2)(injected[n].signature_index),0);const BasicType type = Signature::basic_type(injected[n].signature());// Update FieldAllocationCount for this kind of fieldfac->update(false, type);index++;}}assert(NULL == _fields, "invariant");_fields =MetadataFactory::new_array<u2>(_loader_data,index * FieldInfo::field_slots + num_generic_signature,CHECK);// Sometimes injected fields already exist in the Java source so// the fields array could be too long.  In that case the// fields array is trimed. Also unused slots that were reserved// for generic signature indexes are discarded.{int i = 0;for (; i < index * FieldInfo::field_slots; i++) {_fields->at_put(i, fa[i]);}for (int j = total_fields * FieldInfo::field_slots;j < generic_signature_slot; j++) {_fields->at_put(i++, fa[j]);}assert(_fields->length() == i, "");}if (_need_verify && length > 1) {// Check duplicated fieldsResourceMark rm(THREAD);NameSigHash** names_and_sigs = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, NameSigHash*, HASH_ROW_SIZE);initialize_hashtable(names_and_sigs);bool dup = false;const Symbol* name = NULL;const Symbol* sig = NULL;{debug_only(NoSafepointVerifier nsv;)for (AllFieldStream fs(_fields, cp); !fs.done(); fs.next()) {name = fs.name();sig = fs.signature();// If no duplicates, add name/signature in hashtable names_and_sigs.if (!put_after_lookup(name, sig, names_and_sigs)) {dup = true;break;}}}if (dup) {classfile_parse_error("Duplicate field name \"%s\" with signature \"%s\" in class file %s",name->as_C_string(), sig->as_klass_external_name(), THREAD);}}
}

##parse_methods解析class文件方法

// The promoted_flags parameter is used to pass relevant access_flags
// from the methods back up to the containing klass. These flag values
// are added to klass's access_flags.
// Side-effects: populates the _methods field in the parser
void ClassFileParser::parse_methods(const ClassFileStream* const cfs,bool is_interface,AccessFlags* promoted_flags,bool* has_final_method,bool* declares_nonstatic_concrete_methods,TRAPS) {assert(cfs != NULL, "invariant");assert(promoted_flags != NULL, "invariant");assert(has_final_method != NULL, "invariant");assert(declares_nonstatic_concrete_methods != NULL, "invariant");assert(NULL == _methods, "invariant");cfs->guarantee_more(2, CHECK);  // lengthconst u2 length = cfs->get_u2_fast();if (length == 0) {_methods = Universe::the_empty_method_array();} else {_methods = MetadataFactory::new_array<Method*>(_loader_data,length,NULL,CHECK);for (int index = 0; index < length; index++) {Method* method = parse_method(cfs,is_interface,_cp,promoted_flags,CHECK);if (method->is_final()) {*has_final_method = true;}// declares_nonstatic_concrete_methods: declares concrete instance methods, any access flags// used for interface initialization, and default method inheritance analysisif (is_interface && !(*declares_nonstatic_concrete_methods)&& !method->is_abstract() && !method->is_static()) {*declares_nonstatic_concrete_methods = true;}_methods->at_put(index, method);}if (_need_verify && length > 1) {// Check duplicated methodsResourceMark rm(THREAD);NameSigHash** names_and_sigs = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, NameSigHash*, HASH_ROW_SIZE);initialize_hashtable(names_and_sigs);bool dup = false;const Symbol* name = NULL;const Symbol* sig = NULL;{debug_only(NoSafepointVerifier nsv;)for (int i = 0; i < length; i++) {const Method* const m = _methods->at(i);name = m->name();sig = m->signature();// If no duplicates, add name/signature in hashtable names_and_sigs.if (!put_after_lookup(name, sig, names_and_sigs)) {dup = true;break;}}}if (dup) {classfile_parse_error("Duplicate method name \"%s\" with signature \"%s\" in class file %s",name->as_C_string(), sig->as_klass_external_name(), THREAD);}}}
}

##gdb调试堆栈,解析方法

#0  ClassFileParser::parse_methods (this=0x7ffff7bfddd0, cfs=0x7ffff0034bd0, is_interface=false, promoted_flags=0x7ffff7bfdb50, has_final_method=0x7ffff7bfdf6c,declares_nonstatic_concrete_methods=0x7ffff7bfdf6b, __the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classFileParser.cpp:2861
#1  0x00007ffff5fc2976 in ClassFileParser::parse_stream (this=0x7ffff7bfddd0, stream=0x7ffff0034bd0, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classFileParser.cpp:5859
#2  0x00007ffff5fc179d in ClassFileParser::ClassFileParser (this=0x7ffff7bfddd0, stream=0x7ffff0034bd0, name=0x7fffe04980f0, loader_data=0x7ffff00c61a0, cl_info=0x7ffff7bfe000,pub_level=ClassFileParser::BROADCAST, __the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classFileParser.cpp:5590
#3  0x00007ffff66337a3 in KlassFactory::create_from_stream (stream=0x7ffff0034bd0, name=0x7fffe04980f0, loader_data=0x7ffff00c61a0, cl_info=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/klassFactory.cpp:199
#4  0x00007ffff5fd2471 in ClassLoader::load_class (name=0x7fffe04980f0, search_append_only=false, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classLoader.cpp:1222
#5  0x00007ffff6b1066e in SystemDictionary::load_instance_class_impl (class_name=0x7fffe04980f0, class_loader=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:1290
#6  0x00007ffff6b10a49 in SystemDictionary::load_instance_class (name_hash=1549954608, name=0x7fffe04980f0, class_loader=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:1356
#7  0x00007ffff6b0eb11 in SystemDictionary::resolve_instance_class_or_null (name=0x7fffe04980f0, class_loader=..., protection_domain=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:724
#8  0x00007ffff6b0d696 in SystemDictionary::resolve_instance_class_or_null_helper (class_name=0x7fffe04980f0, class_loader=..., protection_domain=...,__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:295
#9  0x00007ffff6b0d53c in SystemDictionary::resolve_or_null (class_name=0x7fffe04980f0, class_loader=..., protection_domain=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:278
#10 0x00007ffff6b0d47f in SystemDictionary::resolve_or_fail (class_name=0x7fffe04980f0, class_loader=..., protection_domain=..., throw_error=true, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:264
#11 0x00007ffff5da8a1a in SystemDictionary::resolve_or_fail (class_name=0x7fffe04980f0, throw_error=true, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.hpp:100
#12 0x00007ffff6bf725e in vmClasses::resolve (id=vmClassID::Object_klass_knum, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.cpp:99
#13 0x00007ffff6bf735c in vmClasses::resolve_until (limit_id=vmClassID::Cloneable_klass_knum, start_id=@0x7ffff7bfe8f0: vmClassID::Object_klass_knum,__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.cpp:108
#14 0x00007ffff6bf7d60 in vmClasses::resolve_through (last_id=vmClassID::Class_klass_knum, start_id=@0x7ffff7bfe8f0: vmClassID::Object_klass_knum, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.hpp:64
#15 0x00007ffff6bf7508 in vmClasses::resolve_all (__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.cpp:151
#16 0x00007ffff6b1190a in SystemDictionary::initialize (__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:1654
#17 0x00007ffff6b968a1 in Universe::genesis (__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/memory/universe.cpp:335
#18 0x00007ffff6b98cf9 in universe2_init () at /home/yym/openjdk17/jdk17-master/src/hotspot/share/memory/universe.cpp:928
#19 0x00007ffff633fec5 in init_globals () at /home/yym/openjdk17/jdk17-master/src/hotspot/share/runtime/init.cpp:134
#20 0x00007ffff6b60ccb in Threads::create_vm (args=0x7ffff7bfed50, canTryAgain=0x7ffff7bfec5b) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/runtime/thread.cpp:2852
#21 0x00007ffff644f659 in JNI_CreateJavaVM_inner (vm=0x7ffff7bfeda8, penv=0x7ffff7bfedb0, args=0x7ffff7bfed50)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/prims/jni.cpp:3621
#22 0x00007ffff644f9a5 in JNI_CreateJavaVM (vm=0x7ffff7bfeda8, penv=0x7ffff7bfedb0, args=0x7ffff7bfed50) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/prims/jni.cpp:3709
#23 0x00007ffff7facd29 in InitializeJVM (pvm=0x7ffff7bfeda8, penv=0x7ffff7bfedb0, ifn=0x7ffff7bfee00)at /home/yym/openjdk17/jdk17-master/src/java.base/share/native/libjli/java.c:1541
#24 0x00007ffff7fa9623 in JavaMain (_args=0x7fffffffaee0) at /home/yym/openjdk17/jdk17-master/src/java.base/share/native/libjli/java.c:415
#25 0x00007ffff7fb08ab in ThreadJavaMain (args=0x7fffffffaee0) at /home/yym/openjdk17/jdk17-master/src/java.base/unix/native/libjli/java_md.c:651
#26 0x00007ffff7c94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#27 0x00007ffff7d26850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

##gdb调试堆栈,解析字段

#0  ClassFileParser::parse_fields (this=0x7ffff7bfde10, cfs=0x7ffff0039190, is_interface=false, fac=0x7ffff00391d0, cp=0x7fffd98e3838, cp_size=743,java_fields_count_ptr=0x7ffff7bfdfa6, __the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classFileParser.cpp:1578
#1  0x00007ffff5fc289c in ClassFileParser::parse_stream (this=0x7ffff7bfde10, stream=0x7ffff0039190, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classFileParser.cpp:5847
#2  0x00007ffff5fc179d in ClassFileParser::ClassFileParser (this=0x7ffff7bfde10, stream=0x7ffff0039190, name=0x7fffe0498890, loader_data=0x7ffff00c61a0, cl_info=0x7ffff7bfe040,pub_level=ClassFileParser::BROADCAST, __the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classFileParser.cpp:5590
#3  0x00007ffff66337a3 in KlassFactory::create_from_stream (stream=0x7ffff0039190, name=0x7fffe0498890, loader_data=0x7ffff00c61a0, cl_info=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/klassFactory.cpp:199
#4  0x00007ffff5fd2471 in ClassLoader::load_class (name=0x7fffe0498890, search_append_only=false, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/classLoader.cpp:1222
#5  0x00007ffff6b1066e in SystemDictionary::load_instance_class_impl (class_name=0x7fffe0498890, class_loader=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:1290
#6  0x00007ffff6b10a49 in SystemDictionary::load_instance_class (name_hash=1078158816, name=0x7fffe0498890, class_loader=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:1356
#7  0x00007ffff6b0eb11 in SystemDictionary::resolve_instance_class_or_null (name=0x7fffe0498890, class_loader=..., protection_domain=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:724
#8  0x00007ffff6b0d696 in SystemDictionary::resolve_instance_class_or_null_helper (class_name=0x7fffe0498890, class_loader=..., protection_domain=...,__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:295
#9  0x00007ffff6b0d53c in SystemDictionary::resolve_or_null (class_name=0x7fffe0498890, class_loader=..., protection_domain=..., __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:278
#10 0x00007ffff6b0d47f in SystemDictionary::resolve_or_fail (class_name=0x7fffe0498890, class_loader=..., protection_domain=..., throw_error=true, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:264
#11 0x00007ffff5da8a1a in SystemDictionary::resolve_or_fail (class_name=0x7fffe0498890, throw_error=true, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.hpp:100
#12 0x00007ffff6bf725e in vmClasses::resolve (id=vmClassID::URL_klass_knum, __the_thread__=0x7ffff00289b0)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.cpp:99
#13 0x00007ffff6bf735c in vmClasses::resolve_until (limit_id=vmClassID::LIMIT, start_id=@0x7ffff7bfe8f0: vmClassID::AssertionStatusDirectives_klass_knum,__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.cpp:108
#14 0x00007ffff6bf7707 in vmClasses::resolve_all (__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/vmClasses.cpp:192
#15 0x00007ffff6b1190a in SystemDictionary::initialize (__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/classfile/systemDictionary.cpp:1654
#16 0x00007ffff6b968a1 in Universe::genesis (__the_thread__=0x7ffff00289b0) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/memory/universe.cpp:335
#17 0x00007ffff6b98cf9 in universe2_init () at /home/yym/openjdk17/jdk17-master/src/hotspot/share/memory/universe.cpp:928
#18 0x00007ffff633fec5 in init_globals () at /home/yym/openjdk17/jdk17-master/src/hotspot/share/runtime/init.cpp:134
#19 0x00007ffff6b60ccb in Threads::create_vm (args=0x7ffff7bfed50, canTryAgain=0x7ffff7bfec5b) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/runtime/thread.cpp:2852
#20 0x00007ffff644f659 in JNI_CreateJavaVM_inner (vm=0x7ffff7bfeda8, penv=0x7ffff7bfedb0, args=0x7ffff7bfed50)at /home/yym/openjdk17/jdk17-master/src/hotspot/share/prims/jni.cpp:3621
#21 0x00007ffff644f9a5 in JNI_CreateJavaVM (vm=0x7ffff7bfeda8, penv=0x7ffff7bfedb0, args=0x7ffff7bfed50) at /home/yym/openjdk17/jdk17-master/src/hotspot/share/prims/jni.cpp:3709
#22 0x00007ffff7facd29 in InitializeJVM (pvm=0x7ffff7bfeda8, penv=0x7ffff7bfedb0, ifn=0x7ffff7bfee00)at /home/yym/openjdk17/jdk17-master/src/java.base/share/native/libjli/java.c:1541
#23 0x00007ffff7fa9623 in JavaMain (_args=0x7fffffffaee0) at /home/yym/openjdk17/jdk17-master/src/java.base/share/native/libjli/java.c:415
#24 0x00007ffff7fb08ab in ThreadJavaMain (args=0x7fffffffaee0) at /home/yym/openjdk17/jdk17-master/src/java.base/unix/native/libjli/java_md.c:651
#25 0x00007ffff7c94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#26 0x00007ffff7d26850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

蓝桥杯我来了

最近蓝桥杯报名快要截止了&#xff0c;我们学校开始收费了&#xff0c;我们学校没有校赛&#xff0c;一旦报名缴费就是省赛&#xff0c;虽然一早就在官网上报名了&#xff0c;但是一直在纠结&#xff0c;和家人沟通&#xff0c;和朋友交流&#xff0c;其实只是想寻求外界的支持…

Nginx 缓存那些事儿:原理、配置和最佳实践

Nginx 缓存那些事儿&#xff1a;原理、配置和最佳实践 在当今的互联网世界&#xff0c;网站的访问量和数据处理量不断攀升&#xff0c;如何确保用户能够快速、稳定地访问我们的网站&#xff0c;已经成为每个运维工程师面临的挑战。幸运的是&#xff0c;Nginx 作为一款高性能的…

【智体OS】官方上新发布智体电视:基于rtpc和rttouchpad实现智体电视的手机遥控-可安装任意PC应用用于智体电视

【智体OS】官方上新发布智体电视&#xff1a;基于rtpc和rttouchpad实现智体电视的手机遥控-可安装任意PC应用用于智体电视 dtns.network是一款主要由JavaScript编写的智体世界引擎&#xff08;内嵌了three.js编辑器的定制版-支持以第一视角浏览3D场馆&#xff09;&#xff0c;…

ES(elasticsearch)整合Spring boot使用实例

1.1通过docker安装es详细教程参考 docker部署elasticsearch(内涵集群部署的compose文件)-CSDN博客 2.1创建MySQL数据库&#xff0c;通过sql命令进行表的创建与数据的写入&#xff08;sql命令如下&#xff09; /*Navicat Premium Data TransferSource Server : localSo…

GitHub使用

太久不用GitHub发现自己又有些不会了&#xff0c;突发奇想为何不把每次看到的有指导意义的博客收录一下以便下次查阅呢 如何上传文件夹到GitHub上&#xff08;配图详解&#xff09;&#xff1f;_github上傳資料夾-CSDN博客 github上如何删除自己的仓库_github删除仓库-CSDN博…

单独测试 pyautogui 的鼠标点击功能,确保它能够在当前环境中正常工作,鼠标自动点击的录制回放功能

感谢您提供的详细日志信息。根据您的反馈&#xff0c;问题可能出在 pyautogui 没有正确获取鼠标焦点或无法在预期的位置执行点击操作。我们将采取以下步骤来进一步诊断和解决这个问题&#xff1a; 1. **确保 pyautogui 正确执行点击操作**&#xff1a; - 我们将添加更多的调…

保姆级教学 uniapp绘制二维码海报并保存至相册,真机正常展示图片二维码

一、获取二维码 uni.request({url: https://api.weixin.qq.com/wxa/getwxacode?access_token${getStorage("token")},responseType: "arraybuffer",method: "POST",data: {path: "/pages/index/index"},success(res) {// 转换为 Uint…

coco数据集转换SAM2格式

coco是一个大json汇总了所有train的标签 SAM2训练一张图对应一个json标签 import json import os from pycocotools import mask as mask_utils import numpy as np import cv2def poly2mask(points, width, height):points_array np.array(points, dtypenp.int32).reshape(-…

Vue.createApp的对象参数

目录 template 属性 data 属性 methods 属性 疑问 function 函数的两种写法 methods 属性中 this 的指向 总结 Vue 实例是通过 Vue.createApp() 创建的&#xff0c;该函数需要接收一个对象作为参数&#xff0c;该对象可添加 template、data、methods 等属性。 template …

LLM大语言模型私有化部署-OpenEuler22.03SP3上容器化部署Ollama与OpenWebUI

背景 你是不是也有私有化部署大模型的需求&#xff1f;如今有了 Ollama &#xff0c; HuggingFace &#xff0c; ModelScope 等开源平台&#xff0c;我们可以非常方便地搭建一个属于自己的大模型&#xff0c;如果网速给力&#xff0c;真是分分钟~~。简单起见&#xff0c;这篇文…

使用字典进行动态编程

在你的程序中&#xff0c;你想要执行各种计算&#xff0c;例如计算卫星的总数。 此外&#xff0c;当你进行更高级的编程时&#xff0c;你可能会发现你需要从文件或数据库中加载此类信息&#xff0c;而不是直接编码到 Python 中。 为了帮助支持这些场景&#xff0c;Python 使你…

Linux——rootfs根文件系统构建

根文件系统也叫做rootfs FATFS这类的文件系统属于Linux内核的一部分&#xff0c;属于软件代码&#xff0c;所以ROOTFS不等于FATFS。 Linux的根文件系统实际上是一个文件夹或者叫目录&#xff0c;这个目录下会有许多子目录&#xff0c;这些目录中存放许多Linux运行所必须的文件…

go语言的成神之路-标准库篇-os标准库

一、权限 在操作系统&#xff08;OS&#xff09;中&#xff0c;标准库的权限管理是非常重要的&#xff0c;它确保了不同用户和进程能够安全地访问系统资源。以下是一些常见的权限概念和说明&#xff1a; 1.用户权限 用户ID&#xff08;UID&#xff09;&#xff1a;每个用户在…

linux 生成 nginx 的https ssl 证书详解

证书生成 1. 生成证书 会提示输入密码&#xff0c;输入两次相同密码即可。 openssl genrsa -des3 -out server.key 20482. 去除密码校验 如果想去除此输密码的步骤&#xff0c;可以执行如下命令&#xff0c;根据使用需求选择。 openssl rsa -in server.key -out server.ke…

LabVIEW实现MQTT通信

目录 1、MQTT通信原理 2、硬件环境部署 3、云端环境部署 4、程序架构 5、前面板设计 6、程序框图设计 7、测试验证 本专栏以LabVIEW为开发平台,讲解物联网通信组网原理与开发方法,覆盖RS232、TCP、MQTT、蓝牙、Wi-Fi、NB-IoT等协议。 结合实际案例,展示如何利用LabVIEW和常用…

【OpenCV】直方图

理论 可以将直方图视为图形或曲线图&#xff0c;从而使您对图像的强度分布有一个整体的了解。它是在X轴上具有像素值(不总是从0到255的范围)&#xff0c;在Y轴上具有图像中相应像素数的图。 这只是理解图像的另一种方式。通过查看图像的直方图&#xff0c;您可以直观地了解该…

【PlantUML系列】用例图(三)

目录 一、组成部分 二、典型案例 一、组成部分 参与者&#xff08;Actors&#xff09;&#xff1a;使用关键字 actor 后跟参与者的名称。用例&#xff08;Use Cases&#xff09;&#xff1a;使用关键字 usecase 后跟用例的名称和编号&#xff08;可选&#xff09;。系统边界…

Transformer部分知识点解释

传统Transformer 经典QKV算法 Transformer架构的优势与问题 万能模型&#xff0c;直接套用&#xff0c;代码实现简单&#xff0c;现成例子一大片并行的&#xff0c;比LSTM快&#xff0c;全局信息丰富&#xff0c;注意力机制效果好长序列中attention需要每一个点跟其他点计算(…

docker-compose 之 禅道(zentao) 社区版

docker-compose 关于 zentao 的配置片段如下所示&#xff1a; 镜像使用的官方镜像&#xff1a;https://hub.docker.com/r/easysoft/zentao zentao: image: easysoft/zentao:21.2container_name: zentaoports: - "8088:80"- "23306:3306"environment:TZ: A…

聚类及Python下实现 K-means 算法

聚类 聚类是无监督学习中的一种重要方法&#xff0c;旨在将数据集中相似的数据对象划分到同一个簇中&#xff0c;使得不同簇之间的数据对象差异尽可能大。在大数据环境下&#xff0c;聚类可以帮助挖掘数据中的隐藏结构和模式&#xff0c;应用场景十分广泛&#xff0c;比如在客…