Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRIU: correct type of pool elements in instanceObjects #16548

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion runtime/criusupport/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021, 2022 IBM Corp. and others
Copyright (c) 2021, 2023 IBM Corp. and others

This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -41,6 +41,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<include path="j9oti"/>
<include path="j9util"/>
<include path="j9gcinclude"/>
<include path="$(OMR_DIR)/gc/include" type="relativepath"/>
</includes>

<makefilestubs>
Expand Down
14 changes: 7 additions & 7 deletions runtime/vm/CRIUHelpers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 IBM Corp. and others
* Copyright (c) 2021, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -190,9 +190,9 @@ juRandomReseed(J9VMThread *currentThread, void *userData)
if (-1 != valueOffset) {
PORT_ACCESS_FROM_JAVAVM(vm);
pool_state walkState = {0};
J9Object *objectRecord = (J9Object*)pool_startDo(hookRecord->instanceObjects, &walkState);
j9object_t *objectRecord = (j9object_t*)pool_startDo(hookRecord->instanceObjects, &walkState);
while (NULL != objectRecord) {
j9object_t object = (j9object_t)objectRecord->clazz;
j9object_t object = *objectRecord;
j9object_t seedObject = objectAccessBarrier.inlineMixedObjectReadObject(currentThread, object, seedOffset, FALSE);
I_64 valueLong = objectAccessBarrier.inlineMixedObjectReadI64(currentThread, seedObject, valueOffset, TRUE);

Expand All @@ -201,7 +201,7 @@ juRandomReseed(J9VMThread *currentThread, void *userData)
valueLong ^= j9time_nano_time();
objectAccessBarrier.inlineMixedObjectStoreI64(currentThread, seedObject, valueOffset, valueLong, TRUE);

objectRecord = (J9Object*)pool_nextDo(&walkState);
objectRecord = (j9object_t*)pool_nextDo(&walkState);
}
} else {
Trc_VM_criu_jur_invalid_valueOffset(currentThread, jucaAtomicLongClass);
Expand Down Expand Up @@ -319,19 +319,19 @@ fillinHookRecords(J9VMThread *currentThread, j9object_t object)
|| (hookRecord->includeSubClass && isSameOrSuperClassOf(hookRecord->instanceType, clazz))
) {
if (NULL == hookRecord->instanceObjects) {
hookRecord->instanceObjects = pool_new(sizeof(J9Object), 0, 0, 0, J9_GET_CALLSITE(), OMRMEM_CATEGORY_VM, POOL_FOR_PORT(vm->portLibrary));
hookRecord->instanceObjects = pool_new(sizeof(j9object_t), 0, 0, 0, J9_GET_CALLSITE(), OMRMEM_CATEGORY_VM, POOL_FOR_PORT(vm->portLibrary));
if (NULL == hookRecord->instanceObjects) {
setNativeOutOfMemoryError(currentThread, 0, 0);
result = FALSE;
break;
}
}
J9Object *objectRecord = (J9Object*)pool_newElement(hookRecord->instanceObjects);
j9object_t *objectRecord = (j9object_t*)pool_newElement(hookRecord->instanceObjects);
if (NULL == objectRecord) {
result = FALSE;
setNativeOutOfMemoryError(currentThread, 0, 0);
} else {
objectRecord->clazz = (j9objectclass_t)object;
*objectRecord = object;
}
}

Expand Down