1

Our normal workflow is to use a Windows Scheduled Task to:

  1. convert files from rtf to pdf in bulk
  2. manipulate the pdfs to add barcodes
  3. aggregate into a single pdf
  4. then send for printing

This was working fine on Windows Server 2008, but since our upgrade to Windows Server 2019 (end of life and whatnot) we've run into a whole host of issues. We're now falling down at the first hurdle- even instantiating the Word OLE client. The error isn't consistent - one day the process will complete successfully, the next it will fail immediately.

Our tasks trigger a Dyalog APL workspace, where the code to be executed sits. For debugging purposes, I have set up a simplified version which is doing the following:

 tries←0                                                              ⍝ Initialise the try counter
 Log'Attempting to create Word instance'                              ⍝
 :Repeat                                                              ⍝ Keep trying to...
     Word←⎕NEW'OleClient'(⊂'ClassName' 'Word.Application')           ⍝     Create the Word Client instance
     Word.Visible←1                                                   ⍝     making the application visible
     tries+←1                                                         ⍝     and incrementing the try counter each time
     Log'Try: ',⍕tries                                               ⍝
 :Until #.Word.PropList∊⍨⊂'Documents'                                ⍝ Until it has seemingly created successfully
 :OrIf tries≥maxTries_create                                          ⍝ ... or the tries have exceeded the maximum (currently 5)
                                                                      ⍝
 'doc open'delayAndLog dl_open                                        ⍝ With an optional external delay...
 myWordDoc←Word.Documents.Open⊂docPath                                ⍝ open the specified test doc
                                                                      ⍝
 'doc close'delayAndLog dl_close                                      ⍝ With an optional external delay...
 myWordDoc.Close 0                                                    ⍝ close the doc (not saving)
                                                                      ⍝
 'application quit'delayAndLog dl_quit                                ⍝ With an optional external delay...
 Word.Application.Quit 0                                              ⍝ quit the word client

The various delays are held externally in a config file. I didn't include the reading of this config file, as essentially what is shown here is the substance. Note: I retry creating the instance as sometimes I've found that it only instantiates with the barebones methods. Putting a delay in, or retries seemed to fix this.

This piece of code, will run completely fine in my non-prod servers (and even sometimes in production). Today, it will run fine when I am running it through the IDE, but when running as a Windows Scheduled Task it will report a DOMAIN ERROR when opening the document.

My observations are that it briefly creates the WINWORD.exe, i.e. you can see it in the task manager, the status turns to "suspended", then it disappears. In the event viewer, we see the following:

Event Viewer - ntdll application fault (id: 1000)

Things I've tried so far

  1. Rebooted the server (yes, you joke, but turning it off and on again is the first thing we should always try)
  2. Repaired Office
  3. Reinstalled Office
  4. Tried configuring the task to run as a different user (myself, with local admin rights)
  5. Tried configuring the task to run on a different server.
  6. Tried configuring the task to run with a higher priority.
  7. Making the Word instance visible, to see if there are any error pop-ups.
  8. Built a simplified version of the task (see above) to ensure it's not just the overall complexity of the main task causing confusion.
  9. Disabled "automatic inking" on Microsoft's recommendation
  10. Captured procmon logs of the error (awaiting Microsoft's review)

Versions currently installed:

  • Word: Microsoft Word 2019 MSO (16.0.10374.20040) 64-bit
  • Dyalog APL: 16.0.35960.0 32-bit Unicode
  • Windows Server 2019 Standard Version 1809. OS Build 17763.1697.

Any help would be really greatly appreciated on this one as I feel like I'm tackling Schrödinger's OLE Client. Thanks in advance.

James Heslip
  • 11
  • 1
  • 3

1 Answers1

2
  1. That is a crash in Word.

There might be crash dump files in c:\Users<yourname>\AppData\Local\Temp\ or c:\Users<yourname>\AppData\Local\CrashDumps.

At your company, if you have any C developers who can use Visual Studio or Windbg, they could open the dump file and see if it gives any clues.

If not, I could take a quick look if you send it to Dyalog Support.

  1. This is just a guess...Have you tried increasing the size of the Desktop heap? Please see this blog post: https://learn.microsoft.com/en-us/archive/blogs/ntdebugging/desktop-heap-overview

Regards,

Vince

Dyalog Support
  • 248
  • 1
  • 5
  • Hi Vince. Thanks for your prompt response. I found a dump file in C:\dumps\ (tracked this path down through the registry). Unfortunately we don't have a C developer in-house. Would I be able to take you up on your offer? The file is quite large (circa 500MB) - I'll see if I can share it with you via our OneDrive. – James Heslip Nov 09 '21 at 15:37