8381899: Assertions and crashes in aot/cds tests on Linux Alpine

Reviewed-by: adinn
This commit is contained in:
Vladimir Kozlov 2026-04-10 17:11:33 +00:00
parent 701d0cb3a2
commit a3309eb665

View File

@ -1093,11 +1093,13 @@ bool AOTCodeCache::store_code_blob(CodeBlob& blob, AOTCodeEntry::Kind entry_kind
// now we have added all the other data we can write details of any
// extra the AOT relocations
bool write_ok;
bool write_ok = true;
if (AOTCodeEntry::is_multi_stub_blob(entry_kind)) {
CodeSection* cs = code_buffer->code_section(CodeBuffer::SECT_INSTS);
RelocIterator iter(cs);
write_ok = cache->write_relocations(blob, iter);
if (reloc_count > 0) {
CodeSection* cs = code_buffer->code_section(CodeBuffer::SECT_INSTS);
RelocIterator iter(cs);
write_ok = cache->write_relocations(blob, iter);
}
} else {
RelocIterator iter(&blob);
write_ok = cache->write_relocations(blob, iter);
@ -1403,13 +1405,15 @@ void AOTCodeReader::restore(CodeBlob* code_blob) {
// reinstate the AOT-load time relocs we saved from the code
// buffer that generated this blob in a new code buffer and use
// the latter to iterate over them
CodeBuffer code_buffer(code_blob);
relocInfo* locs = (relocInfo*)_reloc_data;
code_buffer.insts()->initialize_shared_locs(locs, _reloc_count);
code_buffer.insts()->set_locs_end(locs + _reloc_count);
CodeSection *cs = code_buffer.code_section(CodeBuffer::SECT_INSTS);
RelocIterator reloc_iter(cs);
fix_relocations(code_blob, reloc_iter);
if (_reloc_count > 0) {
CodeBuffer code_buffer(code_blob);
relocInfo* locs = (relocInfo*)_reloc_data;
code_buffer.insts()->initialize_shared_locs(locs, _reloc_count);
code_buffer.insts()->set_locs_end(locs + _reloc_count);
CodeSection *cs = code_buffer.code_section(CodeBuffer::SECT_INSTS);
RelocIterator reloc_iter(cs);
fix_relocations(code_blob, reloc_iter);
}
} else {
// the AOT-load time relocs will be in the blob's restored relocs
RelocIterator reloc_iter(code_blob);