Stack overflow exception

Discussion in 'ASP .Net' started by =?Utf-8?B?amJpeEBuZXdzZ3JvdXBzLm5vc3BhbQ==?=, Apr 20, 2004.

  1. We have a stack overflow happening. We are NOT doing any recusion. We do have an object being created in Global that is being handed the Context (which I assume is specific to the request thread). This object does in turn does create several other objects, but therer is no memberwise cloning or deep copies. So, we are at a loss why we are running out of stack so early.

    Is there a way to monitor the stack size at runtime to see if we can catch the error?
    Is it unwise to create objects in Global? Is this somehow creating many objects in the pipeline?
    Out undstanding is a set of objects created in a request thread are bound to that request and are deleted at the end of the request thread?
    Does the GC run while in debug?
    =?Utf-8?B?amJpeEBuZXdzZ3JvdXBzLm5vc3BhbQ==?=, Apr 20, 2004
    #1
    1. Advertising

  2. Hi,

    In 99.9% of the cases stack overflow is because of an error in the code. But
    without seeing any of your code I'm afraid it is not possinble to tell you
    more.

    Greetings
    Martin
    "" <Mr. Bix> wrote in message
    news:...
    > We have a stack overflow happening. We are NOT doing any recusion. We do

    have an object being created in Global that is being handed the Context
    (which I assume is specific to the request thread). This object does in
    turn does create several other objects, but therer is no memberwise cloning
    or deep copies. So, we are at a loss why we are running out of stack so
    early.
    >
    > Is there a way to monitor the stack size at runtime to see if we can catch

    the error?
    > Is it unwise to create objects in Global? Is this somehow creating many

    objects in the pipeline?
    > Out undstanding is a set of objects created in a request thread are bound

    to that request and are deleted at the end of the request thread?
    > Does the GC run while in debug?
    Martin Dechev, Apr 21, 2004
    #2
    1. Advertising

  3. Can you reproduce the error at will in a debugger environment? If yes, press
    CTRL + ALT + E, set it to break into the debugger on all exceptions and let
    the application run to reproduce the bug. The exception will stop at the
    offending line of code. That's the easy part. Writing robust code is what is
    difficult.

    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/27cok
    "" <Mr. Bix> wrote in message
    news:...
    > We have a stack overflow happening. We are NOT doing any recusion. We do
    > have an object being created in Global that is being handed the Context
    > (which I assume is specific to the request thread). This object does in
    > turn does create several other objects, but therer is no memberwise
    > cloning or deep copies. So, we are at a loss why we are running out of
    > stack so early.
    >
    > Is there a way to monitor the stack size at runtime to see if we can catch
    > the error?
    > Is it unwise to create objects in Global? Is this somehow creating many
    > objects in the pipeline?
    > Out undstanding is a set of objects created in a request thread are bound
    > to that request and are deleted at the end of the request thread?
    > Does the GC run while in debug?
    Alvin Bruney [MVP], Apr 21, 2004
    #3
  4. Ok...I understand your overall answer, but....

    I am still curious about
    Is there a way to monitor the stack size at runtime to see if we can catc
    the error

    Our undstanding is a set of objects created in a request thread are boun
    to that request and are deleted at the end of the request thread

    Does the GC run while in debug


    ----- Martin Dechev wrote: ----

    Hi

    In 99.9% of the cases stack overflow is because of an error in the code. Bu
    without seeing any of your code I'm afraid it is not possinble to tell yo
    more

    Greeting
    Marti
    "" <Mr. Bix> wrote in messag
    news:..
    > We have a stack overflow happening. We are NOT doing any recusion. We d

    have an object being created in Global that is being handed the Contex
    (which I assume is specific to the request thread). This object does i
    turn does create several other objects, but therer is no memberwise clonin
    or deep copies. So, we are at a loss why we are running out of stack s
    early
    >> Is there a way to monitor the stack size at runtime to see if we can catc

    the error
    > Is it unwise to create objects in Global? Is this somehow creating man

    objects in the pipeline
    > Out undstanding is a set of objects created in a request thread are boun

    to that request and are deleted at the end of the request thread
    > Does the GC run while in debug
    =?Utf-8?B?TXIgQml4?=, Apr 21, 2004
    #4
  5. Hi Mr Bix,

    I may be able to be of a little more help here. Stack Overflows are almost
    always caused by either infinte looping or infinite recursion. So, check
    your loops, and if you have any recursive functions, check them too.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Mr Bix" <> wrote in message
    news:...
    > Ok...I understand your overall answer, but....
    >
    > I am still curious about:
    > Is there a way to monitor the stack size at runtime to see if we can catch
    > the error?
    >
    > Our undstanding is a set of objects created in a request thread are bound
    > to that request and are deleted at the end of the request thread?
    >
    > Does the GC run while in debug?
    >
    >
    > ----- Martin Dechev wrote: -----
    >
    > Hi,
    >
    > In 99.9% of the cases stack overflow is because of an error in the

    code. But
    > without seeing any of your code I'm afraid it is not possinble to

    tell you
    > more.
    >
    > Greetings
    > Martin
    > "" <Mr. Bix> wrote in message
    > news:...
    > > We have a stack overflow happening. We are NOT doing any recusion.

    We do
    > have an object being created in Global that is being handed the

    Context
    > (which I assume is specific to the request thread). This object does

    in
    > turn does create several other objects, but therer is no memberwise

    cloning
    > or deep copies. So, we are at a loss why we are running out of stack

    so
    > early.
    > >> Is there a way to monitor the stack size at runtime to see if we

    can catch
    > the error?
    > > Is it unwise to create objects in Global? Is this somehow creating

    many
    > objects in the pipeline?
    > > Out undstanding is a set of objects created in a request thread are

    bound
    > to that request and are deleted at the end of the request thread?
    > > Does the GC run while in debug?

    >
    >
    Kevin Spencer, Apr 21, 2004
    #5
  6. =?Utf-8?B?amJpeEBuZXdzZ3JvdXBzLm5vc3BhbQ==?=

    Rick Spiewak Guest

    Is it possible that a property setter or getter in your object is
    inadvertantly referring to itself (not that I've ever done this <g>).
    i.e. -
    Private _foo as object
    Public Property Foo() as object
    Get
    Return Foo 'should be Return _foo
    End Get
    ..
    ..
    ..

    End Property

    "" <Mr. Bix> wrote in message
    news:...
    > We have a stack overflow happening. We are NOT doing any recusion. We do

    have an object being created in Global that is being handed the Context
    (which I assume is specific to the request thread). This object does in
    turn does create several other objects, but therer is no memberwise cloning
    or deep copies. So, we are at a loss why we are running out of stack so
    early.
    >
    > Is there a way to monitor the stack size at runtime to see if we can catch

    the error?
    > Is it unwise to create objects in Global? Is this somehow creating many

    objects in the pipeline?
    > Out undstanding is a set of objects created in a request thread are bound

    to that request and are deleted at the end of the request thread?
    > Does the GC run while in debug?
    Rick Spiewak, Apr 22, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr m?ll
    Replies:
    2
    Views:
    1,399
    Mr m?ll
    Oct 16, 2004
  2. Replies:
    0
    Views:
    497
  3. stack overflow exception

    , Oct 16, 2006, in forum: C Programming
    Replies:
    5
    Views:
    383
    Peter Shaggy Haywood
    Oct 19, 2006
  4. Debajit Adhikary
    Replies:
    36
    Views:
    2,289
    Andre Kaufmann
    Feb 10, 2011
  5. Kenneth McDonald

    Why stack overflow with such a small stack?

    Kenneth McDonald, Aug 30, 2007, in forum: Ruby
    Replies:
    7
    Views:
    259
    Kenneth McDonald
    Sep 1, 2007
Loading...

Share This Page