Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8258396: SIGILL in jdk.jfr.internal.PlatformRecorder.rotateDisk()
Browse files Browse the repository at this point in the history
Backport-of: e85892bfe243bdba6ca22f8756fdda7486baefc2
  • Loading branch information
Ekaterina Vergizova committed Apr 21, 2021
1 parent dc56503 commit 1fc6729
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp
Expand Up @@ -405,7 +405,7 @@ BufferPtr JfrStorage::flush(BufferPtr cur, size_t used, size_t req, bool native,

BufferPtr JfrStorage::flush_regular(BufferPtr cur, const u1* const cur_pos, size_t used, size_t req, bool native, Thread* t) {
debug_only(assert_flush_regular_precondition(cur, cur_pos, used, req, t);)
// A flush is needed before memcpy since a non-large buffer is thread stable
// A flush is needed before memmove since a non-large buffer is thread stable
// (thread local). The flush will not modify memory in addresses above pos()
// which is where the "used / uncommitted" data resides. It is therefore both
// possible and valid to migrate data after the flush. This is however only
Expand All @@ -417,7 +417,8 @@ BufferPtr JfrStorage::flush_regular(BufferPtr cur, const u1* const cur_pos, size
if (cur->free_size() >= req) {
// simplest case, no switching of buffers
if (used > 0) {
memcpy(cur->pos(), (void*)cur_pos, used);
// source and destination may overlap so memmove must be used instead of memcpy
memmove(cur->pos(), (void*)cur_pos, used);
}
assert(native ? t->jfr_thread_local()->native_buffer() == cur : t->jfr_thread_local()->java_buffer() == cur, "invariant");
return cur;
Expand Down

1 comment on commit 1fc6729

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.