Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

ASP.NET - EcbGetUnicodeServerVariables 코드에서 System.AccessViolationException 예외 발생


하드 디스크가 날아가서 테스트 환경을 다시 구성하는데다,

RAID 1 구성 시 하드 디스크 장애 발생 해결에 대한 경험담
; https://www.sysnet.pe.kr/2/0/1266

공교롭게도 동시에 IA64 지원이 추가되면서 코드가 memcpy로 변경되는 차이가 발생했습니다.

아이태니엄(IA64: Itanium)에서 겪은 C++ 포인터 연산 문제
; https://www.sysnet.pe.kr/2/0/1265

그런데, 새롭게 구성한 Windows 2003 x86 ASP.NET에서 예전에는 없었던 다음과 같은 오류가 발생했습니다. (이벤트 로그에 남은 내용입니다.)

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1056073434/Root

Process ID: 2548

Exception: System.AccessViolationException

Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

StackTrace:    at System.Web.UnsafeNativeMethods.EcbGetUnicodeServerVariables(IntPtr pECB, IntPtr buffer, Int32 bufferSizeInChars, Int32[] serverVarLengths, Int32 serverVarCount, Int32 startIndex, Int32& requiredSize)
   at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.GetAdditionalServerVariables()
   at System.Web.Hosting.ISAPIWorkerRequestInProc.GetAdditionalServerVar(Int32 index)
   at System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name)
   at System.Web.Hosting.ISAPIWorkerRequest.GetRemoteAddress()
   at System.Web.HttpRequest.get_UserHostAddress()
   at System.ServiceModel.Channels.RemoteEndpointMessageProperty.Initialize(Boolean getHostedPort)
   at System.ServiceModel.Channels.RemoteEndpointMessageProperty.get_Address()
   ...[생략]...
   at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

AV 예외가 발생한 이후 w3wp.exe는 여지없이 비정상 종료가 되었음을 알 수 있고,

EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 system.web, P5 2.0.0.0, P6 4c9a2192, P7 228d, P8 39, P9 system.accessviolationexception, P10 NIL.

For more information(1, 2), see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

AppPool에 지정된 "Rapid-fail protection" 정책에 의해 (기본값) 5분 내에 5번의 w3wp.exe 비정상 종료 현상이 발생하면 IIS는 해당 서비스를 "Service Unavailable"로 판단하고 더 이상의 recycle을 하지 않습니다.

예전에는 이런 경우가 한 번도 없었다가, IA64 코드 변경 이후 나타난 것 같아서 매우 찜찜했는데요. 다행히 ^^; 제니퍼 제품을 설치하지 않은 상태에서도 이런 상황이 재현이 되어서 자신감(!)을 가지고 다른 환경적인 차이를 고민해 봤습니다.

일단, .NET 3.5 및 SP1까지 업데이트 한 후에 발생한 상황이라서 별다른 기대를 하지 않고 '윈도우 업데이트'를 살펴보았는데, 다음과 같은 패치가 아직 설치되지 않고 있었습니다.

Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update for .NET versions 2.0 through 3.5 (KB951847) x86
; http://www.update.microsoft.com/windowsupdate/v6/default.aspx?ln=en-us

설치 하고 나니 문제 해결!

