Skip to content

Commit 0b0f8b5

Browse files
varada1110offamitkumar
authored andcommitted
8219652: [aix] Tests failing with JNI attach problems.
Reviewed-by: dholmes, cjplummer, sspitsyn
1 parent 8c0d026 commit 0b0f8b5

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

test/hotspot/jtreg/ProblemList.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ gc/stress/TestStressG1Humongous.java 8286554 windows-x64
9292
# :hotspot_runtime
9393

9494

95-
runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 aix-ppc64
9695
runtime/handshake/HandshakeSuspendExitTest.java 8294313 generic-all
9796
runtime/os/TestTracePageSizes.java#no-options 8267460 linux-aarch64
9897
runtime/os/TestTracePageSizes.java#explicit-large-page-size 8267460 linux-aarch64
@@ -157,9 +156,6 @@ vmTestbase/metaspace/gc/firstGC_99m/TestDescription.java 8208250 generic-all
157156
vmTestbase/metaspace/gc/firstGC_default/TestDescription.java 8208250 generic-all
158157

159158
vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 generic-all
160-
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
161-
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
162-
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
163159
vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 8073470 linux-all
164160
vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/TestDescription.java 8288911 macosx-all
165161

test/hotspot/jtreg/runtime/jni/terminatedThread/libterminatedThread.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2023, 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
@@ -29,6 +29,8 @@
2929

3030
#include "jni.h"
3131

32+
#define STACK_SIZE 0x100000
33+
3234
JavaVM* jvm;
3335
jobject nativeThread;
3436

@@ -79,11 +81,14 @@ Java_TestTerminatedThread_createTerminatedThread
7981
fprintf(stderr, "Test ERROR. Can't extract JavaVM: %d\n", res);
8082
exit(1);
8183
}
82-
83-
if ((res = pthread_create(&thread, NULL, thread_start, NULL)) != 0) {
84+
pthread_attr_t attr;
85+
pthread_attr_init(&attr);
86+
pthread_attr_setstacksize(&attr, STACK_SIZE);
87+
if ((res = pthread_create(&thread, &attr, thread_start, NULL)) != 0) {
8488
fprintf(stderr, "TEST ERROR: pthread_create failed: %s (%d)\n", strerror(res), res);
8589
exit(1);
8690
}
91+
pthread_attr_destroy(&attr);
8792

8893
if ((res = pthread_join(thread, NULL)) != 0) {
8994
fprintf(stderr, "TEST ERROR: pthread_join failed: %s (%d)\n", strerror(res), res);

test/hotspot/jtreg/vmTestbase/nsk/share/native/native_thread.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2023, 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
@@ -128,11 +128,16 @@ void* THREAD_start(void* t) {
128128
return NULL;
129129
}
130130
#else // !windows & !sun
131-
int result = pthread_create(&(thread->id),NULL,procedure,thread);
131+
pthread_attr_t attr;
132+
pthread_attr_init(&attr);
133+
size_t stack_size = 0x100000;
134+
pthread_attr_setstacksize(&attr, stack_size);
135+
int result = pthread_create(&(thread->id), &attr, procedure, thread);
132136
if (result != 0) {
133137
perror("failed to create a native thread");
134138
return NULL;
135139
}
140+
pthread_attr_destroy(&attr);
136141
#endif // !windows & !sun
137142
};
138143
return thread;

0 commit comments

Comments
 (0)