StackOverflowException after Page.Unload - how to debug?

L

Lars-Erik Aabech

Hi!

I've got an asp.net page that works for all users except one and that one
user only gets the error with a certain parameter set to a certain value.
(Same value as the others, but for this one it fails). I manage to reproduce
the error on my development computer, but it's completely impossible to
debug or trace the error. The page had for some reason aspCompat set to
true, and that gave a short stack trace, when set to false there's none at
all. See copied content below. Anyone have any ideas how to find the cause
for this? (I can start eliminating data in the db for the relevant user, but
I'd like to get some input first)

As mentioned in the topic, the exception is thrown some time after
Page.Unload, and I haven't found any reasonable event or overload that
should be able to catch the exception. (Page.Error doesn't....) I don't get
any trace either.. I tried putting a Response.End() after base.Render() in a
Render overload and that made the page work as expected. All DB operations
both on postback and first request including rendering etc. etc. runs fine.

Without aspCompat:
---------
Exception of type System.StackOverflowException was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.StackOverflowException: Exception of type
System.StackOverflowException was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[StackOverflowException: Exception of type System.StackOverflowException was
thrown.]
---------

With aspCompat:
-------------
Exception of type System.StackOverflowException was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.StackOverflowException: Exception of type
System.StackOverflowException was thrown.

Source Error:

[No relevant source lines]


Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\webcompetence\87bc3de7\47398267\zksnyfrb.0.cs Line: 0

Stack Trace:

[StackOverflowException: Exception of type System.StackOverflowException was
thrown.]

[HttpException (0x80004005): Exception of type System.Web.HttpException was
thrown.]
System.Web.HttpAsyncResult.End()
System.Web.Util.AspCompatApplicationStep.EndAspCompatExecution(IAsyncResult
ar)
System.Web.UI.Page.AspCompatEndProcessRequest(IAsyncResult result)
ASP.samtaler_resultat_new_aspx.EndProcessRequest(IAsyncResult ar) in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\webcompetence\87bc3de7\47398267\zksnyfrb.0.cs:0
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult
ar)
 
A

Alvin Bruney [MVP - ASP.NET]

what COM component is this? check the author's website to see if they have
support fixes. Apparently, your COM component is going south when the page
unloads

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
Lars-Erik Aabech said:
Hi!

I've got an asp.net page that works for all users except one and that one
user only gets the error with a certain parameter set to a certain value.
(Same value as the others, but for this one it fails). I manage to
reproduce the error on my development computer, but it's completely
impossible to debug or trace the error. The page had for some reason
aspCompat set to true, and that gave a short stack trace, when set to
false there's none at all. See copied content below. Anyone have any ideas
how to find the cause for this? (I can start eliminating data in the db
for the relevant user, but I'd like to get some input first)

As mentioned in the topic, the exception is thrown some time after
Page.Unload, and I haven't found any reasonable event or overload that
should be able to catch the exception. (Page.Error doesn't....) I don't
get any trace either.. I tried putting a Response.End() after
base.Render() in a Render overload and that made the page work as
expected. All DB operations both on postback and first request including
rendering etc. etc. runs fine.

Without aspCompat:
---------
Exception of type System.StackOverflowException was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.StackOverflowException: Exception of type
System.StackOverflowException was thrown.

Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[StackOverflowException: Exception of type System.StackOverflowException
was thrown.]
---------

With aspCompat:
-------------
Exception of type System.StackOverflowException was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.StackOverflowException: Exception of type
System.StackOverflowException was thrown.

Source Error:

[No relevant source lines]


Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\webcompetence\87bc3de7\47398267\zksnyfrb.0.cs Line: 0

Stack Trace:

[StackOverflowException: Exception of type System.StackOverflowException
was thrown.]

[HttpException (0x80004005): Exception of type System.Web.HttpException
was thrown.]
System.Web.HttpAsyncResult.End()

System.Web.Util.AspCompatApplicationStep.EndAspCompatExecution(IAsyncResult
ar)
System.Web.UI.Page.AspCompatEndProcessRequest(IAsyncResult result)
ASP.samtaler_resultat_new_aspx.EndProcessRequest(IAsyncResult ar) in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
Files\webcompetence\87bc3de7\47398267\zksnyfrb.0.cs:0

System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult
ar)
 
S

Steven Cheng[MSFT]

Hi again L-E,

Seems you're still suffering some problems with your asp.net web
application. Is this one related to the former one and how did our PSS guys
go on it?

From your description and the call stack, seems there is few information we
can get from them. Are those COM components using in your web app your own
library or from some 3rd party ones? Would you provide some detail info on
the function of that COM component? Anyway, from my viewpoint, it's abit
hard to debug on the .net layer, we may need to dig into the unmanaged
world for such scenario. Also, since this is a user specific exception,
it'll be rather harder to trace.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
L

Lars-Erik Aabech

Hi guys! :)

Who mentioned COM? :p
I can't see anything in the exceptions implying this has to do with COM
interop?

Yup, I still have trouble with the app, thanks for noticing. :) I'm not sure
if it's related to my other problem, but it's the same page that starts the
mayhem (i think).

