Skip to content

Commit

Permalink
8219652: [aix] Tests failing with JNI attach problems.
Browse files Browse the repository at this point in the history
8317136: [AIX] Problem List runtime/jni/terminatedThread/TestTerminatedThread.java
8317790: Fix Bug entry for exclusion of runtime/jni/terminatedThread/TestTerminatedThread.java on AIX

Reviewed-by: mbaesken
Backport-of: 0b0f8b55a6becff269ecf7aa19db12e998e238cd
  • Loading branch information
RealCLanger committed Oct 17, 2023
1 parent acbd31b commit ddc51f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 1 addition & 5 deletions test/hotspot/jtreg/ProblemList.txt
Expand Up @@ -91,8 +91,7 @@ gc/stress/TestStressG1Humongous.java 8286554 windows-x64

# :hotspot_runtime


runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 aix-ppc64
runtime/jni/terminatedThread/TestTerminatedThread.java 8317789 aix-ppc64
runtime/handshake/HandshakeSuspendExitTest.java 8294313 generic-all
runtime/os/TestTracePageSizes.java#no-options 8267460 linux-aarch64
runtime/os/TestTracePageSizes.java#explicit-large-page-size 8267460 linux-aarch64
Expand Down Expand Up @@ -155,9 +154,6 @@ vmTestbase/metaspace/gc/firstGC_default/TestDescription.java 8208250 generic-all

vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java 8307462 generic-all
vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 generic-all
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 8073470 linux-all
vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/TestDescription.java 8288911 macosx-x64

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,6 +29,8 @@

#include "jni.h"

#define STACK_SIZE 0x100000

JavaVM* jvm;
jobject nativeThread;

Expand Down Expand Up @@ -79,11 +81,14 @@ Java_TestTerminatedThread_createTerminatedThread
fprintf(stderr, "Test ERROR. Can't extract JavaVM: %d\n", res);
exit(1);
}

if ((res = pthread_create(&thread, NULL, thread_start, NULL)) != 0) {
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, STACK_SIZE);
if ((res = pthread_create(&thread, &attr, thread_start, NULL)) != 0) {
fprintf(stderr, "TEST ERROR: pthread_create failed: %s (%d)\n", strerror(res), res);
exit(1);
}
pthread_attr_destroy(&attr);

if ((res = pthread_join(thread, NULL)) != 0) {
fprintf(stderr, "TEST ERROR: pthread_join failed: %s (%d)\n", strerror(res), res);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -128,11 +128,16 @@ void* THREAD_start(void* t) {
return NULL;
}
#else // !windows & !sun
int result = pthread_create(&(thread->id),NULL,procedure,thread);
pthread_attr_t attr;
pthread_attr_init(&attr);
size_t stack_size = 0x100000;
pthread_attr_setstacksize(&attr, stack_size);
int result = pthread_create(&(thread->id), &attr, procedure, thread);
if (result != 0) {
perror("failed to create a native thread");
return NULL;
}
pthread_attr_destroy(&attr);
#endif // !windows & !sun
};
return thread;
Expand Down

1 comment on commit ddc51f2

@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.