Original Post
Hi! Every time, I want to start my Engine in the Release mode (instead of debug), it crashes! Does anyone had a similar problem?
Quote:That depends what "Crash" means. If it's an access violation, what address? What line of code causes it? Are you sure all pointers are valid on that line?
Original post by WuTz
Well, ok... What was it? What do I have to look for? :(
Quote:The compiler won't initialise them to anything - their value depends on whatever happened to be in memory before it and is essentially random.
Original post by Daivuk
But in Release, I think depending on your compiler configs, will automatically initialize them to zero, and bools to false.
Quote:If you turn on debug information for your release build you should be able to get a full call stack. Failing that, you can add some OutputDebugString() calls to see where it gets to before it crashes, and then work out what's wrong from there.
Original post by WuTz
Ok. It crashes in mvcrt.dll or msvcrt.dll, something like that. I only see Assembler code, but I will take a look, what happens before that crash. And I found some uninitialized variables. Maybe it works, when I init them all. Thanks for that fast help! :)
case WM_SIZE: GetClientRect(hDlg,&MainWnd); ViewportHW=NULL; ViewportHW=GetDlgItem(hDlg,IDC_Viewport); GetClientRect(ViewportHW,&ViewportWnd); if(MainWnd.right-50>5 && MainWnd.bottom-50>5 && ViewportHW) { SetWindowPos(ViewportHW,NULL,40,40,MainWnd.right-50,MainWnd.bottom-50,0); ///<------------------ HERE! } TheScene.UpdateWindowSize(); if(wParam==SIZE_MAXIMIZED)One exception (first Chance) at 0x00000000 in WTech DX10.exe: 0xC0000005: Access violation.One exception (first Chance) at 0x7787cdc9 in WTech DX10.exe: 0xC0000005: Access violation when reading at position 0x00000010.Unhanded exception 0x7787cdc9 in WTech DX10.exe: 0xC000041D: Unhanded exception while user-recall.Before SetWindowPos()Eine Ausnahme (erste Chance) bei 0x00000000 in WTech DX10.exe: 0xC0000005: Access violation.Eine Ausnahme (erste Chance) bei 0x7787cdc9 in WTech DX10.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00000010.Unbehandelte Ausnahme bei 0x7787cdc9 in WTech DX10.exe: 0xC000041D: Unbehandelte Ausnahme während eines Benutzerrückrufs.Das Programm "[3916] WTech DX10.exe: Systemeigen" wurde mit Code 0 (0x0) beendet.if(MainWnd.right-50>5 && MainWnd.bottom-50>5 && ViewportHW) { OutputDebugString(L"Before SetWindowPos()\n"); SetWindowPos(ViewportHW,NULL,40,40,MainWnd.right-50,MainWnd.bottom-50,0); OutputDebugString(L"After SetWindowPos()\n"); } OutputDebugString(L"Before UpdateWindowSize()\n"); TheScene.UpdateWindowSize(); OutputDebugString(L"After UpdateWindowSize()\n");LRESULT CALLBACK MainMsgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){ RECT MainWnd,ViewportWnd; HWND ViewportHW; D3DXVECTOR3 HitLoc; OPENFILENAME ofn; WCHAR szFile[MAX_PATH]; WCHAR p[MAX_PATH]; switch(uMsg) {//...
if(MainWnd.right-50>5 && MainWnd.bottom-50>5 && ViewportHW)00B6FC73 mov eax,dword ptr [esp+2Ch] 00B6FC77 mov ebp,dword ptr [__imp__SetWindowPos@28 (0B99448h)] 00B6FC7D add eax,0FFFFFFCEh 00B6FC80 cmp eax,5 00B6FC83 jle $LN41+7Eh (0B6FCCAh) 00B6FC85 mov ecx,dword ptr [esp+30h] 00B6FC89 add ecx,0FFFFFFCEh 00B6FC8C cmp ecx,5 00B6FC8F jle $LN41+7Eh (0B6FCCAh) 00B6FC91 test edi,edi 00B6FC93 je $LN41+7Eh (0B6FCCAh) { OutputDebugString(L"Before SetWindowPos()\n");00B6FC95 push offset string L"Before SetWindowPos("... (0B9FD3Ch) 00B6FC9A call dword ptr [__imp__OutputDebugStringW@4 (0B99064h)] SetWindowPos(ViewportHW,NULL,40,40,MainWnd.right-50,MainWnd.bottom-50,0);00B6FCA0 mov edx,dword ptr [esp+30h] 00B6FCA4 mov eax,dword ptr [esp+2Ch] 00B6FCA8 push 0 00B6FCAA add edx,0FFFFFFCEh 00B6FCAD push edx 00B6FCAE add eax,0FFFFFFCEh 00B6FCB1 push eax 00B6FCB2 push 28h 00B6FCB4 push 28h 00B6FCB6 push 0 00B6FCB8 push edi 00B6FCB9 call ebp OutputDebugString(L"After SetWindowPos()\n");00B6FCBB mov edi,dword ptr [__imp__OutputDebugStringW@4 (0B99064h)] //MSVC++ Marks this line with a green arrow...00B6FCC1 push offset string L"After SetWindowPos()"... (0B9FD10h) 00B6FCC6 call edi 00B6FCC8 jmp $LN41+84h (0B6FCD0h) 00B6FCCA mov edi,dword ptr [__imp__OutputDebugStringW@4 (0B99064h)] } OutputDebugString(L"Before UpdateWindowSize()\n");00B6FCD0 push offset string L"Before UpdateWindowS"... (0B9FCD8h) 00B6FCD5 call edi TheScene.UpdateWindowSize();00B6FCD7 mov ecx,offset TheScene (0BA9BD8h) 00B6FCDC call DX10Scene::UpdateWindowSize (0B71170h) OutputDebugString(L"After UpdateWindowSize()\n");This topic has been locked by a moderator. New replies are not allowed.
GameDev.net uses cookies to ensure you have the best experience on our platform. Learn more