.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘process’

Unhandled exceptions cause ASP.NET-based applications to unexpectedly quit in the .NET Framework 2.0

Symptoms
When an unhandled exception is thrown in a Microsoft ASP.NET-based application that is built on the Microsoft .NET Framework 2.0, the application unexpectedly quits. When this problem occurs, no exception information that you must have to understanding the issue is logged in the Application log.
However, an event message that is similar to the following may be logged in the System log:
Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1009
Date: 9/28/2005
Time: 3:18:11
PM User: N/A
Computer: IIS-SERVER
Description:
A process serving application pool ‘DefaultAppPool’ terminated unexpectedly. The process id was ‘2548’. The process exit code was ‘0xe0434f4d’. Additionally, an event message that is similar to the following may be logged in the Application log:
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date: 9/28/2005
Time: 3:18:02 PM
User: N/A
Computer: IIS-SERVER
Description:
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 app_web_7437ep-9, P5 0.0.0.0, P6 433b1670, P7 9, P8 a, P9 system.exception, P10 NIL.
Resolution
This problem occurs because the default policy for unhandled exceptions has changed in the .NET Framework 2.0. By default, the policy for unhandled exceptions is to end the worker process.
In the Microsoft .NET Framework 1.1 and in the Microsoft .NET Framework 1.0, unhandled exceptions on managed threads were ignored. Unless you attached a debugger to catch the exception, you would not realize that anything was wrong.
ASP.NET uses the default policy for unhandled exceptions in the .NET Framework 2.0. When an unhandled exception is thrown, the ASP.NET-based application unexpectedly quits.
This behavior does not apply to exceptions that occur in the context of a request. These kinds of exceptions are still handled and wrapped by an HttpException object. Exceptions that occur in the context of a request do not cause the worker process to end. However, unhandled exceptions outside the context of a request, such as exceptions on a timer thread or in a callback function, cause the worker process to end.

PRB: An Access Violation Occurs If the Sqlsort.dll Version Is Not Compatible with the SQL Server Version

Symptoms
You receive one of the following error messages:When you connect to SQL Server 7.0 from SQL Server Enterprise Manager:

A connection could not be established to <ServerName>.
Reason: SqlDumpExceptionHandler: Process 7 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
Please verify SQL Server is running and check your SQL Server registration properties (by right-clicking on the ServerName node) and try again.-Or-When you click Alerts under SQL Server Agent in SQL Server Enterprise Manager:

Error O: SqlDumpExceptionHandler: Process 7 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.Additionally, the Errorlog file in SQL Server 7.0 contains one of the following stack dumps:

SqlDumpExceptionHandler: Process 7 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process..********************************************************************************* BEGIN STACK DUMP:*0x/xx/02 03:12:54 spid 7**Exception Address = 04004697 (Ordinal6 + 297)*Exception Code= c0000005 E*Access Violation occurred writing address 00000004* Input Buffer 54 bytes -*e x e cs p _ M S d b u s e r p r i vN ‘ v e r ‘ * …——-Short Stack Dump0×04004697 Module(sqlsort+4697) (Ordinal6+297)0×005bea83 Module(sqlservr+1bea83) (GetUnicodeRange+e7)0×00575825 Module(sqlservr+175825) (CLikeRangeUtil::LikeRangeTransW+2ec)0×00647680 Module(sqlservr+247680) (CXVariant::LikeRangeStart+7b)0×0056d35b Module(sqlservr+16d35b) (COptExpr::PexprFoldMain+103c)0×00443d71 Module(sqlservr+43d71) (COptExpr::PexprFoldMain+b8)0×00443c08 Module(sqlservr+43c08) (COptExpr::PexprFold+3f)0×004e0d3b Module(sqlservr+e0d3b) (CCvtTree::BuildSte+12e)0×004e0c15 Module(sqlservr+e0c15) (BuildSteFromTree+39)0×004e0b97 Module(sqlservr+e0b97) (CStmtCond::Init+4e)0×00438530 Module(sqlservr+38530) (CCompPlan::FCompileStep+f23)0×0043d00f Module(sqlservr+3d00f) (CProchdr::FCompile+5d9)0×0040ec53 Module(sqlservr+ec53) (CSQLSource::FTransform+234)0×0042140c Module(sqlservr+2140c) (CSQLObject::FTransform2+1ab)0×004e1cdc Module(sqlservr+e1cdc) (CSQLObject::FGetFromDisk+627)0×00420f96 Module(sqlservr+20f96) (CSQLObject::FTransform+21a)0×0040e7b9 Module(sqlservr+e7b9) (CSQLSource::Execute+11d)0×0046225f Module(sqlservr+6225f) (CStmtExec::XretLocalExec+127)0×0046211e Module(sqlservr+6211e) (CStmtExec::XretExecute+253)0×0040f487 Module(sqlservr+f487) (CMsqlExecContext::ExecuteStmts+11b)0×0040ef35 Module(sqlservr+ef35) (CMsqlExecContext::Execute+16b)—————————————————————————Error: 0, Severity: 19, State: 0language_exec: Process 7 generated an access violation. SQL Server is terminating this process. -Or-

