Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm unsure if this question should be posted here or better on StackOverflow.com, but let's try here first.

Configuration is a Windows 2008 R2 64bit server running an ASP.NET 2.0 website. The project is deployed in form of a debug build already and built for "Any CPU". It is making use of external methods (see below) and also starts third party processes in order to perform certain tasks.

The servers crash frequently without showing any managed stacktrace. The IIS7 worker process just dies. I cannot pin it down to one specific action that would cause it. Setting up performance counters did not show anything weird. The servers are 64bit Win 2008 R2. My best guess is that the crashes are caused by one of the external methods used from the code. Can somebody make sense from the debugger output and the methods listed here? Is there a way to see if one of the methods below is responsible for the crash? I'm not experienced with inspecting crash dumps so I hope to get some help or inspiration here .

The debugger shows in the "Fields" section something that looks to me like a bunch of parameters being pushed on the stack. I'm wondering if these relate to one of the methods below?

Any other ideas how to proceed and what to try?

I suspect that the crashes are caused by one of these calls:

[DllImport( "urlmon.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false )]
static extern int FindMimeFromData( IntPtr pBC,
[MarshalAs( UnmanagedType.LPWStr )] string pwzUrl,
                     [MarshalAs( UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, SizeParamIndex = 3 )]
                     byte[] pBuffer,
                     int cbSize,
                     [MarshalAs( UnmanagedType.LPWStr )]  string pwzMimeProposed,
                     int dwMimeFlags,
                     out IntPtr ppwzMimeOut,
                     int dwReserved );
 
 
[DllImport( "advapi32.dll", SetLastError = true )]
              private static extern int LogonUser( string lpszUserName,
                     string lpszDomain,
                     string lpszPassword,
                     int dwLogonType,
                     int dwLogonProvider,
                     ref IntPtr phToken );
 
              [DllImport( "advapi32.dll", CharSet = CharSet.Auto, SetLastError = true )]
              private static extern int DuplicateToken( IntPtr hToken,
                     int impersonationLevel,
                     ref IntPtr hNewToken );
 
              [DllImport( "advapi32.dll", CharSet = CharSet.Auto, SetLastError = true )]
              private static extern bool RevertToSelf();
 
              [DllImport( "kernel32.dll", CharSet = CharSet.Auto )]
              private static extern bool CloseHandle( IntPtr handle );
 
[DllImport("kernel32.dll")]
        private static extern bool SetProcessWorkingSetSize (IntPtr oProc, int iMin, int iMax);
 
[DllImport( "query.dll", SetLastError = true, CharSet = CharSet.Unicode )]
        static extern int LoadIFilter( string pwcsPath, [MarshalAs( UnmanagedType.IUnknown )] object pUnkOuter, ref IFilter ppIUnk );
 
        [DllImport( "query.dll", SetLastError = true, CharSet = CharSet.Unicode )]
        static extern int BindIFilterFromStream( Stream pStm, [MarshalAs( UnmanagedType.IUnknown )] object pUnkOuter, ref IFilter ppIUnk );
       
        [ComImport, Guid( "89BCB740-6119-101A-BCB7-00DD010655AF" )]
        [InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
        private interface IFilter
        {
 
 
[DllImport(@"CMCOnBehalf_dll.dll", SetLastError = true,
                     CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
              public static extern int DoEnrollForMe(
                     string sUserId,
                     string sPFXPwd,
            string strSysPwd,
                     string sCAConfigName,
            string wszCATemplateName,
            string sCertSubjectName,
                     string sCertFileName,
            string strAltEmail,
            string strAltPrincipal
                     );
 
        // Late-binding...
        [DllImport(@"CMCOnBehalf_dll.dll", SetLastError = true,
                 CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
        public static extern int DoRenewForMe(
            string sUserId,
            string sPFXPwd,
            string strSysPwd,
            string sCAConfigName,
            string wszCATemplateName,
            string sInputSerial,
            string strInputSubject,
            string sCertFileName,
            string strAltEmail,
            string strAltPrincipal,
            ref string wszOutputSerial
            );
 
        // Late-binding...
              [DllImport(@"CMCOnBehalf_dll.dll", SetLastError = true,
                     CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
        public static extern int DoRevokeForMe(
                     string sSerialID,
                     string sCAConfigName
                     );
 
        // Late-binding...
              [DllImport(@"CMCOnBehalf_dll.dll",  SetLastError=true,
                     CharSet = CharSet.Auto, CallingConvention=CallingConvention.StdCall
                     )]
              public static extern int SetLogLevelForBlogger(
                     string   logFile,
                     int           cbLogLevel
                     );

This is the information I'm getting from WinDbg and the crash dumps:

MANAGED_OBJECT: !dumpobj 1a1583c80
Name: System.String
MethodTable: 000007fef9127ca0
EEClass: 000007fef8d2e550
Size: 2296(0x8f8) bytes
GC Generation: 0
(C:\Windows\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
String:    at System.Web.Hosting.UnsafeIISMethods.MgdIsLastNotification(IntPtr pRequestContext, RequestNotificationStatus dwStatus)
   at System.Web.HttpRuntime.FinishRequestNotification(IIS7WorkerRequest wr, HttpContext context, RequestNotificationStatus& status)
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
  at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
 
Fields:
              MT            Field           Offset                 Type VT             Attr            Value Name
000007fef912ef10  4000096        8         System.Int32  1 instance             1136 m_arrayLength
000007fef912ef10  4000097        c         System.Int32  1 instance             1135 m_stringLength
000007fef91296e8  4000098       10          System.Char  1 instance               20 m_firstChar
000007fef9127ca0  4000099       20        System.String  0   shared           static Empty
                                 >> Domain:Value  00000000002d1980:00000001bf690370 0000000001ab43f0:00000001bf690370 <<
000007fef9129598  400009a       28        System.Char[]  0   shared           static WhitespaceChars
                                 >> Domain:Value  00000000002d1980:00000001bf690b60 0000000001ab43f0:00000001df690390 <<
 
EXCEPTION_MESSAGE:  Attempted to read or write protected memory. This is often an indication that other memory is corru
 
MANAGED_OBJECT_NAME:  SYSTEM.ACCESSVIOLATIONEXCEPTION
 
MANAGED_STACK_COMMAND:  ** Check field   _remoteStackTraceString **;!do 1002be1e8;!do 1a1583c80
 
LAST_CONTROL_TRANSFER:  from 000007fef9d99413 to 000007fefd4fcacd
 
PRIMARY_PROBLEM_CLASS:  WRONG_SYMBOLS
 
BUGCHECK_STR:  APPLICATION_FAULT_WRONG_SYMBOLS_CLR_EXCEPTION
 
STACK_TEXT: 
00000000`00000000 00000000`00000000 unknown!System.Web.Hosting.UnsafeIISMethods.MgdIsLastNotification+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.HttpRuntime.FinishRequestNotification+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.HttpRuntime.ProcessRequestNotificationPrivate+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper+0x0
00000000`00000000 00000000`00000000 unknown!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification+0x0
 
 
 
 
0:048> !aspxpages
Going to dump the HttpContexts found in the heap.
Loading the heap objects into our cache.
HttpContext    Timeout  Completed     Running  ThreadId ReturnCode   Verb RequestPath+QueryString
0x0000000100233f88    11647 Sec        no        14 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x0000000100292250    36000 Sec        no         7 Sec     XXX        200   GET /systools/lbchecker.aspx
0x0000000160286d10    36000 Sec        no        14 Sec     XXX        200   GET /fs/getcustomerfile.aspx sconfigvalue=1%3a%3a2%3a%3a-1%3a%3a-1%3a%3av8.20-login-image.png&iheight=320&iwidth=-1&h=0e9784b59a8712a7518401629a908709b32f724f8b7c831ba045743a81a5fef0
0x0000000160293a30    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x00000001602ae740    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x00000001602c9450    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x00000001602e4160    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x00000001602fee70    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x0000000160319b80    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x0000000160334890    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x000000016034f5a0    11647 Sec        no        13 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x000000016036a378    11647 Sec        no        13 Sec      50        200   POST /testwebservice/v3/services.svc/IHome
0x000000018f6e4818    36000 Sec        no     68676 Sec     XXX        200   GET /systools/lbchecker.aspx
0x00000001903a2fc8    36000 Sec        no        14 Sec     XXX        200   GET /default.aspx cookieCheck=true
0x00000001904496c8    36000 Sec        no        14 Sec     XXX        200   POST /testadminservice/testadminservice.asmx
0x00000001b040efd8    36000 Sec        no        26 Sec     XXX        200   GET /newdr/drcontent.aspx intID=5538807
0x00000001b0435b60    36000 Sec        no         5 Sec     XXX        200   GET /systools/lbchecker.aspx
0x00000001c0383688    36000 Sec        no        25 Sec     XXX        200   GET /newdr/drcontent.aspx intID=5538807
0x00000001c0732f50    36000 Sec        no         9 Sec     XXX        200   POST /testadminservice/testadminservice.asmx/SystemTest
0x00000001d0661a60    11647 Sec        no        14 Sec     XXX        200   POST /testwebservice/v3/services.svc/IHome
0x00000001e051dd68    36000 Sec        no         8 Sec     XXX        200   GET /systools/lbchecker.aspx
0x00000001f0e03ff0    36000 Sec        no         5 Sec     XXX        200   GET /systools/lbchecker.aspx
Total 22 HttpContext objects
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.