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

NVDA does not work with Adobe reader DC 64 bit #12920

Closed
enessaribas opened this issue Oct 9, 2021 · 28 comments · Fixed by #13852
Closed

NVDA does not work with Adobe reader DC 64 bit #12920

enessaribas opened this issue Oct 9, 2021 · 28 comments · Fixed by #13852
Assignees
Labels
app/adobe/acrobat blocked/needs-external-fix blocked p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Milestone

Comments

@enessaribas
Copy link

Steps to reproduce:

  1. download and install latest Adobe reader 64 bit
  2. open a document in Adobe Reader

Actual behavior:

NVDA plays multiple error tones, and Adobe reader exits with no visible error. The following appears in log
ERROR - RPC process 10084 (Acrobat.exe) (14:56:39.824) - Dummy-1229 (4232):
Thread 8124, build\x86_64\remote\COMProxyRegistration.cpp, registerCOMProxy, 182:
Unable to register interface IAccessibleHyperlink with proxy stub IAccessible2Proxy.dll, code -2147023156

Expected behavior:

Adobe reader does not exit and NVDA reads document.

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

alpha-23897,7bd9e8b1

Windows version:

windows 10 21h1

Name and version of other software in use when reproducing the issue:

Adobe reader DC

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

If NVDA add-ons are disabled, is your problem still occurring?

yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

yes

@feerrenrut feerrenrut added this to the 2021.3 milestone Oct 11, 2021
@seanbudd seanbudd self-assigned this Oct 15, 2021
@seanbudd
Copy link
Member

seanbudd commented Oct 15, 2021

Can confirm this with Adobe Reader DC 2021.007.20099. I've attached a log nvda.log with more detail on the crash.

@enessaribas
Copy link
Author

Hi,
Please also note that the error message changes if you disable protected view and enhanced security. The same error is raised on 32 bit Adobe Reader with these enabled as well, however it does not crash.

@feerrenrut feerrenrut removed this from the 2021.3 milestone Oct 18, 2021
@feerrenrut feerrenrut added the p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label Oct 18, 2021
@OzancanKaratas
Copy link
Collaborator

Acrobat Reader does not crash when NVDA is used in English, but crashes when NVDA language is set to Turkish. I don't know if this issue occurs in other languages.

@michaelDCurran
Copy link
Member

Technical info:
It seams that the instability is caused by at least the first call to CoGetPSCLSID, on line 174 of nvdaHelper/remote/COMProxyRegistration.cpp when trying to get existing IAccessible2 interface to proxyStub mappings.
This however is not where the actual crash ends up happening. Rather the crash is pretty random, but sometimes in the Microsoft TSF framework, sometimes in focus handling for other UI frameworks. But from investigation it is very clear to me that it is the call to CoGetPSCLSID that starts the instabilities. This was found by disabling smaller and smaller parts of the nvdaHelperRemote code until getting to this line.
We know that the standard Windows CoGetPSCLSID function does not cause this instability in other apps, so it may be possible that Adobe is hooking in its own implementation for security reasons, I'm not sure yet.

One possible work around to this might be for NVDAHelper itself to hook CoGetPSCLSID, and in our implementation, return the CLSIDs we want registered. which then removes the need for us to specifically call CoGetPSCLSID and or CoRegisterPSCLSID ourselves. But this assumes that the COM framework will in deed call CoGetPSCLSID itself in order to look up proxystub CLSIDs. Which, it should, unless there is a lower-level function the framework uses internally.

@enessaribas
Copy link
Author

Hi,
Is there a timeline on when this will get fixed? Adobe recently has begun upgrading 32 bit versions of reader to 64 bit automatically.

@michaelDCurran
Copy link
Member

I investigated My idea of hooking CoGetPSClsid but it looks as though Windows does not internally call it itself to lookup the proxy stub CLSID.
The next idea is to check the process's token to see if it has its isAppContainer bit set. initial investigations seem to suggest that Adobe Reader does set this in its protected mode. I'll create a pr / try build soon.

@michaelDCurran
Copy link
Member

The current recommendation to work around bugs in Adobe Reader is to specifically download and install Adobe Reader 32 bit from adobe.com (which today still exists). And also in Adobe Reader's preferences: disable Protected mode / app container, in the Security (enhanced) category.

@michaelDCurran
Copy link
Member

Even when working around the app container bug, Adobe Reader 64 bit still crashes when NVDA starts to interact with pdf content.
This seems to be a bug in Adobe Reader where it is not correctly calling Addref on an IAccId interface it gives us via IServiceProvider::QueryService.
I have reported both of these bugs to Adobe and am currently working with their engineering team to get these further investigated and addressed.

@CyrilleB79
Copy link
Collaborator

