Skip to content

Commit

Permalink
8313816: Accessing jmethodID might lead to spurious crashes (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbachorik committed Aug 7, 2023
1 parent 90d795a commit 61405d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/actions/do-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ runs:
$build_dir/configure.log \
$build_dir/make-support/failure-summary.log \
$build_dir/make-support/failure-logs/* \
$build_dir/make/hs_err*.log \
failure-logs/ 2> /dev/null || true
echo 'failure=true' >> $GITHUB_OUTPUT
fi
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/share/oops/instanceKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,12 @@ void InstanceKlass::release_C_heap_structures(bool release_sub_metadata) {
jmethodID* jmeths = methods_jmethod_ids_acquire();
if (jmeths != (jmethodID*)nullptr) {
release_set_methods_jmethod_ids(nullptr);
size_t count = (size_t)jmeths[0];
fprintf(stderr, "===> releasing %lu jmethodids\n", count);
// for (size_t i = 1; i <= count; i++) {
// *((Method**)jmeths[i]) = nullptr;
// }
memset(jmeths, 0, count * sizeof(jmethodID));
FreeHeap(jmeths);
}

Expand Down

0 comments on commit 61405d4

Please sign in to comment.