From: PeterOut on
I am using Microsoft Visual C++ 7.1 on Windows XP.

I get a stack overflow at
test dword ptr [ecx],eax ; ...probe it
in chkstk.asm

but there is no recursion.

I get this apparent stack overflow with the following call stack

_____________________________________________________________________________

> ProgName.exe!_chkstk() Line 91 Asm
ProgName.exe!CThreeD::GetPoints(FloatPlane_Struct *
fppInputPlanes=0x0147fee8, int bAlignPlanes=1) Line 61 + 0x14 C++
ProgName.exe!CProgNameApp::GetControlPoints(char * *
cspNameBuffer=0x019caf68, long lNumberOfDocumentsSelected=2, long *
lpSelectedIndices=0x01b4efa8) Line 6069 + 0x19 C++
ProgName.exe!CProgNameApp::OnGetpoints() Line 5691 + 0x1d C++
mfc71d.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x0061a008,
unsigned int nID=32864, int nCode=0, void (void)* pfn=0x004ab657, void
* pExtra=0x00000000, unsigned int nSig=53, AFX_CMDHANDLERINFO *
pHandlerInfo=0x00000000) Line 89 C++
mfc71d.dll!CCmdTarget::OnCmdMsg(unsigned int nID=32864, int nCode=0,
void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)
Line 396 + 0x27 C++
mfc71d.dll!CFrameWnd::OnCmdMsg(unsigned int nID=32864, int nCode=0,
void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)
Line 902 + 0x21 C++
mfc71d.dll!CWnd::OnCommand(unsigned int wParam=32864, long lParam=0)
Line 2550 C++
mfc71d.dll!CFrameWnd::OnCommand(unsigned int wParam=32864, long
lParam=0) Line 320 C++
mfc71d.dll!CWnd::OnWndMsg(unsigned int message=273, unsigned int
wParam=32864, long lParam=0, long * pResult=0x0012fadc) Line 1759 +
0x1c C++
mfc71d.dll!CWnd::WindowProc(unsigned int message=273, unsigned int
wParam=32864, long lParam=0) Line 1745 + 0x1e C++
mfc71d.dll!AfxCallWndProc(CWnd * pWnd=0x00c76e00, HWND__ *
hWnd=0x00891dbc, unsigned int nMsg=273, unsigned int wParam=32864, long
lParam=0) Line 241 + 0x1a C++
mfc71d.dll!CMDIFrameWnd::OnCommand(unsigned int wParam=32864, long
lParam=0) Line 51 + 0x23 C++
mfc71d.dll!CWnd::OnWndMsg(unsigned int message=273, unsigned int
wParam=32864, long lParam=0, long * pResult=0x0012fca4) Line 1759 +
0x1c C++
mfc71d.dll!CWnd::WindowProc(unsigned int message=273, unsigned int
wParam=32864, long lParam=0) Line 1745 + 0x1e C++
mfc71d.dll!AfxCallWndProc(CWnd * pWnd=0x00c75138, HWND__ *
hWnd=0x001a1e46, unsigned int nMsg=273, unsigned int wParam=32864, long
lParam=0) Line 241 + 0x1a C++
mfc71d.dll!AfxWndProc(HWND__ * hWnd=0x001a1e46, unsigned int
nMsg=273, unsigned int wParam=32864, long lParam=0) Line 389 C++
mfc71d.dll!AfxWndProcBase(HWND__ * hWnd=0x001a1e46, unsigned int
nMsg=273, unsigned int wParam=32864, long lParam=0) Line 209 +
0x15 C++
user32.dll!77d48734()
user32.dll!77d48816()
mfc71d.dll!CMapPtrToPtr::GetValueAt(void * key=0x00000000) Line 185
+ 0xc C++
user32.dll!77d489cd()
ntdll.dll!7c915b4f()
user32.dll!77d496c7()
mfc71d.dll!AfxInternalPumpMessage() Line 188 C++
mfc71d.dll!CWinThread::PumpMessage() Line 916 C++
mfc71d.dll!CWinThread::Run() Line 637 + 0xb C++
mfc71d.dll!CWinApp::Run() Line 701 C++
mfc71d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__
* hPrevInstance=0x00000000, char * lpCmdLine=0x00141f0a, int
nCmdShow=1) Line 49 + 0xb C++
ProgName.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__
* hPrevInstance=0x00000000, char * lpCmdLine=0x00141f0a, int
nCmdShow=1) Line 25 C++
ProgName.exe!WinMainCRTStartup() Line 390 + 0x39 C
kernel32.dll!7c816d4f()
ntdll.dll!7c915b4f()
kernel32.dll!7c8399f3()
___________________________________________________________________________

I understand that the stack size can be set using
Project: ProgName Properties: Linker: System: (Stack Reserve Size &
Stack Commit Size)

By default, these are set to zero. Presumably, this means that they
are set automatically. When I try to set these manually, it does not
even get as far as with zeros, despite how large the numbers I put.
Then I had this additional problem when I set the values back to 0.
Fortunately, I had made a copy of the .suo file so was able to get back
to where I was before I tried to fix the problem.

Can anyone see why I am getting a stack overflow and how I can fix the
problem?

Many thanks in advance,
Peter.

 | 
Pages: 1
Prev: Problem using AWE
Next: Bug in VC8?