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

memory is corrupt problem #174

Open
coder3408 opened this issue Oct 3, 2018 · 1 comment
Open

memory is corrupt problem #174

coder3408 opened this issue Oct 3, 2018 · 1 comment

Comments

@coder3408
Copy link

Hello to all,

We have a multi-threaded application that is running on the server as a service. There are 5 different threads running at the same time in the same application.

Our problem is, we are sometimes having the following error.

2018-10-03 10:01:04.9511 Error DocumentActionLibrary.EmailingActions+<>c__DisplayClass9_0.<Process_EmailCreatedInvoiceManually>b__4 T||UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxx
invoice, Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

After that error, application stops. Then we start the service manually. Then it runs normally again.

We are using the following TuesPechkin dll's

Name : TuesPechkin
Description : .NET wrapper for wkhtmltopdf; supports 32-bit, 64-bit, multi-threaded and IIS environments.
Runtime version : v2.0.50727
version : 2.1.1.0

Name : TuesPechkin.Wkhtmltox.AnyCPU
Runtime version : v2.0.50727
version : 0.12.4.1

Server Info :

Microsoft Windows Server 2016
Version 1607
64 bit

Development source:
Visual Studio 2016 - C#

Is there any idea please...

Thanks...

@tloy1966
Copy link

tloy1966 commented Oct 6, 2018

You can use 5 threads, but make sure you have allocated a singleton IConvert

If Start 5 thread at the same time, you can lock it

public static IConverter GetIisHostedConverter()
{
lock (Locker)
{
if (_iisConverter == null)
{
var tempFolderDeployment = new TempFolderDeployment();
var winAnyCpuEmbeddedDeployment = new WinAnyCPUEmbeddedDeployment(tempFolderDeployment);
var pdfToolset = new RemotingToolset(winAnyCpuEmbeddedDeployment);
_iisConverter = new ThreadSafeConverter(pdfToolset);
}
return _iisConverter;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants