We have a C++11 DLL (TheDll.dll
) implemented in Visual Studio 2015 which performs calculations that are implemented with recursion and multithreading. This is compiled using x64 and the dll is created.
This DLL is called using .Net Interop from within ASP.NET MVC 5 web application developed using C#. When the web application is run and the page that calls the DLL is accessed, the CPU usage on the Web server that has this web application hosted, increases and finally after a certain point it stops and generates the following error:
Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96
Faulting module name: TheDLL.dll, version: 0.0.0.0, time stamp: 0x5c05a6ef
Exception code: 0xc00000fd
Fault offset: 0x00000000000020b9
Faulting process id: 0xb4c
Faulting application start time: 0x01d48b5418a03aa5
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\inetpub..\bin\TheDLL.dll
Report Id: 6f5c9f77-f747-11e8-80d8-00219b9035e2
Faulting package full name:
Faulting package-relative application ID:
After few tries, the application pool stops, and the site is not accessible.
However, by creating an EXE project using Visual Studio 2015 with the same exact code that is used in the DLL, the program runs successfully. The EXE file takes at most 30% of CPU usage.
We tried to modify the “Stack Reserve Size” and “Stack Commit Size” using Visual Studio 2015 IDE at compile time of the DLL. This approach worked only when the DLL was called within a C++ project in Visual Studio 2015. Changing the size of stack and commit memory using Visual Studio 2015 IDE at compile time didn’t work when calling the DLL within the IIS (through the Web Application).
Any suggestion for handling this issue?
User contributions licensed under CC BY-SA 3.0