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

8263846: Bad JNI lookup getFocusOwner in accessibility code on Mac OS X #3099

Closed
wants to merge 3 commits into from

Conversation

azuev-java
Copy link
Member

@azuev-java azuev-java commented Mar 19, 2021


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8263846: Bad JNI lookup getFocusOwner in accessibility code on Mac OS X

Reviewers

Download

To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3099/head:pull/3099
$ git checkout pull/3099

To update a local copy of the PR:
$ git checkout pull/3099
$ git pull https://git.openjdk.java.net/jdk pull/3099/head

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 19, 2021

👋 Welcome back kizune! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 19, 2021

@azuev-java The following label will be automatically applied to this pull request:

  • awt

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added awt client-libs-dev@openjdk.org rfr Pull request is ready for review labels Mar 19, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 19, 2021

Webrevs

Copy link
Member

@azvegint azvegint left a comment

Choose a reason for hiding this comment

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

Since there is no test, I assume that the JBS issue should have noreg-hard label.

@openjdk
Copy link

openjdk bot commented Mar 19, 2021

@azuev-java This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8263846: Bad JNI lookup getFocusOwner in accessibility code on Mac OS X

Reviewed-by: azvegint, prr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 6 new commits pushed to the master branch:

  • cb742f9: 8255255: Update Apache Santuario (XML Signature) to version 2.2.1
  • d2c137d: 8263558: Possible NULL dereference in fast path arena free if ZapResourceArea is true
  • ab66d69: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe
  • 5b8233b: 8263871: On sem_destroy() failing we should assert
  • 96e5c3f: 8263890: Broken links to Unicode.org
  • 4d9517d: 8263834: Work around gdb for HashtableEntry

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 19, 2021
@@ -1456,6 +1456,7 @@ - (id)accessibilityHitTest:(NSPoint)point withEnv:(JNIEnv *)env
- (id)accessibilityFocusedUIElement
{
JNIEnv *env = [ThreadUtilities getJNIEnv];
GET_CACCESSIBILITY_CLASS_RETURN(nil);
Copy link
Member

Choose a reason for hiding this comment

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

Is it caused by the JDK-8257853? Should we update the accessibilityIndexOfChild as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

It made it visible however it is just a good practice not to assume that class reference is already initialized before using it. So, yes, while i was not seeing any failures in accessibilityIndexOfChild i might fix it as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this was missed in the JNF work, add the label "jnf" to the bug.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@azuev-java
Copy link
Member Author

Since there is no test, I assume that the JBS issue should have noreg-hard label.

Yes, as with most of platform-specific accessibility issues just configuring a system to be able to invoke this native functionality is quite hard. I will put the corresponding keyword into the bug.

@@ -799,6 +799,7 @@ - (NSUInteger)accessibilityIndexOfChild:(id)child
}

JNIEnv *env = [ThreadUtilities getJNIEnv];
GET_CACCESSIBILITY_CLASS_RETURN(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't necessary. Because the line below takes care of it. The definition looks like
#define GET_ACCESSIBLEINDEXINPARENT_STATIC_METHOD_RETURN(ret)
GET_CACCESSIBILITY_CLASS_RETURN(ret);
GET_STATIC_METHOD_RETURN(sjm_getAccessibleIndexInParent, sjc_CAccessibility, "getAccessibleIndexInParent",
"(Ljavax/accessibility/Accessible;Ljava/awt/Component;)I", ret);

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, ok, was missed that. Will revert this change.

@@ -1456,6 +1456,7 @@ - (id)accessibilityHitTest:(NSPoint)point withEnv:(JNIEnv *)env
- (id)accessibilityFocusedUIElement
{
JNIEnv *env = [ThreadUtilities getJNIEnv];
GET_CACCESSIBILITY_CLASS_RETURN(nil);
Copy link
Contributor

Choose a reason for hiding this comment

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

If this was missed in the JNF work, add the label "jnf" to the bug.

there takes care of the class initialization.
@azuev-java
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Mar 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 20, 2021
@openjdk
Copy link

openjdk bot commented Mar 20, 2021

@azuev-java Since your change was applied there have been 6 commits pushed to the master branch:

  • cb742f9: 8255255: Update Apache Santuario (XML Signature) to version 2.2.1
  • d2c137d: 8263558: Possible NULL dereference in fast path arena free if ZapResourceArea is true
  • ab66d69: 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not thread safe
  • 5b8233b: 8263871: On sem_destroy() failing we should assert
  • 96e5c3f: 8263890: Broken links to Unicode.org
  • 4d9517d: 8263834: Work around gdb for HashtableEntry

Your commit was automatically rebased without conflicts.

Pushed as commit 118a49f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@azuev-java azuev-java deleted the JDK-8263846 branch August 23, 2021 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awt client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants