Skip to content

Commit

Permalink
8219652: [aix] Tests failing with JNI attach problems.
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, cjplummer, sspitsyn
  • Loading branch information
varada1110 authored and offamitkumar committed Oct 4, 2023
1 parent 8c0d026 commit 0b0f8b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 0 additions & 4 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ gc/stress/TestStressG1Humongous.java 8286554 windows-x64
# :hotspot_runtime


runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 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 @@ -157,9 +156,6 @@ vmTestbase/metaspace/gc/firstGC_99m/TestDescription.java 8208250 generic-all
vmTestbase/metaspace/gc/firstGC_default/TestDescription.java 8208250 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-all

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

3 comments on commit 0b0f8b5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RealCLanger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u

@openjdk
Copy link

@openjdk openjdk bot commented on 0b0f8b5 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RealCLanger the backport was successfully created on the branch RealCLanger-backport-0b0f8b55 in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 0b0f8b55 from the openjdk/jdk repository.

The commit being backported was authored by Varada M on 4 Oct 2023 and was reviewed by David Holmes, Chris Plummer and Serguei Spitsyn.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u:

$ git fetch https://github.com/openjdk-bots/jdk21u.git RealCLanger-backport-0b0f8b55:RealCLanger-backport-0b0f8b55
$ git checkout RealCLanger-backport-0b0f8b55
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u.git RealCLanger-backport-0b0f8b55

Please sign in to comment.