일부 DLL을로드하는 MVC4 응용 프로그램이 있습니다. 기본적으로 MVC 애플리케이션의 아키텍처는 다음과 같습니다. 앱이 사용자로부터 일부 작업을 수신하고 dll에서 처리 기능을 호출하며 결국 결과를 이메일로 전송합니다.IIS8을 사용하는 MVC 응용 프로그램에서 힙 손상
모든 dll은 64 비트로 컴파일되며 Windows Server 2012R2 및 VS2013에서는 64 비트로 IIS8을 사용합니다. 나는 응용 프로그램을 배포 실행/때 는, 그 동작은 다음과 같습니다
이Scenario1
: VS2013에서 비주얼 스튜디오 2013에서 실행 디버그/릴리즈 모드에서 웹 서버 (IIS Express를) 포함 => 잘Scenario2
작동 : 실행 릴리스 모드에서 로컬 전체 IIS8에 배포 된 Visual Studio 2013 => 잘 작동Scenario3
: 로컬 전체 IIS8에서 배포 모드로 배포되고 VS2013을 열지 않고 브라우저에서 직접 실행 => IIS가An unhandled win32 exception occurred in w3wp.exe.The Just-ln-Time debugger was launched without necessary security permissions. To debug this process, the Just-ln-Time debugger must be run as an Administrator.
과 충돌 함 디버거를 열면 오류는A heap has been corrupted
입니다.
이벤트 뷰어에서 로그는 다음과 같습니다
Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96
Faulting module name: ntdll.dll, version: 6.3.9600.18821, time stamp: 0x59ba86db
Exception code: 0xc0000374
나는 0xc0000374이 Heap corruption
에서 오는 예외 코드를 알고있다.
Full PageHeap 플래그가 활성화 된 상태에서 DebugDiag 및 Application Verifier를 사용하여 IIS를 디버깅했습니다. 무너지는 스레드에 대한 스택의 관련 부분은 다음과 같습니다 시나리오 2와 Scenario3 사이에 어떤 차이가
.NET Call Stack
mscorlib_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr)+68
[[InlinedCallFrame] (Microsoft.Win32.Win32Native.LocalFree)] Microsoft.Win32.Win32Native.LocalFree(IntPtr)
mscorlib_ni!System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr)+2d
Species_DLL.Class1.Species_MetaModel()+b955
rIAMTestMVC4.Impressions.SpeciesUtil.use_Species_Integrated(Int32)+1efd
Full Call Stack
vrfcore!VerifierStopMessageEx+6f4
vrfcore!VfCoreRedirectedStopMessage+90
verifier!VerifierStopMessage+a0
verifier!AVrfpDphReportCorruptedBlock+2a7
verifier!AVrfpDphCheckNormalHeapBlock+c8
verifier!AVrfpDphNormalHeapFree+27
verifier!AVrfDebugPageHeapFree+af
ntdll!RtlDebugFreeHeap+47
ntdll!RtlpFreeHeap+74c85
ntdll!RtlFreeHeap+368
vrfcore!VfCoreRtlFreeHeap+1e
KERNELBASE!LocalFree+2e
mscorlib_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(IntPtr)+68
[[InlinedCallFrame] (Microsoft.Win32.Win32Native.LocalFree)] Microsoft.Win32.Win32Native.LocalFree(IntPtr)
mscorlib_ni!System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr)+2d
Species_DLL.Class1.Species_MetaModel()+b955
rIAMTestMVC4.Impressions.SpeciesUtil.use_Species_Integrated(Int32)+1efd
이 있습니까? VS에 의해 수행되는 힙 보호가 있습니까?
나는 또한 IIS7이 설치된 Windows7에서 동일한 시나리오를 실행하고 세 가지 모두에서 정상적으로 작동합니다.
DLL 코드에 액세스 할 수 없지만 앞에서 설명한 것처럼 동일한 코드가 IIS7/Windows7 및 Visual Studio의 IIS8에서 완벽하게 실행됩니다.
LE : 호출 스택에 도시 된 두 가지 기능이있다 :
rIAMTestMVC4.Impressions.SpeciesUtil.use_Species_Integrated
=>이 기능은 하나의 DLL 호출 MVC 컨트롤러로된다Species_DLL.Class1.Species_MetaModel
=>이 기능은 이전 호출, DLL 내지 기능.
시나리오 3의 문제를 어떻게 해결할 수 있습니까? 이러한 시나리오의 차이점은 무엇입니까?
는
답변 해 주셔서 감사합니다. 모든 dll은 64 비트에 있기 때문에 이것은 나를위한 해결책은 아닙니다. – banuj