Re: catching Runtime Stack Overflow Exception

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 09/02/04

  • Next message: Rob Snell: "Re: no bytes returned on raw socket;trying to implement ping"
    Date: Thu, 2 Sep 2004 21:27:07 +0100
    
    

    assaf <assafwo@hotmail.com> wrote:
    > there must be a way to prevent the application from crashing.
    > the stack-overflowing thread is just a background graphics analysis
    > operation.
    > my system should be able to recover from it.
    >
    > here is its code that blows up the stack:
    > RectangleF[] rects = this._Region..GetRegionScans(this._Matrix);
    >
    > as u can see, it is caused by a Region containing too many rectangles.
    > since a RectangleF is a struct, a value type,
    > the entire array is allocated on the stack.

    No it's not. Arrays themselves are *always* reference types. The values
    will be on the heap. It's more likely that GetRegionScans is recursing
    too deeply.

    -- 
    Jon Skeet - <skeet@pobox.com>
    http://www.pobox.com/~skeet
    If replying to the group, please do not mail me too
    

  • Next message: Rob Snell: "Re: no bytes returned on raw socket;trying to implement ping"

    Relevant Pages

    • Re: Accessing Command-line text
      ... PROC belongs to HLL. ... that happens very rarly, poluting the stack as you call it, doesnt seem to ... mov eax true ... (A region, inside, is an array of rectangles). ...
      (alt.lang.asm)
    • Re: I dont understand the definition of DOES>
      ... on stack on code entry). ... You can use DOES to make ARRAY and then use ARRAY ... CREATE CELLS ALLOT ... First you'd make the code that will execute on the child word. ...
      (comp.lang.forth)
    • Re: Globally declared arrays
      ... I noticed that my colleague was declaring local arrays on the stack, ... What is a "global array on ...
      (comp.lang.c)
    • Re: Use of PICK and ROLL
      ... An array, in contrast, may be accessed at any point: ... PICK and ROLL are therefore array operations, not stack ... I thuoght the point was that if you needed to change the search order ...
      (comp.lang.forth)
    • how does your language... make a map?
      ... "include"ed in the interpreter for testing. ... Since Forth uses a Last-in-First-out implicit stack, ... variable cols ... I want to create an array that will in the future contain all the ...
      (rec.games.roguelike.development)