We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Fail to load PPT file when running multi thread with Aspose.Slides for .NET

Hi,

I’m having an issue when opening ppt file when running multi thread. If you run single thread, this test is ok. But if you run multi thread with pool size is 10, some exception will be throw like:

  • Exception Info: System.NullReferenceException
    at Aspose.Slides.Presentation.Dispose()
    at Aspose.Slides.Presentation.Finalize()
  • The presentation stream position is set to the end of stream. For properly loading set the stream.Position to the stream beginning.
  • Bad state (invalid block type)
  • Index was outside the bounds of the array.

Please note that the files can be opened properly with no error and exception in case of single thread, so it is not the problem with the file.

You can reproduce this problem when using this code, running in multi-thread mode. Number of files should be about 2000 files. Number of threads should be about 10 threads.

FileStream fStream = new FileStream(input, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Presentation presentation = new Presentation(fStream);
presentation.Save(output, SaveFormat.Ppt);

Please also note that this issue happens with Aspose Slide 18.4 but does not with Aspose 16.12. I have not had chance to test with other versions.

Please help investigate as soon as possible. This issue is damaging drastically our production.

Regards,
Dung Nguyen

@dunghnguyen,

I have observed the information shared by you and in order to investigate the issue further on our end we request you to please provide the sample project being used along with source presentation deck reproducing the issue on your end. Please share the requested information so that we may proceed further to help you.

Hi,

The source code is simple as above. I just use Aspose Slide to load the ppt file and the error occurred.
I cannot share the sample file because the issue does not happen with a single sample. It happened when running in multi-thread mode with various samples.
I am clear that it would be hard to reproduce but this is an extremely serious issue with Aspose Slide 18.4.

Regards,
Dung Nguyen

@dunghnguyen,

I have observed your comments and like to share that we require the source sample presentation that is reproducing issue on your end so that we may log that in our issue tracking system for investigation.

Hi,

I tried to create a small tool that using Aspose Slide to loading a ppt file, and the issue happened. I added a zip files contain all source code, log files and dataset for you. (Because of the size of zip file, so I uploaded them to dropbox. Please checkout there https://www.dropbox.com/s/lg10s0ccd74nhi3/LoadAsposeSlide.zip?dl=0)

You can see the source code inside folder “ConsoleApplication1”, I only use multi thread to load ppt file and write out to console. In folder “dataset” is some ppt file I downloaded randomly in the Internet, and in folder “TestingTool” is the testing tool I built from the source code above (Because I can’t upload directly the zip file here, so I removed file Aspose.Total.lic for privacy information, please add them back)

You can reproduce the problem by running command: TestingLoadPpt.exe <data_set_path> <pool_size>, replacing <data_set_path> to the path of folder “dataset” and <pool_size> to 21. This tool will run 100 times with 20 input files of dataset. I tried to running it in local 4 times, and some errors message had been threw:

  • Index was outside the bounds of the array.
  • Collection was modified; enumeration operation may not execute.

Beside that, when you run the TestingTool with pool_size is 1, no error was reported. Please help us investigate this issue.

Thanks,
Dung H. Nguyen

@dunghnguyen,

Thank you for sharing the information. An issue with ID SLIDESJAVA-37025 has been created in our issue tracking system to further investigate and resolve the issue. We will share the good news with you as soon as the issue will be resolved.

Hi @mudassir.fayyaz, we met the problem with Aspose Slide .NET 18.4. Can you please test and log a ticket with Aspose Slide .NET too?

Thanks,
Dung Nguyen

@dunghnguyen,

I have added an issue with ID SLIDESNET-40159 in our issue tracking system for fixing .NET related issue as well.

Hi,

Do you have any update on this issue?

Thanks,
Dung Nguyen

@dunghnguyen,

I have verified the issue status and regret to share that at present the issue is still unresolved. We request for your patience till the time the issue gets resolved.

Any update on this issue?

@metascan,

I have verified from our issue tracking system and regret to share that the issue is still unresolved. We will share the feedback with you as soon as the issue will be fixed and request for your patience.

@metascan,

We have initiated the investigation on our end and request you to please provide the Operating System and environment details on your end.

Any update on this issue?

We have the same exception stacktrace with version 17.11. It kills our program because the exception is thrown in the finalizer thread.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Aspose.Slides.Presentation.Dispose()
   at Aspose.Slides.Presentation.Finalize()

@kaiwachter,

I have observed your comments. Can you please try to use Aspose.Slides latest version 18.11 and if there is still an issue than please share sample project to reproduce issue.

Hello,

Is there any update on this issue?
I am seeing it (SLIDESNET-40159) is still in Open status.
Can you please provide us an ETA of resolution?

Thank you so much.
Regards,
Dung

@dunghnguyen,

Can you please try using latest Aspose.Slides for .NET 20.6 on your end. In case you face issue, please provide the sample visual studio project reproducing issue on your end.

Hi team,

I found that the issue SLIDESNET-40159 was closed. But by testing with the latest version of Aspose.Slides, I found the issue still existed.
Can you please share if the issue was really fixed or just closed?
If it was actually not fixed, can you please share a plan on resolution?

Thanks,
Dung H. Nguyen

@dunghnguyen,
Unfortunately, we were unable to reproduce the error you described. Because we have not got any additional information for a long time, the issue has been closed. Could you please specify the version of the operating system where the error occurs? It would be great if you could share any additional information to reproduce the problem on our side. Then we can continue the investigation.

Hi team,
I have retested this issue with the new background as follows:

Windows 10 Core i7, RAM 32GB
System type: 64-bit operating system, x64-based processor
Platform: .NET Core 5.0
Aspose Slides version: 21.8.0
Sample files: 400 PPT files
Number of threads: 1, 5, 10, 15 or 20

Sample code (see details in SampleCode.zip)

       try
       {
           using var fStream = new FileStream(inputFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
           var presentation = new Presentation(fStream);
           presentation.Save(outputFile, SaveFormat.Ppt);
       }
       catch (Exception e)
       {
       }

If you run single thread, this test is ok. But if you run multi-thread, some exceptions will be thrown like:

Object reference not set to an instance of an object.
The process cannot access the file because it is being used by another process.

Hope you can reproduce and investigate it. Thank you.