-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8307145: windowsaccessbridge.dll erroneously includes private methods in its C API #13734
Conversation
👋 Welcome back jwaters! A progress list of the required criteria for merging this PR into |
@TheShermanTanker The following label will be automatically applied to this pull request:
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. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't seem to be part of the public API, so this is probably deliberate and not a bug.
https://docs.oracle.com/javase/accessbridge/2.0.2/api.htm#jab-api-specification
@prrace should non-public API methods be removed from .DEF then? |
I should think so, it doesn't make sense to export a function that doesn't even exist at all. And to make matters worse Microsoft Visual C still does export functions with those names (you can easily verify this with dumpbin) which is even more confusing. It may be a cursed Microsoft extension that has simply gone under the radar, and is somehow exporting the C++ class instance methods as static, or even exporting dummy functions, neither of which is what we want it to do! |
So perhaps something internal in the various accessbridge dll's needs it. How will you test this ? |
@prrace Maybe try using free NVDA for testing? |
The problem as I see it is that the .def is exporting something that simply does not exist at all, even if it is a non-public API and the symbols are simply exported from the DLL for internal use by other accessbridge code, then these methods should still be placed in the extern "C" block in the .cpp (but maybe not in the corresponding header since they aren't public). Conversely if it is never meant to be exported but the accessbridge DLLs somehow need the .def files to export phantom, nonexistent symbols to work properly, then something is seriously wrong with them and we should probably take a look at what on earth is going on there |
FWIW, this is what dumpbin displays for these entries:
There's no way to get a pointer to an instance of |
Dear lord, the Microsoft linker is truly cursed, through and through @prrace What sort of testing would need to be done for such a change? |
@azuev-java and @kumarabhi006 can help with review and testing of this PR. |
@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Bumping |
Anyone? |
I'll take a look… hopefully next week. |
Thanks aivanov, no rush haha |
Bumping |
I think it's the best solution. These four functions are not part of the public API to AccessBridge, they're missing from They should not be exported. If the functions aren't loaded by its name, which is implemented in Did you try removing them from the |
@aivanov-jdk Compiles and works fine without the exports in .def |
I don't know about the more extensive test suite Phil alludes to, though |
Bumping |
Neither do I know about more extensive testing. I presume these four entry points were not used externally. Yet “compiles” may not be enough. What does your “works” mean? Did you run it with an AccessBridge client? |
@aivanov-jdk The client does indeed function on my end without issue, but I don't know whether it will do so on other devices as well |
JTReg sure does have a sense of humour, immediately crashing and leaving that ugly cross on the tests the moment I say that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. These methods are not usable outside of the windowsaccessbridge dll. Caller would need a working instance of WinAccessBridge class to pass in this
parameter, and there's no way to get one outside of the DLL.
@TheShermanTanker 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:
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 774 new commits pushed to the
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 |
Right, thanks Daniel |
I will change the title of the PR first |
/integrate |
Thanks all for reviewing this change! |
Going to push as commit 3faba07.
Your commit was automatically rebased without conflicts. |
@TheShermanTanker Pushed as commit 3faba07. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
That's good to know. I would've approved it, if I'd had a slightest chance to read your reply. |
Ah, sorry about that. I've had several changes starved of reviews recently and lying around for almost a month, and was feeling fairly frustrated and impatient :( |
In windowsaccessbridge(-64).dll the following methods are exported in a def file to C API which in turn call their real implementation, which are instance methods of the class WinAccessBridge:
However, they are nowhere to be seen in the actual C interface, in AccessBridgeWindowsEntryPoints.cpp. Your guess is as good as mine as to how on earth MSVC is still capable of compiling and linking this without any errors whatsoever, but in any case, this is a severe oversight and should be properly defined in the C API lest this happy accident within MSVC is fixed by Microsoft in the future
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13734/head:pull/13734
$ git checkout pull/13734
Update a local copy of the PR:
$ git checkout pull/13734
$ git pull https://git.openjdk.org/jdk.git pull/13734/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13734
View PR using the GUI difftool:
$ git pr show -t 13734
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13734.diff
Webrev
Link to Webrev Comment