ElDonAntonio
Senior member
My big bro just asked me to help him port a program he did as part of his PhD thesis from SGI to Windows.
I got it to compile fine with minimal changes, but I get a stack overflow error right at the beginning of a function being called from main.
I tried tracing, and the stack overflow occurs right at the opening bracket of the function. I turned on dissassembly, and here's what I saw:
void function (blablabla)
710: {
0043AF80 push ebp
0043AF81 mov ebp,esp
0043AF83 mov eax,offset MESH_3D_ALTERED+0ABF70h (00532068)
0043AF88 call $$$00001 (004271b0) <=== STACK OVERFLOW
0043AF8D push ebx
0043AF8E push esi
0043AF8F push edi
0043AF90 lea edi,[ebp-532068h]
0043AF96 mov ecx,14C81Ah
0043AF9B mov eax,0CCCCCCCCh
0043AFA0 rep stos dword ptr [edi]
[C++ CODE]
...
From what I understand, the function tries to allocate too much memory from the stack. I looked in to the function, and if I remove a 5-dim static array of about 600 000 double values, the error goes away (so does the program's usefulness though).
It's the first time I encounter such a weird error, what's going on, and how do I solve that?
Thanks guys!
I got it to compile fine with minimal changes, but I get a stack overflow error right at the beginning of a function being called from main.
I tried tracing, and the stack overflow occurs right at the opening bracket of the function. I turned on dissassembly, and here's what I saw:
void function (blablabla)
710: {
0043AF80 push ebp
0043AF81 mov ebp,esp
0043AF83 mov eax,offset MESH_3D_ALTERED+0ABF70h (00532068)
0043AF88 call $$$00001 (004271b0) <=== STACK OVERFLOW
0043AF8D push ebx
0043AF8E push esi
0043AF8F push edi
0043AF90 lea edi,[ebp-532068h]
0043AF96 mov ecx,14C81Ah
0043AF9B mov eax,0CCCCCCCCh
0043AFA0 rep stos dword ptr [edi]
[C++ CODE]
...
From what I understand, the function tries to allocate too much memory from the stack. I looked in to the function, and if I remove a 5-dim static array of about 600 000 double values, the error goes away (so does the program's usefulness though).
It's the first time I encounter such a weird error, what's going on, and how do I solve that?
Thanks guys!