Skip to content

Commit e58448b

Browse files
author
Ichiroh Takiguchi
committed
8287362: FieldAccessWatch testcase failed on AIX platform
Backport-of: 66340372d595aeb4b3dfd9169a8448f363097256
1 parent 9a55a87 commit e58448b

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

test/hotspot/jtreg/compiler/jsr292/cr8026328/libTest8026328.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ Agent_OnLoad(JavaVM* vm,
101101
void* reserved) {
102102

103103
jvmtiCapabilities capa;
104-
jvmtiEventCallbacks cbs = {0};
104+
jvmtiEventCallbacks cbs;
105105

106106
(*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_1_0);
107107

@@ -110,6 +110,7 @@ Agent_OnLoad(JavaVM* vm,
110110
capa.can_generate_single_step_events = 1;
111111
(*jvmti)->AddCapabilities(jvmti, &capa);
112112

113+
memset(&cbs, 0, sizeof(cbs));
113114
cbs.ClassPrepare = classprepare;
114115
cbs.Breakpoint = breakpoint;
115116
(*jvmti)->SetEventCallbacks(jvmti, &cbs, sizeof(cbs));

test/hotspot/jtreg/runtime/jni/FastGetField/libFastGetField.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 SAP SE and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2022 SAP SE and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -119,14 +119,15 @@ static void JNICALL onFieldAccess(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread
119119

120120
JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm, char* options, void* reserved) {
121121
jvmtiCapabilities capa;
122-
jvmtiEventCallbacks cbs = {0};
122+
jvmtiEventCallbacks cbs;
123123

124124
(*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_1_0);
125125

126126
memset(&capa, 0, sizeof(capa));
127127
capa.can_generate_field_access_events = 1;
128128
(*jvmti)->AddCapabilities(jvmti, &capa);
129129

130+
memset(&cbs, 0, sizeof(cbs));
130131
cbs.FieldAccess = &onFieldAccess;
131132
(*jvmti)->SetEventCallbacks(jvmti, &cbs, sizeof(cbs));
132133
(*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, JVMTI_EVENT_FIELD_ACCESS, NULL);

test/hotspot/jtreg/serviceability/jvmti/FieldAccessWatch/libFieldAccessWatch.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -214,14 +214,15 @@ JNIEXPORT jint JNICALL
214214
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved)
215215
{
216216
jvmtiError err;
217-
jvmtiCapabilities caps = {0};
218-
jvmtiEventCallbacks callbacks = {0};
217+
jvmtiCapabilities caps;
218+
jvmtiEventCallbacks callbacks;
219219
jint res = (*jvm)->GetEnv(jvm, (void **) &jvmti, JVMTI_VERSION_1_1);
220220
if (res != JNI_OK || jvmti == NULL) {
221221
reportError("GetEnv failed", res);
222222
return JNI_ERR;
223223
}
224224

225+
memset(&caps, 0, sizeof(caps));
225226
caps.can_generate_field_modification_events = 1;
226227
caps.can_generate_field_access_events = 1;
227228
caps.can_tag_objects = 1;
@@ -231,6 +232,7 @@ Agent_OnLoad(JavaVM *jvm, char *options, void *reserved)
231232
return JNI_ERR;
232233
}
233234

235+
memset(&callbacks, 0, sizeof(callbacks));
234236
callbacks.FieldModification = &onFieldModification;
235237
callbacks.FieldAccess = &onFieldAccess;
236238

test/hotspot/jtreg/serviceability/jvmti/GetClassMethods/libOverpassMethods.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,8 @@ JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved) {
4545

4646
if (options != NULL && strcmp(options, "maintain_original_method_order") == 0) {
4747
printf("Enabled capability: maintain_original_method_order\n");
48-
jvmtiCapabilities caps = {};
48+
jvmtiCapabilities caps;
49+
memset(&caps, 0, sizeof(caps));
4950
caps.can_maintain_original_method_order = 1;
5051

5152
jvmtiError err = jvmti->AddCapabilities(&caps);

0 commit comments

Comments
 (0)