Maybe it would be valuable to write something about it in the message announcing the release.

@michaelDCurran
Copy link
Member

michaelDCurran commented Nov 23, 2021 via email

@enessaribas
Copy link
Author

Hi Michael,
Please note that an ergent aspect of this bug is that Adobe has been autoupgrading versions to 64 bit. I had to do a reinstall because of this, and there is no way to stop this behavior that I know of.

@michaelDCurran
Copy link
Member

michaelDCurran commented Nov 24, 2021 via email

@lukaszgo1
Copy link
Contributor

I understand. I am doing all I can to get the bugs investigated and addressed in Adobe Reader. There is nothing we can currently do in NVDA at the moment.

Given that JAWS has (or at least had last time I checked)
no problems with accessing 64-bit versions of Adobe Reader it seems this can be worked around on the screen reader's side somehow. Obviously in the ideal situation these bugs should have been fixed by Adobe.

@lukaszgo1
Copy link
Contributor

I've confirmed JAWS is not affected by these bugs in Acrobat.

@LeonarddeR
Copy link
Collaborator

What happens if we do not register the IAccessible2 proxy in Adobe Reader?

@LeonarddeR
Copy link
Collaborator

What happens if we do not register the IAccessible2 proxy in Adobe Reader?

O well, just tested it an it still crashes, though later in the process.

@feerrenrut feerrenrut added the blocked/needs-info The issue can not be progressed until more information is provided. label Dec 10, 2021
@bramd
Copy link
Contributor

bramd commented Dec 15, 2021

It seems timing matters with this bug. When I quit NVDA and use Narrator to open a PDF and start NVDA after that, it seems to work as expected. I wonder if other people in this thread can reproduce that?

@OzancanKaratas
Copy link
Collaborator

@bramd: You're right. Acrobat Reader crashed due to NVDA. I attached the log.

@puffybc
Copy link

puffybc commented Jan 26, 2022