휴~~~ 다행입니다. ^^ 비록 가끔은 안 좋은 윈도우 업데이트(1, 2)가 있긴 하지만, 어쨌든 업데이트가 괜히 제공되는 것이 아님을 다시 한번 알게 되는 사건이었습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 8/12/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 136  137  138  139  140  141  142  143  144  145  146  147  148  149  [150]  ...
NoWriterDateCnt.TitleFile(s)
1299정성태6/18/201232708제니퍼 .NET: 21. 제니퍼 닷넷 - Ninject DI 프레임워크의 성능 분석 [2]파일 다운로드2
1298정성태6/14/201234208VS.NET IDE: 72. Visual Studio에서 pfx 파일로 서명한 경우, 암호는 어디에 저장될까? [2]
1297정성태6/12/201230809VC++: 63. 다른 프로세스에 환경 변수 설정하는 방법파일 다운로드1
1296정성태6/5/201227483.NET Framework: 328. 해당 DLL이 Managed인지 / Unmanaged인지 확인하는 방법 - 두 번째 이야기 [4]파일 다운로드1
1295정성태6/5/201224915.NET Framework: 327. RSAParameters와 System.Numerics.BigInteger 이야기파일 다운로드1
1294정성태5/27/201248288.NET Framework: 326. 유니코드와 한글 - 유니코드와 닷넷을 이용한 한글 처리 [7]파일 다운로드2
1293정성태5/24/201229552.NET Framework: 325. System.Drawing.Bitmap 데이터를 Parallel.For로 처리하는 방법 [2]파일 다운로드1
1292정성태5/24/201223612.NET Framework: 324. First-chance exception에 대해 조건에 따라 디버거가 멈추게 할 수는 없을까? [1]파일 다운로드1
1291정성태5/23/201230052VC++: 62. 배열 초기화를 위한 기계어 코드 확인 [2]
1290정성태5/18/201234879.NET Framework: 323. 관리자 권한이 필요한 작업을 COM+에 대행 [7]파일 다운로드1
1289정성태5/17/201239034.NET Framework: 322. regsvcs.exe로 어셈블리 등록 시 시스템 변경 사항 [5]파일 다운로드2
1288정성태5/17/201226208.NET Framework: 321. regasm.exe로 어셈블리 등록 시 시스템 변경 사항 (3) - Type Library파일 다운로드1
1287정성태5/17/201229093.NET Framework: 320. regasm.exe로 어셈블리 등록 시 시스템 변경 사항 (2) - .NET 4.0 + .NET 2.0 [2]
1286정성태5/17/201238052.NET Framework: 319. regasm.exe로 어셈블리 등록 시 시스템 변경 사항 (1) - .NET 2.0 + x86/x64/AnyCPU [5]
1285정성태5/16/201233066.NET Framework: 318. gacutil.exe로 어셈블리 등록 시 시스템 변경 사항파일 다운로드1
1284정성태5/15/201225471오류 유형: 155. Windows Phone 연결 상태에서 DRIVER POWER STATE FAILURE 블루 스크린 뜨는 현상
1283정성태5/12/201233069.NET Framework: 317. C# 관점에서의 Observer 패턴 구현 [1]파일 다운로드1
1282정성태5/12/201225904Phone: 6. Windows Phone 7 Silverlight에서 Google Map 사용하는 방법 [3]파일 다운로드1
1281정성태5/9/201233010.NET Framework: 316. WPF/Silverlight의 그래픽 단위와 Anti-aliasing 처리를 이해하자 [1]파일 다운로드1
1280정성태5/9/201225946오류 유형: 154. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, ...'.
1279정성태5/9/201224725.NET Framework: 315. 해당 DLL이 Managed인지 / Unmanaged인지 확인하는 방법 [1]파일 다운로드1
1278정성태5/8/201225948오류 유형: 153. Visual Studio 디버깅 - Unable to break execution. This process is not currently executing the type of code that you selected to debug.
1277정성태5/8/201231151오류 유형: 152. cmd.exe - The system cannot write to the specified device. [2]
1276정성태4/28/201222935Phone: 5. 모든 Marketplace에 윈폰 앱을 등록하는 방법 [1]
1275정성태4/28/201226849개발 환경 구성: 150. 프로세스 실행으로 잠긴 파일이지만, 이름은 변경가능하다는 사실! 아셨나요? [7]
1274정성태4/17/201221414Phone: 4. "Holiday Calendar" 윈폰 응용 프로그램 등록
... 136  137  138  139  140  141  142  143  144  145  146  147  148  149  [150]  ...