Author Topic: Out Of Stack Range  (Read 1045 times)

0 Members and 1 Guest are viewing this topic.

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Out Of Stack Range
« on: February 10, 2009, 12:59:35 pm »
Code: [Select]
09-02-10 16:21:53  [*] [Error] Test -> (AppOnIdle): Out Of Stack Range
09-02-10 16:21:53  [*] [Error] Test -> (OnLeaveGame): Out Of Stack Range

I encountered an error calling Out Of Stack Range.
What does it exactly mean?
« Last Edit: February 10, 2009, 02:19:07 pm by Markus Quär »
Soldat Global Account System: #soldat.sgas @ quakenet

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Out Of Stack Range
« Reply #1 on: February 10, 2009, 05:46:31 pm »
What code is doing this?

I don't know for sure but it sounds like you've run out of stack space.

Probably wrong there though.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Out Of Stack Range
« Reply #2 on: February 10, 2009, 08:20:31 pm »
Kinda reminds me of Out Of Range, but slightly different. Just point out the obvious :)

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Re: Out Of Stack Range
« Reply #3 on: February 11, 2009, 09:18:22 am »
What code is doing this?

The code is about 1500 lines but I could figure out that the error may occurs due to my QuickSort function.

I don't know for sure but it sounds like you've run out of stack space.

Exactly. Especially because the function calls itself recursively and if there's a bug in it the function will never determine...

Code: [Select]
procedure QuickIntSort(var Field: array of string; Left, Right, SortBy: integer);
var
  l, r, Pivot: integer;
  Buffer: string;
begin
  if (Left < Right) then
  begin
    l:= Left;
    r:= Right;
    Pivot:= StrToInt(GetPiece(Field[(Left + Right) shr 1], #9, SortBy));
    repeat
      while (StrToInt(GetPiece(Field[l], #9, SortBy)) > Pivot) do
      begin
        Inc(l, 1);
      end;
      while (StrToInt(GetPiece(Field[r], #9, SortBy)) < Pivot) do
      begin
        Dec(r, 1);
      end;
      if (l <= r) then
      begin
        Buffer:= Field[r];
        Field[r]:= Field[l];
        Field[l]:= Buffer;
        Inc(l, 1);
        Dec(r, 1);
      end;
    until (l >= r);
    if (Left < r) then
    begin
      QuickIntSort(Field, Left, r, SortBy);
    end;
    if (Right > l) then
    begin
      QuickIntSort(Field, l, Right, SortBy);
    end;
  end else
  begin
    exit;
  end;
end;

Kinda reminds me of Out Of Range, but slightly different. Just point out the obvious :)

Yeah, me too. I'm still not sure which function causes this error.
Soldat Global Account System: #soldat.sgas @ quakenet

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Out Of Stack Range
« Reply #4 on: February 11, 2009, 09:22:49 am »
put em inside "try except end" blocks?

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Out Of Stack Range
« Reply #5 on: February 11, 2009, 03:38:45 pm »
Oh yeahh stack kuz it called itself too much and hit the limit, i guess. :P