********************************************************************************* BEGIN STACK DUMP:*0x/xx/02 16:49:07 spid 7**Exception Address = 105B498A*Exception Code= c0000005 E*Access Violation occurred reading address FFFFFFFF* Input Buffer 54 bytes -*e x e cs p _ M S d b u s e r p r i vN ‘ v e r ‘ ………Short Stack Dump0×105b498a Module(UNKNOWN+0)—————————————————————————Error: 0, Severity: 19, State: 0language_exec: Process 7 generated an access violation. SQL Server is terminating this process.***************************************************************************** BEGIN STACK DUMP:*0x/xx/02 16:47:50 spid 7**Exception Address = 105B48FA*Exception Code= c0000096 E* Input Buffer 188 bytes -*E X E C U T Em s d b . d b o . s p _ h e l p _ a l e r t@ o r d e *r _ b y=N ‘ s e v e r i t yA S C ,m e s s a g e _ i dA S *C ,d a t a b a s e _ n a m eD E S C ‘ *—————————————————————————Short Stack Dump0×105b48fa Module(UNKNOWN+0)—————————————————————————Error: 0, Severity: 19, State: 0language_exec: Process 7 generated an access violation. SQL Server is terminating this process.
Resolution
This behavior occurs if the versions of Sqlsort.dll and Sqlservr.exe are not compatible.

BUG: You receive an “EXCEPTION_ACCESS_VIOLATION” error message when you use a RIGHT OUTER JOIN clause in SQL Server 2000

Symptoms
In Microsoft SQL Server 2000, when you run a query that contains a RIGHT OUTER JOIN clause, you may receive an error message that is similar to the following:

ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
Connection Broken
Resolution
Service pack informationTo resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
290211?(http://support.microsoft.com/kb/290211/) How to obtain the latest SQL Server 2000 service pack

BUG: Unhandled exception filter not called inside debugger

Symptoms
Win32 processes can install an unhandled exception filter function to catchexceptions that are not handled in a __try/__except block on a process-widebasis. When debugging such a process, you find that the unhandled exceptionfilter is never executed, even when you put a breakpoint inside it.However, when the process is not being debugged, its unhandled exceptionfilter is called as expected.
Resolution
When called from a process being debugged, the UnhandledExceptionFilter()Win32 API function does not call the application-installed unhandledexception filter.
Note The UnhandledExceptionFilter() API determines whether the process is being debugged. If the process is being debugged, the UnhandledExceptionFilter API passes the exception to the debugger. Then, the UnhandledExceptionFilter API calls the unhandled exception filter for the process.

Application has generated an exception that could not be handled.

Symptoms
Application has generated an exception that could not be handled. Process id=0xc48(3144), Thread id=0×29c(668).Click OK to terminate the application.Click Cancel to debug the application.This error occurs when starting the Analytical Accounting Wizard from the FRx v6.7 Program Group on a Windows 2003 Server.
Resolution
This is a Code Access Security issue. This stand-alone application does not modify any .NET framework to allow for this to run successfully.

An unhandled exception may occur when you try to connect to an Access database from an ASP.NET worker process

Symptoms
An unhandled exception may occur under the following circumstances: An ASP.NET worker process (Aspnet_wp.exe) runs under the default ASPNET account.
-and-
You do not enable impersonation on that application.
-and-
You try to connect to or write to an Access database. Under these circumstances, you may receive one of the following exceptions:

The Microsoft Jet database engine cannot open the file ‘C:\Nwind.mdb’. It is already opened exclusively by another user, or you need permission to view its data.

Operation must use an updateable query.
Resolution
Because of security concerns, the ASP.NET worker process runs under the default ASPNET account. If you do not enable impersonation for an application, all of the threads that run the requests for that application run under the process account.
This problem occurs because the ASPNET account does not have sufficient permissions to connect to or write to an Access database.