Anyway - this page doesn not need aspCompat, so I turned it off. There are
both third party and our own COM components here, in addition of course to
other .net libraries. I have no clue where to start, and still waiting for
response to our 200mb dump from yesterday relating to the other issue.

This one is not that critical tho, so I'm more interrested in hints about
how to proceed here than getting an actual solution. (Don't expect anyone to
tell me I have to change line 31 from crash() to dont_crash(). ;)
How can I trap the exact location the exception is thrown (when not in asp
compatibility mode)? I tried attaching the debugger to native in addition to
..net, but it doesn't break in any disassembled code. Not sure how I enable
JIT for unmanaged code...

L-E
 
S

Steven Cheng[MSFT]

Thanks for your response L-E,

OK. Since you mentioned the aspCompat, so I assumed that you again
encountered a COM problem:).

Well, since it's not a COM component, is it a pure .net component? As for
how to get the exact location of the exception, have you verified whether
the exception occured inside that 3rd party component or within your page's
code?

Also, to runtime debug the unmanaged code, the disassembled code is not
sufficient, we need the symbol or pdb file of the component and generally
those components are release version which don't contains info for us to
directly debug into code level. If you're trying to locate the error
location in asp.net, we can turn on the application's trace and output
trace statement in your page events so as to locate the problem.

BTW, since the error is user specific, I'm thinking whether it is related
to your appliation(include the IIS)'s authentication mode or any other
security things. Is there security related things in your application or
those components?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
L

Lars-Erik Aabech

Hi again!
Well, since it's not a COM component, is it a pure .net component? As for
how to get the exact location of the exception, have you verified whether
the exception occured inside that 3rd party component or within your
page's
code?

There are both third party and our own COM components here, in addition of
course to
other .net libraries. The exception occurs some time after Page_Unload, but
I haven't been able to trace/break at Dispose().
Also, to runtime debug the unmanaged code, the disassembled code is not
sufficient, we need the symbol or pdb file of the component and generally
those components are release version which don't contains info for us to
directly debug into code level. If you're trying to locate the error
location in asp.net, we can turn on the application's trace and output
trace statement in your page events so as to locate the problem.

Trace fails, since the exception is thrown outside of the page logic. (At
least the logic exposed to me)
Also, if I insert Response.End() in Page_Render() which makes the page run
fine, tracing is disabled. Can I force tracing here somehow? (Ignoring the
exception for instance, or forcing the current trace output?)
BTW, since the error is user specific, I'm thinking whether it is related
to your appliation(include the IIS)'s authentication mode or any other
security things. Is there security related things in your application or
those components?

The app is impersonating an administrator user and authenticates the users
through custom logic based on a cookie and a corresponding record in the DB.

L-E
 
S

Steven Cheng[MSFT]

Thanks for the response L-E,

So the exceptions occurs at the time out of our control. As for After
Unload , there seems something wrong at the time when disposing or realse
some of the components or COM objects. I'm still thinking it'll be better
if we can make the problem occur more frequently or regularly , is it
possible to repro the problem in a new created page which using those
components? If so, at least we can remove those components one by one to
isolate the cause.
Currently I also have no idea on any other better means ( if we can't
perform runtime debug or dump analysis as those PSS guys did ) How do you
think so?

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
L

Lars-Erik Aabech

Actually, I haven't thought about using the elimination method here. I'll
try commenting out block by block related to each object in the page. Thanks
for the idea. :) I haven't got full priority on this one at the time, so
I'll hold the thread untill I (eventually) find a solution.

Lars-Erik
 
S

Steven Cheng[MSFT]

OK. Hope we'll hear the good news from you soon :)

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top