Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#288 3 dimensional array bug.

closed-invalid
Earnie Boyd
MinGW (57)
2003-02-18
2003-02-18
No

I just wanted to report a possible gcc bug
(both gcc 3.2 and 3.2.2 have a problem with the
following code).
The program below compiles ok (with no warnings).
But when you try to run it, you get a stack overflow.
Its very interesting that a[100][100][75] works, but
a[100][100][100] compiles ok but blows up when running.

I'm running this on a Pentium III 600 MHZ PC with 384
MB of Ram
running Windows 2000 Professional, so there should be
plenty of
RAM available to hold this 3 dimensional array.

#include <stdio.h>
int main()
{
long a[100][100][100]; /* 3 dimensional Array */
printf("\nHello World\n");
return 0;
}

Please Email me at:
william.sternbach@citigroup.com and also
wgs77@juno.com

Thank you

William Sternbach

Discussion

  • Danny Smith
    Danny Smith
    2003-02-18

    Logged In: YES
    user_id=11494

    By default stack reserve is set to 2MB by ld.exe.
    Try setting stack reserve higher, eg,
    -Wl,--stack=0x2000000
    will get you 32MB stack reserve and the test will
    succeed.

    Danny

     
  • Danny Smith
    Danny Smith
    2003-02-18

    • status: open --> closed-invalid