Skip to content
Permalink
Browse files
8245019: lworld] SIGSEGV in BufferBlob::buffered value type due to in…
…struction memory corruption
  • Loading branch information
TobiHartmann committed May 20, 2020
1 parent 9a5e8f3 commit e8894bd7d8690f8232664ac6eebe2b2045430571
Showing 2 changed files with 5 additions and 5 deletions.
@@ -242,8 +242,8 @@ BufferBlob* BufferBlob::create(const char* name, int buffer_size) {
}


BufferBlob::BufferBlob(const char* name, int size, CodeBuffer* cb)
: RuntimeBlob(name, cb, sizeof(BufferBlob), size, CodeOffsets::frame_never_safe, 0, NULL)
BufferBlob::BufferBlob(const char* name, int header_size, int size, CodeBuffer* cb)
: RuntimeBlob(name, cb, header_size, size, CodeOffsets::frame_never_safe, 0, NULL)
{}

BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
@@ -254,7 +254,7 @@ BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
assert(name != NULL, "must provide a name");
{
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
blob = new (size) BufferBlob(name, size, cb);
blob = new (size) BufferBlob(name, sizeof(BufferBlob), size, cb);
}
// Track memory usage statistic after releasing CodeCache_lock
MemoryService::track_code_cache_memory_usage();
@@ -356,7 +356,7 @@ MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {
//----------------------------------------------------------------------------------------------------
// Implementation of BufferedValueTypeBlob
BufferedValueTypeBlob::BufferedValueTypeBlob(int size, CodeBuffer* cb, int pack_fields_off, int pack_fields_jobject_off, int unpack_fields_off) :
BufferBlob("buffered value type", size, cb),
BufferBlob("buffered value type", sizeof(BufferedValueTypeBlob), size, cb),
_pack_fields_off(pack_fields_off),
_pack_fields_jobject_off(pack_fields_jobject_off),
_unpack_fields_off(unpack_fields_off) {
@@ -402,7 +402,7 @@ class BufferBlob: public RuntimeBlob {
private:
// Creation support
BufferBlob(const char* name, int size);
BufferBlob(const char* name, int size, CodeBuffer* cb);
BufferBlob(const char* name, int header_size, int size, CodeBuffer* cb);
BufferBlob(const char* name, int size, CodeBuffer* cb, int frame_complete, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments = false);

// This ordinary operator delete is needed even though not used, so the

0 comments on commit e8894bd

Please sign in to comment.