How can I see which request caused IIS7 to reset due to a stackoverflow?
My IIS7 webservers are getting hundreds of requests a second, and at a known time a stackoverflow caused IIS7 to recycle the app pool. How can I see which request contained the stackoverflow, and ideally what the stack trace was in that request when IIS decided to kill the app pool?
How do you know it's a stack overflow? Whatever's reporting this would seem to be reporting that the process crashed.
Get set up for next time - run DebugDiag 1.2 or a crash-mode debugger against the process and get set up for a memory dump on crash.
So in short:
- Work out the PID of the app pool for the current instance (you might want to turn off recycling so that it doesn't keep changing; or use DebugDiag, which can target an App Pool across PIDs)
- ADPLUS / PROCDUMP -P PID -CRASH (or run DebugDiag with a Crash rule for that App Pool)
- Get the dump file, and feed it into DebugDiag
- Look for particularly long thread stacks