Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-04

sig seg using fpc under freebsd - 10 line program enclosed

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Simon Lai

Hi,

I am evaluating fpc as an alternative to C for
a project which uses lots of large arrays, under
FreeBSD. The attached program however causes
a segmentation violation on entry to bomb.

-----------------------
Program t1;
const p=16777215;
procedure bomb;
  var d:array[0..p] of qword;
  begin
    d[0]:=0;
  end;

begin

  bomb;

end.
--------------
Array d is quite large but the physical
memory alone is sufficient to hold it on
this system (256Mb). If p<=8388389 the
test program runs fine.

Is there some compiler switch I need to turn
on?

regs

simon

__________________________________________________ Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Reply by email

Jonas
Simon Lai wrote
I am evaluating fpc as an alternative to C for a project which uses lots of large arrays, under FreeBSD. The attached program however causes a segmentation violation on entry to bomb.

The following program also sigsegv's under Linux:

***
void t()
{

  double test[16777216];
  test[0] = 0.0;

}

void main()
{

  t();

}
***

I think you are simply not allowed to use such a huge amount of stack space. Try using a dynamic structure instead.

Jonas

Reply by email