I'm having the same issue with Adobe Acrobat DC. Getting exception code 0xc0000005. I changed the settings to read visible page, but that didn't help. (I work with lots of long pdf's so I typically make acrobat load the whole thing before reading).

@jmdaweb
Copy link

jmdaweb commented Feb 11, 2022

Hi,
I started experiencing this issue after upgrading to Windows 11. Acrobat opens while NVDA is running only if AppContainer security setting is disabled first using another screen reader. Otherwise, it crashes instantly.
In another computer running Windows 10 21H2, Acrobat works as expected, but NVDA displays some error messages in the log:

ERROR - RPC process 14864 (Acrobat.exe) (12:09:46.162) - Dummy-7812 (13456):
Thread 6008, build\x86_64\remote\COMProxyRegistration.cpp, registerCOMProxy, 182:
Unable to register interface ISimpleDOMNode with proxy stub ISimpleDOM.dll, code -2147023156

These messages also disappear after disabling appContainer.
In case language is important, all programs are configured in spanish. I'm using NVDA 2021.3.1 and Adobe Acrobat DC x64, automatically upgraded from 32-bit reader.
Regards.

@enessaribas
Copy link
Author

hi,
The problem for me is it still will not open documents even if I disable the protected view and the container setting. Only thing it changes is to change the error message in log. The end result is the same.

michaelDCurran added a commit that referenced this issue Mar 3, 2022
Fixes #11568
Partial fix for #12920

Summary of the issue:
Recent versions of Adobe Reader introduced a Protected Mode, where by the Adobe Acrobat process has less privileges and is sandboxed. This ensures that insecure PDFs do not have a chance to affect the rest of the Operating System.
By default Adobe Reader is configured to enter its Protected mode on start-up, and to set the 'isAppContainer' attribute on its process token.
There seems to be a bug however, either in Adobe Reader, the Windows OS, or NVDA (NV access and Adobe cannot be sure) that causes the Adobe Reader process to become unstable when NVDA tires to register IAccessible2. Specifically, the call to CoGetPSClsid seems to start making things unstable. The further call to CoRegisterPSClsid fails, and then eventually the process completely crashes randomly in places such as TSF initialization.
The upshot is that If Adobe Reader is started when NVDA is running, many errors are written to NVDA's log, and Adobe Reader closes straight away.

Description of how this pull request fixes the issue:
NVDAHelper's IAccessible2 registration code now checks if the process token has the 'IsAppContainer' attribute, and of so refuses to install IAccessible2 support.
Note that Adobe Reader itself does not require IAccessible2 to function.
Also, the 'IsAppContainer' is only set on very heavily sandboxed sitations, and is not the same as the app container that is used for Windows Desktop Bridge apps. Thus, refusing to install IAccessible2 into processes with the 'IsAppContainer' attribute has no other known side affects.
@enessaribas
Copy link
Author

hi,
The label on this issue states info is required. Is there any more info I need to provide about this to diagnose further?

@michaelDCurran michaelDCurran added blocked/needs-external-fix and removed blocked/needs-info The issue can not be progressed until more information is provided. labels Mar 24, 2022
@michaelDCurran
Copy link
Member

Adobe has now communicated that they are addressing the issue on their side.

But here is further technical information which was found during investigation from me.

  1. Adobe's IAccID custom interface has been changed so that specifically on 64 bit builds, the ID argument is now 64 bit wide instead of 32 bit. There are two major problems with this:
    A. The argument type was changed within an ifdef for 64 bit, meaning that compiling the interface for 64 bit would yield a different binary interface to compiling with 32 bit. This should never be done with a COM interface. Both the client and server must always agree on the exact types, no matter if the client and server do or don't differ in their bit size.
    B. the interface was changed without changing its IID. Essentially meaning that the AT client could be using one version of the interface, and Acrobat the other, and the methods / data types are incompatible. This could crash the AT, Acrobat, or even worse, the internal Windows RPC system. A COM interface should never be changed after it is published. Rather, a new one should be created, and the old one should be deprecated if necessary.
  2. Now that the ID from IAccID is 64 bit, it is impossible to pass it to MSAA's accchild method on the root IAccessible for the document, in order to fetch a descendant object with the given ID. According to MSAA documentation on child IDs, accChild only can take a 32 bit (VT_I4) child ID. Thus either it is impossible now to use the ID, or in the worst case, the AT can crash Acrobat by passing it an ID truncated from 64 bit to 32 bit. As it looks as though Adobe internally treats the ID as a raw memory address, truncating to 32 bit simply yields an invalid address. Crash!

@michaelDCurran
Copy link
Member

@enessaribas I've now removed needsInfo and replaced it with needsExternalFix. Adobe has all the information, and has communicated that they will fix it on their end. I will update the issue when I know more.

@enessaribas
Copy link
Author

Could Adobe possibly stop automatically upgrading the version from 32 bit to 64 bit on systems with NVDA? There is no way to turn off this behavior, and I have had to manually uninstall and reinstall reader twice so far.

@XLTechie
Copy link
Collaborator

XLTechie commented Mar 26, 2022 via email

@ABuffEr
Copy link
Contributor

ABuffEr commented Mar 26, 2022

  1. Set the Startup type to Disabled.
  1. Stop the service via context menu, before it's too late 🙂

@seanbudd
Copy link
Member

seanbudd commented Jul 12, 2022

I am no longer experiencing this issue with the latest Adobe reader and NVDA 2022.beta3.

Is anyone still experiencing this issue with the latest Adobe reader? Would you be able to test #13852?

seanbudd pushed a commit that referenced this issue Jul 15, 2022
…lBuffer for PDF content (#13852)

Fixes #12920

# Summary of the issue:
Adobe Acrobat / Reader 64 bit crashes when NVDA renders a virtualBuffer for PDF content.
There are two reasons for this:
1. Adobe's IAccID custom interface has been changed so that specifically on 64 bit builds, the ID argument is now 64 bit wide instead of 32 bit. This meant that NVDA was using the wrong data type and wrong call signature for IAccID::get_accID, and therefore Acrobat / Reader was trying to write a 64 bit value in to the space that could only hold 32 bits, causing a buffer overrun.
2. Adobe Acrobat / Reader's accID values, including the MSAA child IDs used for IAccessible::get_accChild and AccessibleObjectFromEvent were 64 bit wide, though MSAA only supports 32 bit values. This would cause invalid and truncated values to be used for child IDs, in many cases causing a crash.

Adobe has addressed point 2 in Adobe Acrobat / Reader beta versions and will be in a stable build in the near future.
But NVDA needs to address point 1 in its own code.

# Description of user facing changes
Using a version of Adobe Acrobat / Reader with the required fixes on adobe's side, along with this PR in NVDA, the crash is avoided.
 
# Description of development approach
miscDeps has been updated to contain the newest version of acrobatAccess.idl from the Adobe Acrobat SDK.
The adobeAcrobat vbufBackend getAccID method has been changed to fetch the out param of IAccID::get_accID with a LONG_PRT which will be 64 bit wide on 64 bit Acrobat / Reader, and 32 bit wide on 32 bit Acrobat / Reader. The value is then static casted to long when returned. As Acrobat always uses 32 bit accID vlaues, no information will be lost in the conversion.
@nvaccessAuto nvaccessAuto added this to the 2022.3 milestone Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/adobe/acrobat blocked/needs-external-fix blocked p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet