Sunteți pe pagina 1din 3

5/9/2015

What is a Crash (technically)... in ASP.NET and what to do if it happens? - Rahul Soni's blog - Site Home - MSDN Blogs

What is a Crash (technically)... in ASP.NET and what to do if it happens?


imRahulSoni 1 Mar 2006 8:15 PM

ManytimeswhiletroubleshootingperformancerelatedissuesinASP.NET/IISwefindthatcustomerscomeinsaying
thattheASP.NETprocesscrashesnnumberoftimesaday,twoormore.Now,thequestionarises,thatisitreallya
crash,orsomeYellowcolorerrormessage(oraplain"Pagecannotbedisplayed"error)whichisshownonthe
client'sbrowser?Well,astheysay,everythingthatglittersisnotgold.Onsimilargrounds,everyerrorthrownonthe
browserisnotacrash.Weneedtokeepmultiplethingsinminddependingonwhatexactlycouldhavecausedthe
error,andbeforewedecidetocallitacrash,weshouldknowwhat*exactly*isacrash!Intheforthcomingseries
under"Performance"categoryofmyblog,IwilldiscussbasicsofCRASH,HANG,HIGHCPU,HIGHMEMORY,
DEADLOCKandOUTOFMEMORYissues.

Symptoms
PriortoIIS6,whenacrashhappeneditbroughtthedowntheIISandtheconnectionsremainedopen.Sotheclient
browserstypciallyseeadisconnectedconnectionandshows"Pagecannotbefound"orsomesimilarerror.
Now,inIIS6WorkerProcessIsolationMode,HTTP.SYStakescareoftheconnectionsinthekernelmodeitself.So
evenifw3wp.execrashesforsomereason,theconnectionremainsandIISspawnsanewprocesstohandlefuture
requests.Eventually,clientbrowserswillnotshow"Pagecannotbefound"error.But,anyunsentresponsefromthe
serverwillbelost.
IfyouopenyourEventVieweryoushouldfindasimilarErrorentryintheApplicationlog.
EventType:Error
EventSource:ASP.NET1.1.4322.0
EventCategory:None
EventID:1000<CRASH
Date:2/8/2006
Time:4:45:23AM
User:N/A
Computer:RAHULSONI
Description:
aspnet_wp.exe(PID:956)stoppedunexpectedly.
Or
Aprocessservingapplicationpool'<TheApplicationPoolName>'sufferedafatalcommunicationerror.
Or
Faultingapplicationw3wp.exe,version6.0.3790.1830,faultingmodule<modulename>,version<someversion
number>,faultaddress<someaddress>.
Or
Faultingapplicationw3wp.exe,version6.0.3790.1830,faultingmodule<modulename>,version<someversion
number>,faultaddress<someaddress>.

Whydoesithappen?
Well,itdepends!Buttogiveyouabriefidea,itcouldsimplybemanythings,like..."StackOverflow","Access
Violation","A*bad*dll","A*bad*filter",etcetcetc.Thebottomlineisthat,ASP.NET*crashed*becausesomething
reallybadhappenedanditfounditimpossibletocontinue.BUT...believeme,therearereasonstoit,andmoreoften
thannot,wecanfixit!

Whattodo?
Whensomethinggoeswrongwhilecoding,weDEBUG..."LIVE".Whensomethinggoeswronginyourproduction
box,weDEBUG...butthistimewedoitaftertheissuehashappened.ItiscalledPostProductiondebugging.For
that,wetypicallyrequireasetofmemorydump(itisnothingbutamemorysnapshotoftheASPNET_WP.exeor
W3Wp.exewhichiscapturedwhentheissuehappens).Ina*CRASH*scenario,sinceithappensautomaticallywe
mustdosomethingwhichcapturesthedataassoonastheissuemanifestsitselfagain.
1)Asyoumayguess,Weneedatooltocapturethememorydumps.Letsvisitthefollwinglink...
http://www.microsoft.com/windowsserver2003/iis/diagnostictools/default.mspx
2)YouneedtodownloadIISDiagnosticsToolkitdependingonyourOSversion
3)Installthesoftwareonyourproductionboxandrestassured,sincetheinstalldoesn'trequireanyreboot.
4)OpenDebugDiagnosticsTool1.0(Start>AllPrograms>IISDiagnostics(32bit)>DebugDiagnosticsTool)
5)OntheRulestab,click"AddRule"
6)Select"Crash"optionandclick"Next"
7)Select"AllIISProcesses"optionandclick"Next"
8)Under"AdvancedSettings",click"Breakpoints"
9)Click"AddBreakpoint"
10)Select"KERNEL32!ExitProcess"inthe"OffsetExpression"list.
11)Change"ActionType"to"FullUserDump"
12)Click"AddBreakpoint"
13)Select"Kernel32!TerminateProcess"inthe"OffsetExpression"list.
14)Change"ActionType"to"FullUserDump"
15)Click"SaveandClose"

http://blogs.msdn.com/b/rahulso/archive/2006/03/02/what-is-a-crash-technically-in-asp-net-and-what-to-do-if-it-happens.aspx

1/3

5/9/2015

What is a Crash (technically)... in ASP.NET and what to do if it happens? - Rahul Soni's blog - Site Home - MSDN Blogs

16)Click"Next","Next"and"Finish"
17)EnsurethatthestatusDebugDiagnostictoolsays,"Active"

18)Waitfortheissuetooccur.
19)Iftheissuehappensagain,youshouldbereadywithadump.TheUserdumpPathinthescreenshotabovewill
showyouthepathwherethedumpfilesaregenerated.
20)Now,themajorpartofcollectingthedumpisdone.Toanalyzeit,gototheDebugDiagnosticToolonceagain,
andclick"AdvancedAnalysis"tab.
21)Click"AddDataFiles"andbrowsetothedumpfile(.dmpextension,intheformataspnet_wp__PIDxxxxxxxx.dmp
orw3wp__PID__2716xxxxxxxx.dmp)
22)Inthe"AvailableAnalysisScripts"selectCrash/HangAnalyzersandclick"StartAnalysis"
23)Itmighttakesometimetoanalyzeyourdumpfile,sincethetoolwilltrytodownloadsymbols(moreonthislater)
fromtheinternet.
24)Oncetheanalysisiscompleteitwillcreatea.mhtfileandopenabrowserautomaticallyshowingtheanalysis.
25)Youmighttakealookintothereportandifyouarefortunateenough,youwillfindtheissuerightaway!!
Intheothercase,pleasevisitthefollowinglinkandchooseappropriatesupportoptionsuitedtoyourneed.Wewillbe
morethanhappytoassistyou!
http://www.microsoft.com/services/microsoftservices/srv_support.mspx
Hopethathelps!

DebugDiagCrash.GIF

Comments
Sean Gahan 2 Mar 2006 12:04 PM

Rahul,
Thank you for the info; I found it very informative. I have a question though it is a little off
topic. I use VS2003 along with Source Safe and ASP.NET does this thing that is very annoying;
whenever I switch the aspx page from html to design and the page is under source control, I
am prompted to check out the page. If the Source Safe checkout prompt only happened every
once and a while that would be one thing, but since it happens dozens of times a day it has
become very annoying. While I am complaining, I have one more issue. Occasionally when I
am using the design view for a page the cursor/mouse will get stuck in a part of the page.
Kind of like the mouse gets stuck inside a table and you can only move inside the area of the
table; that one is annoying too. Anyway, thanks for your post I found it useful, as well as your
other post on Datagrids. By the way check out this link, it has Ajax updating a Datagrid; its
pretty cool: http://aspalliance.com/773
Best regards,
Sean Gahan
imRahulSoni 2 Mar 2006 8:13 PM

VSS checkout could be annoying at times and I can understand that, but as a developer I
made it a habit to organize my work and checkout the files (which I needed for that session)
at one shot. And once I am done with the development, Check 'em all IN, at once. It worked
most of the times for me and had added advantage that no other person could check out
that file in the meantime.
But honestly, I have never seen that "mouse stuck" issue before. Although, I would like to
know that what happens if you use shortcuts, like F7 to go the code view and Shift+F7 to go
back to the design view. Does it still remain stuck??
Sean Gahan 3 Mar 2006 12:27 PM

Rahulso,
Your solution for checking out several items at once would work, but my question is why it
happens in the first place. Why is it when I wish to view a page in design mode that is under
source control I get prompted. What happens to the document when you switch to that view?
Also, the F7 is a good tip; I will try that next time.
Best regards,
Sean Gahan

Sean Gahan 4 Apr 2006 2:23 PM

Ok, it happened again; the cursor got stuck inside a table while I was using the design mode
while working on an asp.net page. Your suggestion of switching to the code (+/ Shift+F7) did
not work, and I also tried switching to the HTML view (Ctrl+PgDn) and that did not work either.
What did work was the Windows key + M to minimize all.
Best regards,

http://blogs.msdn.com/b/rahulso/archive/2006/03/02/what-is-a-crash-technically-in-asp-net-and-what-to-do-if-it-happens.aspx

2/3

5/9/2015

What is a Crash (technically)... in ASP.NET and what to do if it happens? - Rahul Soni's blog - Site Home - MSDN Blogs
Sean Gahan

ultranomad 3 Jul 2007 10:00 AM

How come I am getting IIS 6.0 error on IIS 5.0 with ASP .NET 2.0?

imRahulSoni 3 Jul 2007 4:48 PM

Hi ultranomad,
I am afraid, I didn't get your issue. What is the error message which you see?
JerryZhao 6 Aug 2007 10:02 AM

PostProductionDebuggingforASP.NETApplications

Options

http://blogs.msdn.com/b/rahulso/archive/2006/03/02/what-is-a-crash-technically-in-asp-net-and-what-to-do-if-it-happens.aspx

3/3

S-ar putea să vă placă și