Quickly Process Large PICT Images (with Zero Length Lines & Zero Size Clipping Canvases) in Word DOC File & Avoid Stack Overflow (C# .NET)

We have a test Word 2003 document that opens fine in Word. But if we pass this to Aspose.Words (new Document(ourFile)) Words will go into an endless look and crash after about 20 seconds with a Stack Overflow, and consume 4Gig of RAM in process.
We’re currently at 20.8, but we were at 18.11 when we first encountered this and tried upgrading Aspose first to see if it had been fixed already. Alas, it appears not.
It’s a 250K file that, as I said, opens okay in Word. I can provide it for examination easily enough, so that hopefully this can be fixed.

Brad.

@bpstitus,

Please ZIP and upload your input Word document (you are getting this problem with) here for testing. We will then investigate the issue on our end and provide you more information.

CrashesAsposeWords.zip (150.8 KB)

I didn’t see the way to upload before, but got it this time.
Reproducing is simple: new Document(file), or
stream = new Stream(file)
new Document(stream)

Watch your memory consumption ramp up, and after a short while (about 30 seconds, maybe less) you’ll get a Stack Overflow. Word appears to have no problems with this file, though I do notice that if I open in Word & resave, this problem goes away, so there’s something broken about it. For us, since we only have read-only access, “repairing” isn’t an option.

Ideal solution is to successfully open the file. But an acceptable alternate solution is to return an error that you can’t open the file, without blowing out the memory and crashing. :slight_smile:

I can run test/beta builds here if you need it.

Brad.

@bpstitus,

But, I am able to run the following code without any exception on my end:

Document doc = new Document("C:\\CrashesAsposeWords\\146615.doc"); // took  48643 milliseconds
doc.Save("C:\\CrashesAsposeWords\\20.8.doc"); // took 651 milliseconds

The whole process took around 1616.781 Mb of memory which is way too much for a 7 pages DOC file. For the sake of correction, we have logged this problem in our issue tracking system with ID WORDSNET-20957. We will further look into the details of this problem and will keep you updated on the status of linked issue. We apologize for your inconvenience.

Many thanks! I’ll monitor and watch for a release with this fixed. If any of your folks need anything further from us, just reply here and I’ll get a notification.

Brad.

@bpstitus,

Sure, we will also inform you via this forum thread as soon as this issue will get resolved in future.

The issues you have found earlier (filed as WORDSNET-20957) have been fixed in this Aspose.Words for .NET 20.9 update and this Aspose.Words for Java 20.9 update.