i'm a chinese, the problem between release version and debug

Problems building or running the engine, queries about how to use features etc.
opoppopopp
Gnoblar
Posts: 14
Joined: Mon Jan 24, 2005 11:14 am

i'm a chinese, the problem between release version and debug

Post by opoppopopp »

first sorry for my english... :wink:
i set up my own project follow the tutorial, try to compile the 'SkyPlane'.
i create my own directory,put the 'SkyPlane.h' and 'SkyPlane.cpp' in it,
setting the VC6 in order to let VC6 can find the 'ExampleApplication.h' and .cpp. Add the ogremain_d.lib into the link..(that is in the debug mode. in the release,you know,i add the ogremain.lib)

then i compile and link, OK.no problem.

but when i try to 'Debug' it (press F5 in VC6) it report some error.
i excute it in the sample/common/..../. it crash.

BUT I REALLY PASS the COMPILE and LINK!
The RELEASE virsion is OK !! why?

this is some of the VC6's error message:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded symbols for 'D:\d\develop\BIG_OGRE\ogrenew\Samples\Common\bin\Debug\OgreMain_d.dll'
Loaded 'D:\d\develop\BIG_OGRE\ogrenew\Samples\Common\bin\Debug\stlport_vc6_stldebug45.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MSVCP60D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded 'D:\d\develop\BIG_OGRE\ogrenew\Samples\Common\bin\Debug\devil.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'D:\d\develop\BIG_OGRE\ogrenew\Samples\Common\bin\Debug\ilu.dll', no matching symbolic information found.
Loaded 'D:\d\develop\BIG_OGRE\ogrenew\Samples\Common\bin\Debug\stlport_vc645.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\msvcp60.dll'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
First-chance exception in MYOGRE.exe (NTDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in MYOGRE.exe (NTDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in MYOGRE.exe (NTDLL.DLL): 0xC0000005: Access Violation.
The program 'D:\d\develop\BIG_OGRE\ogrenew\Samples\Common\bin\Debug\MYOGRE.exe' has exited with code 0 (0x0).
thank you thank you...
sorry for my english... again:wink:
态度决定一切…
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia

Post by monster »

Have you used your debugger to step through the code and find out where exactly it crashes?
opoppopopp
Gnoblar
Posts: 14
Joined: Mon Jan 24, 2005 11:14 am

Post by opoppopopp »

Deleting intermediate files and output files for project 'MYOGRE - Win32 Debug'.
--------------------Configuration: MYOGRE - Win32 Debug--------------------
Compiling...
SkyPlane.cpp
Linking...

MYOGRE.exe - 0 error(s), 0 warning(s)
then i F5 began to debug run..
and:
->77F5234E mov dword ptr [ecx+4],eax
77F52351 mov al,byte ptr [esi+5]
77F52354 mov byte ptr [ebp-5Dh],al
77F52357 movzx eax,word ptr [esi]
77F5235A mov edi,dword ptr [ebp-1Ch]
77F5235D sub dword ptr [edi+28h],eax
77F52360 mov dword ptr [ebp-74h],esi
77F52363 mov byte ptr [esi+5],1
77F52367 movzx ebx,word ptr [esi]
77F5236A mov eax,dword ptr [ebp-3Ch]
77F5236D sub ebx,eax
if i run my app in the '...\ogrenew\Samples\Common\bin\Debug'
AppName: myogre.exe AppVer: 0.0.0.0 ModName: ntdll.dll
ModVer: 5.1.2600.1106 Offset: 0000234e
AppName: myogre.exe AppVer: 0.0.0.0 ModName: ntdll.dll
ModVer: 5.1.2600.1106 Offset: 0000674b
态度决定一切…
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia

Post by monster »

You need to at least get a proper stack trace, set breakpoints and step through the code to find out which actual source code line it's failing on, and what the values of the variables at that point are.

That little snippet of assembler could mean anything!

Also, check the Ogre log for any errors.

That access violation error is almost certainly a stray pointer problem, but without knowing more about the code that's causing it, it's impossible to say.
opoppopopp
Gnoblar
Posts: 14
Joined: Mon Jan 24, 2005 11:14 am

Post by opoppopopp »

you mean this : ?? :(
// We don't want to assert with random failures, because we want the application to deal with them.

#ifndef RANDOM_FAILURE
// If you hit this assert, then the requested allocation simply failed
// (you're out of memory.) Interrogate the variable 'au' or the stack
// frame to see what you were trying to do.
m_assert( au->actualAddress != NULL );
#endif

if( au->actualAddress == NULL)

{
throw "Request for allocation failed. Out of memory.";
}
and:
Loaded symbols for 'C:\WINDOWS\system32\msvcp60.dll'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
First-chance exception in MYOGRE.exe (NTDLL.DLL): 0xC0000005: Access Violation.
态度决定一切…
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia

Post by monster »

Possibly, the key bit there is that the way forward is to do exactly what it says in the comments in the code you posted;

Code: Select all

// If you hit this assert, then the requested allocation simply failed
// (you're out of memory.) Interrogate the variable 'au' or the stack
// frame to see what you were trying to do.
i.e. find out how much memory you're trying to allocate, and which bit of your code called this allocation routine.

A full stack trace would still be handy, as would the line of your code that's causing the problem.
iq
Greenskin
Posts: 125
Joined: Mon Oct 20, 2003 8:25 pm

Post by iq »

Add _STLP_DEBUG to the projects settings.