Debugging STK on Windows

Debugging STK on Windows

Postby asciimonster » 05 Jan 2011, 13:40

(Continued from here)

hiker {l Wrote}:
asciimonster {l Wrote}:
hiker {l Wrote}:Just download Visual Studio Express C++ from Microsoft

OK that worked, but as I haven't figured out how to couple the sources the results don't mean much to me... I guess they are not of any use to you either.

Hmm - is this a debug build? You should get more than just a hex address :) (select Projects, properties, then check the configuration manager).

Um no, I just imported supertuxkart.exe and run debug. I assume you have to couple it with the sourcecode somehow... I'll see if I can get the code from SVN.
If I have to recompile the exe this may severely skew the results because I'm using another version AND have a different environment (if the code will compile al all, which is always something like pressing the button and pray).
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby Auria » 05 Jan 2011, 20:11

I'm not very good at windows so I'll let Joerg confirm, but I don't think you need to couple with the source code, if it works anything like on linux/OSX. You should just be able to launch STK in the debugger, then get a useful backtrace when it crashes
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Debugging STK on Windows

Postby hiker » 05 Jan 2011, 23:39

asciimonster {l Wrote}:Um no, I just imported supertuxkart.exe and run debug. I assume you have to couple it with the sourcecode somehow... I'll see if I can get the code from SVN.
If I have to recompile the exe this may severely skew the results because I'm using another version AND have a different environment (if the code will compile al all, which is always something like pressing the button and pray).

No, just importing the executable doesn't do anything, and I don't think that you will be able to couple the exe with source code (since it contains no debug information).

SVN would be best (since then we can easily add fixes for you to test), otherwise as a start you could just download the src package of 0.7, and make sure that you can reproduce the problem.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby asciimonster » 06 Jan 2011, 22:36

What a frustration. No matter what I do I keep running into dependency problems.

The best I got was:
{l Code}: {l Select All Code}
1>d:\users\françois\supertuxkart_svn\src\audio/sfx_buffer.hpp(27): fatal error C1083: Cannot open include file: 'AL/al.h': No such file or directory

But nowhere I can find the source code for OpenAL (Their SVN has no anonymous access) drivers
I got the include of irrlicht.
Big problem: Even if I have the correct .h files, the compiler can't find them (in incorrect folder), but I just cannot fin an option somewhere where you can set include directories for the compiler. Now, I am forced to move all the .h files around but it keep throwing errors.... :x
Last edited by asciimonster on 06 Jan 2011, 22:58, edited 1 time in total.
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby hiker » 06 Jan 2011, 22:45

asciimonster {l Wrote}:What a frustration. No matter what I do I keep running into dependency problems.

The best I got was:
{l Code}: {l Select All Code}
1>d:\users\françois\supertuxkart_svn\src\audio/sfx_buffer.hpp(27): fatal error C1083: Cannot open include file: 'AL/al.h': No such file or directory

But nowhere I can find the source code for OpenAL (Their SVN has no anonymous access) drivers

Download the stk dependency package for windows from the stk sourceforge page, it includes everything you need! Just put it 'next to src' (i.e. STK_DIR/src and STK_DIR/dependencies).

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby asciimonster » 06 Jan 2011, 23:31

hiker {l Wrote}:Download the stk dependency package for windows from the stk sourceforge page, it includes everything you need! Just put it 'next to src' (i.e. STK_DIR/src and STK_DIR/dependencies).

Did that and the answer is simply: NO. I'm getting a list of file-not-found half a mile long... so frustrating :(
I'm biginning to see that the only way I'm going to pull this off is with a well-written HOWTO with lots and lots of pictures...
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby acme_pjz » 07 Jan 2011, 09:28

asciimonster {l Wrote}:Big problem: Even if I have the correct .h files, the compiler can't find them (in incorrect folder), but I just cannot fin an option somewhere where you can set include directories for the compiler. Now, I am forced to move all the .h files around but it keep throwing errors....


Right click on "supertuxkart" in Solution Explorer, select "Properties", select "Configuration->All Configuration", select "C/C++" in tree-view control, and you'll see "Additional including directory", set to "../../../src;../../../src/bullet/src;../../../src/enet/include;../../../dependencies/include;../../../dependencies/include/irrlicht", and maybe some other directory and file need to set, for example "Linker"->"Additional library path" and "Linker->Input"->"Additional dependencies" etc.

Sorry I can't provide a screenshot because I'm using Visual Studio 2005 *Simplified Chinese* edition, you won't recognize any character it writes :D
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Debugging STK on Windows

Postby asciimonster » 07 Jan 2011, 18:43

Thanks that helped... No the next problem:
{l Code}: {l Select All Code}
1>D:\Users\François\supertuxkart_svn\src\utils/vec3.hpp(80): warning C4003: not enough actual parameters for macro 'max'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(80): error C2226: syntax error : unexpected type 'Vec3'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(80): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(82): error C2143: syntax error : missing ')' before '}'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(82): error C2143: syntax error : missing '}' before ')'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(82): error C2059: syntax error : ')'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(82): error C2143: syntax error : missing ';' before '}'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(82): error C2238: unexpected token(s) preceding ';'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2628: 'Vec3' followed by 'void' is illegal (did you forget a ';'?)
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): warning C4003: not enough actual parameters for macro 'min'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2143: syntax error : missing ';' before '<L_TYPE_raw>'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2059: syntax error : '<L_TYPE_raw>'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2059: syntax error : ')'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2059: syntax error : ')'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2143: syntax error : missing ';' before '{'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(85): error C2447: '{' : missing function header (old-style formal list?)
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(88): error C2059: syntax error : '}'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(88): error C2143: syntax error : missing ';' before '}'
1>D:\Users\Asciimonster\supertuxkart_svn\src\utils/vec3.hpp(88): error C2059: syntax error : '}'
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby acme_pjz » 08 Jan 2011, 06:28

I don't know :( Maybe I can upload a copy of workable solution file ...

And there is a possible bug:

{l Code}: {l Select All Code}
...
1>race_paused_dialog.cpp
1>e:\Program Files\SuperTuxKart0.7\src\states_screens/main_menu_screen.hpp(21) : fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
1>race_over_dialog.cpp
1>e:\Program Files\SuperTuxKart0.7\src\states_screens/main_menu_screen.hpp(21) : fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
...


I check the code, there are nowhere using pthread.h :| so I can safely delete the #incude statments ... Is it a bug?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Debugging STK on Windows

Postby KroArtem » 08 Jan 2011, 11:03

afaik pthreads were used bu xapantu for addon manager; now JoergH switched from using pthread, but I can be wrong :)
KroArtem
 
Posts: 375
Joined: 26 Aug 2010, 19:04

Re: Debugging STK on Windows

Postby hiker » 09 Jan 2011, 01:51

acme_pjz {l Wrote}:I don't know :( Maybe I can upload a copy of workable solution file ...

Thanks for helping out, acme_pjz, but adjusting/adding the paths should not be necessary. If it is, then either the project file is wrong, or the dependency package is not installed (or incorrectly installed).

Asciimonster: can you post the content of the supertuxkart directory, i.e. the one containing src? (After you installed the addon package).

The missing pthread is most likely the same problem: while they are indeed not needed in those files (I'll remove them later), they shouldn't cause a problem when our dependency package is installed, since it included pthread.h.

Cheers and thanks!
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby hiker » 09 Jan 2011, 10:46

Hi,

I've installed VC10, and imported the vc9 project files and created vc10 project files (src/ide/vc10) - svn r7341. Please update your svn sources and try this project file (make sure to use the debug configuration). Note that simply importing the vs 9 project files basically worked for me (with the normal dependency package installed). And if you have problems, as mentioned before post the content of the 'root' directory (i.e. the one which contains src and data); and just in case the contents of dependencies as well.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby asciimonster » 09 Jan 2011, 21:03

That works a LOT better, thanks.
Ony problem is that the linker doesn't get it yet:
{l Code}: {l Select All Code}
3>------ Build started: Project: supertuxkart, Configuration: Debug Win32 ------
3>D:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
3>D:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(D:\Users\Asciimonster\supertuxkart_svn\src\ide\vc10\..\..\..\supertuxkart.exe) does not match the Linker's OutputFile property value (D:\Users\Asciimonster\supertuxkart_svn\supertuxkart_d.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
3>D:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(supertuxkart) does not match the Linker's OutputFile property value (supertuxkart_d). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
3>  LINK : program database D:\Users\Asciimonster\supertuxkart_svn\supertuxkart.pdb missing; performing full link
3>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>  supertuxkart.vcxproj -> D:\Users\Asciimonster\supertuxkart_svn\src\ide\vc10\..\..\..\supertuxkart.exe
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Compiled code works though...
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby asciimonster » 09 Jan 2011, 21:24

Ok. Tweaked some directories and it seems to work now (I don't know what I did but it worked)...
Hiker, here's a nice error for you:
{l Code}: {l Select All Code}
First-chance exception at 0x634cc8ec (msvcr100d.dll) in supertuxkart.exe: 0xC0000005: Access violation reading location 0xfeeefeee.


Here's a stack trace:
{l Code}: {l Select All Code}
    msvcr100d.dll!cmpDWORD(const void * lhs, const void * rhs)  + 0x1c bytes   C
    msvcr100d.dll!unaligned_memcmp(const unsigned char * bLHS, const unsigned char * bRHS, unsigned int siz)  + 0x37e bytes   C
    msvcr100d.dll!memcmp(const void * lhs, const void * rhs, unsigned int siz)  + 0x19c bytes   C
>   supertuxkart.exe!std::char_traits<char>::compare(const char * _First1, const char * _First2, unsigned int _Count)  Line 486 + 0x11 bytes   C++
    supertuxkart.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(unsigned int _Off, unsigned int _N0, const char * _Ptr, unsigned int _Count)  Line 1900 + 0x38 bytes   C++
    supertuxkart.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right)  Line 1855   C++
    supertuxkart.exe!std::operator==<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Left, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right)  Line 167 + 0xc bytes   C++
    supertuxkart.exe!GrandPrixManager::getGrandPrix(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & s)  Line 54 + 0x1d bytes   C++
    supertuxkart.exe!GPInfoDialog::processEvent(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & eventSource)  Line 196 + 0x14 bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::onWidgetActivated(GUIEngine::Widget * w, const int playerID)  Line 485 + 0x40 bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::onGUIEvent(const irr::SEvent & event)  Line 549 + 0xe bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::OnEvent(const irr::SEvent & event)  Line 53 + 0xc bytes   C++
    Irrlicht.dll!00ed6aaa()    
    [Frames below may be incorrect and/or missing, no symbols loaded for Irrlicht.dll]   
    Irrlicht.dll!00ec280a()    
    Irrlicht.dll!00ef2e0f()    
    Irrlicht.dll!00ec280a()    
    Irrlicht.dll!00f13d01()    
    Irrlicht.dll!00ebf37b()    
    Irrlicht.dll!00ed735f()    
    Irrlicht.dll!00e7e9f9()    
    Irrlicht.dll!00e7fd47()    
    user32.dll!776a86ef()    
    user32.dll!776a8876()    
    user32.dll!776a881f()    
    user32.dll!776a43cf()    
    user32.dll!776a43f5()    
    opengl32.dll!59e260fb()    
    user32.dll!776a86ef()    
    user32.dll!776a8876()    
    user32.dll!776a881f()    
    user32.dll!776a89b5()    
    user32.dll!776a3578()    
    Irrlicht.dll!00e81295()    
    supertuxkart.exe!IrrDriver::update(float dt)  Line 848 + 0x16 bytes   C++
    supertuxkart.exe!MainLoop::run()  Line 146   C++
    supertuxkart.exe!main(int argc, char * * argv)  Line 971   C++
    supertuxkart.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes   C
    supertuxkart.exe!mainCRTStartup()  Line 371   C
    kernel32.dll!75d21194()    
    ntdll.dll!777bb495()    
    ntdll.dll!777bb468()    
    supertuxkart.exe!std::_Vector_val<btQuaternion,std::allocator<btQuaternion> >::~_Vector_val<btQuaternion,std::allocator<btQuaternion> >()  Line 456 + 0xf bytes   C++
    b8000000()   


Does this stuff make any kind of sense to you? :shock: :o :shock:
Last edited by asciimonster on 11 Jan 2011, 00:28, edited 1 time in total.
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby hiker » 10 Jan 2011, 00:30

asciimonster {l Wrote}:Ok. Tweaked some directories and it seems to work now (I don't know what I did but it worked)...

It looks like you didn't do a debug build: the executable should be named 'supertuxkart_d.exe', while yours is supertuxkart.exe. Main problem is that running in VS does (I think) not work for release builds, while I tweaked debug builds to work (anyone with VS 10 and some time please help us fixing this :) ).

Could you try changing this: go to project, supertuxkart project properties, click on configuration properties. Then on the configuration manager, and select 'debug' in the 'active solution configuration' pulldown menu (this is based on vs 9.0; I usually don't have access to the computer on which I installed VS 10 - if it doesn't work, let me know and I'll check for details).

Hiker, here's a nice error for you:
{l Code}: {l Select All Code}
First-chance exception at 0x634cc8ec (msvcr100d.dll) in supertuxkart.exe: 0xC0000005: Access violation reading location 0xfeeefeee.


Here's a stack trace:
{l Code}: {l Select All Code}
    msvcr100d.dll!cmpDWORD(const void * lhs, const void * rhs)  + 0x1c bytes   C
    msvcr100d.dll!unaligned_memcmp(const unsigned char * bLHS, const unsigned char * bRHS, unsigned int siz)  + 0x37e bytes   C
    msvcr100d.dll!memcmp(const void * lhs, const void * rhs, unsigned int siz)  + 0x19c bytes   C
>   supertuxkart.exe!std::char_traits<char>::compare(const char * _First1, const char * _First2, unsigned int _Count)  Line 486 + 0x11 bytes   C++
    supertuxkart.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(unsigned int _Off, unsigned int _N0, const char * _Ptr, unsigned int _Count)  Line 1900 + 0x38 bytes   C++
    supertuxkart.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right)  Line 1855   C++
    supertuxkart.exe!std::operator==<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Left, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right)  Line 167 + 0xc bytes   C++
    supertuxkart.exe!GrandPrixManager::getGrandPrix(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & s)  Line 54 + 0x1d bytes   C++


Does this stuff make any kind of sense to you? :shock: :o :shock:

Yes, it does, though getting the variable values and full stack trace would be important (e.g. I can't see what called 'getGrandPrix; nor can I see what GP it is looking for). The first problem is likely because you are using a non-debug build, the 2nd one ... not sure, can you scroll a bit further down? Also, is this reproducible (if so, what do you do)?

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby acme_pjz » 10 Jan 2011, 04:59

I think I found this bug, too, see viewtopic.php?p=8540#p8540 ... When I choose a grand prix, there is a dialog shows all tracks in grand prix, and when I click the "Start Grand Prix" button the game crashes :| ...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Debugging STK on Windows

Postby asciimonster » 11 Jan 2011, 00:33

hiker {l Wrote}:Yes, it does, though getting the variable values and full stack trace would be important (e.g. I can't see what called 'getGrandPrix; nor can I see what GP it is looking for). The first problem is likely because you are using a non-debug build, the 2nd one ... not sure, can you scroll a bit further down? Also, is this reproducible (if so, what do you do)?

complete trace:
{l Code}: {l Select All Code}
    msvcr100d.dll!cmpDWORD(const void * lhs, const void * rhs)  + 0x1c bytes   C
    msvcr100d.dll!unaligned_memcmp(const unsigned char * bLHS, const unsigned char * bRHS, unsigned int siz)  + 0x37e bytes   C
    msvcr100d.dll!memcmp(const void * lhs, const void * rhs, unsigned int siz)  + 0x19c bytes   C
>   supertuxkart.exe!std::char_traits<char>::compare(const char * _First1, const char * _First2, unsigned int _Count)  Line 486 + 0x11 bytes   C++
    supertuxkart.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(unsigned int _Off, unsigned int _N0, const char * _Ptr, unsigned int _Count)  Line 1900 + 0x38 bytes   C++
    supertuxkart.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::compare(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right)  Line 1855   C++
    supertuxkart.exe!std::operator==<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Left, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right)  Line 167 + 0xc bytes   C++
    supertuxkart.exe!GrandPrixManager::getGrandPrix(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & s)  Line 54 + 0x1d bytes   C++
    supertuxkart.exe!GPInfoDialog::processEvent(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & eventSource)  Line 196 + 0x14 bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::onWidgetActivated(GUIEngine::Widget * w, const int playerID)  Line 485 + 0x40 bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::onGUIEvent(const irr::SEvent & event)  Line 549 + 0xe bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::OnEvent(const irr::SEvent & event)  Line 53 + 0xc bytes   C++
    Irrlicht.dll!00df6aaa()    
    [Frames below may be incorrect and/or missing, no symbols loaded for Irrlicht.dll]   
    Irrlicht.dll!00de280a()    
    Irrlicht.dll!00e12e0f()    
    Irrlicht.dll!00de280a()    
    Irrlicht.dll!00e33d01()    
    Irrlicht.dll!00ddf37b()    
    Irrlicht.dll!00df735f()    
    Irrlicht.dll!00d9e9f9()    
    Irrlicht.dll!00d9fd47()    
    user32.dll!776a86ef()    
    user32.dll!776a8876()    
    user32.dll!776a881f()    
    user32.dll!776a43cf()    
    user32.dll!776a43f5()    
    opengl32.dll!5a8060fb()    
    user32.dll!776a86ef()    
    user32.dll!776a8876()    
    user32.dll!776a881f()    
    user32.dll!776a89b5()    
    user32.dll!776a3578()    
    Irrlicht.dll!00da1295()    
    supertuxkart.exe!IrrDriver::update(float dt)  Line 848 + 0x16 bytes   C++
    supertuxkart.exe!MainLoop::run()  Line 146   C++
    supertuxkart.exe!main(int argc, char * * argv)  Line 971   C++
    supertuxkart.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes   C
    supertuxkart.exe!mainCRTStartup()  Line 371   C
    kernel32.dll!75d21194()    
    ntdll.dll!777bb495()    
    ntdll.dll!777bb468()    
    supertuxkart.exe!std::_Vector_val<btQuaternion,std::allocator<btQuaternion> >::~_Vector_val<btQuaternion,std::allocator<btQuaternion> >()  Line 456 + 0xf bytes   C++
    b8000000()   


As far as I can see the variable m_gp_ident gets unset, but I cannot find out why... I can't even find where it is supposed to be set...
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby hiker » 11 Jan 2011, 01:48

acme_pjz {l Wrote}:I think I found this bug, too, see viewtopic.php?p=8540#p8540 ... When I choose a grand prix, there is a dialog shows all tracks in grand prix, and when I click the "Start Grand Prix" button the game crashes :| ...

I didn't know that this is still an issue. I thought it was caused by an alpha version that didn't have all tracks converted.

Does the crash happen with all GPs? Or only some?

Best option is to put this in our bug tracker!

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby hiker » 11 Jan 2011, 02:06

OK, forget about bug tracker, fixed in r7359. But this should only happen with current svn, version 0.7 is not affected by this. So Asciimonster, back to finding more bugs, and to reproduce your original problem now that this is out of our way :)

Thanks for the report, full backtrace etc - that helped a lot!

Cheers,
Joerg

PS: Asciimonster: m_gp_info is set in the constructor of the object:
{l Code}: {l Select All Code}
GPInfoDialog::GPInfoDialog(const std::string& gpIdent, const float w, const float h) : ModalDialog(w, h)
{
    m_curr_time = 0.0f;

    const int y1 = m_area.getHeight()/7;
    const int y2 = m_area.getHeight()*6/7;

    m_gp_ident = gpIdent;
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby acme_pjz » 11 Jan 2011, 07:45

hiker {l Wrote}:OK, forget about bug tracker, fixed in r7359. But this should only happen with current svn, version 0.7 is not affected by this.


Yes, I just use SVN version :) Sorry for misleading :oops: I'll download latest source file and try ...

BTW,

hiker {l Wrote}:The missing pthread is most likely the same problem: while they are indeed not needed in those files (I'll remove them later), they shouldn't cause a problem when our dependency package is installed, since it included pthread.h.


I can't find pthread.h in dependencies package, maybe because the dependencies package I use is very old, probably I downloaded it when 0.7 Alpha 1 released ...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Debugging STK on Windows

Postby asciimonster » 11 Jan 2011, 21:45

Here's another:
Debug Assertion Failed!
(...)vc/include/vector Line: 933
"Standard C++ Libraries Out of Range && 0"


Noticed Error: variable "message" 0x009e1c38 "vector subscript out of range" const wchar_t *

{l Code}: {l Select All Code}
>   msvcp100d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line)  Line 15   C++
    supertuxkart.exe!std::vector<unsigned int,std::allocator<unsigned int> >::operator[](unsigned int _Pos)  Line 932 + 0x17 bytes   C++
    supertuxkart.exe!AIBaseController::AIBaseController(Kart * kart, StateManager::ActivePlayer * player)  Line 61 + 0xc bytes   C++
    supertuxkart.exe!DefaultAIController::DefaultAIController(Kart * kart)  Line 51 + 0x50 bytes   C++
    supertuxkart.exe!World::loadAIController(Kart * kart)  Line 223 + 0x32 bytes   C++
    supertuxkart.exe!World::createKart(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & kart_ident, int index, int local_player_id, int global_player_id)  Line 194 + 0xc bytes   C++
    supertuxkart.exe!World::init()  Line 141 + 0x2b bytes   C++
    supertuxkart.exe!WorldWithRank::init()  Line 27   C++
    supertuxkart.exe!LinearWorld::init()  Line 53   C++
    supertuxkart.exe!RaceManager::startNextRace()  Line 285 + 0x20 bytes   C++
    supertuxkart.exe!RaceManager::next()  Line 315   C++
    supertuxkart.exe!RaceResultGUI::eventCallback(GUIEngine::Widget * widget, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name, const int playerID)  Line 155 + 0xb bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::sendEventToUser(GUIEngine::Widget * widget, std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name, const int playerID)  Line 474 + 0x2c bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::onWidgetActivated(GUIEngine::Widget * w, const int playerID)  Line 524   C++
    supertuxkart.exe!GUIEngine::EventHandler::onGUIEvent(const irr::SEvent & event)  Line 549 + 0xe bytes   C++
    supertuxkart.exe!GUIEngine::EventHandler::OnEvent(const irr::SEvent & event)  Line 53 + 0xc bytes   C++
    Irrlicht.dll!00df6aaa()    
    [Frames below may be incorrect and/or missing, no symbols loaded for Irrlicht.dll]   
    Irrlicht.dll!00ddf37b()    
    Irrlicht.dll!00df735f()    
    Irrlicht.dll!00d9e9f9()    
    Irrlicht.dll!00d9fd47()    
    user32.dll!758686ef()    
    user32.dll!75868876()    
    user32.dll!7586881f()    
    user32.dll!758643cf()    
    user32.dll!758643f5()    
    opengl32.dll!627360fb()    
    user32.dll!758686ef()    
    user32.dll!75868876()    
    user32.dll!7586881f()    
    user32.dll!758689b5()    
    user32.dll!75863578()    
    Irrlicht.dll!00da1295()    
    supertuxkart.exe!IrrDriver::update(float dt)  Line 848 + 0x16 bytes   C++
    supertuxkart.exe!MainLoop::run()  Line 146   C++
    supertuxkart.exe!main(int argc, char * * argv)  Line 971   C++
    supertuxkart.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes   C
    supertuxkart.exe!mainCRTStartup()  Line 371   C
    kernel32.dll!76381194()    
    ntdll.dll!773ab495()    
    ntdll.dll!773ab468()    
    supertuxkart.exe!std::_Vector_val<btQuaternion,std::allocator<btQuaternion> >::~_Vector_val<btQuaternion,std::allocator<btQuaternion> >()  Line 456 + 0xf bytes   C++
    b8000000()   
asciimonster
 
Posts: 375
Joined: 03 Dec 2009, 18:24

Re: Debugging STK on Windows

Postby hiker » 11 Jan 2011, 23:42

acme_pjz {l Wrote}:I can't find pthread.h in dependencies package, maybe because the dependencies package I use is very old, probably I downloaded it when 0.7 Alpha 1 released ...

Yes, that's possible. You might then actually get some other irrlicht bugs as well. I actually have to check if I have the latest irrlicht 1.7.2 in the current dependency package, or still an svn version between 1.7.1 and 2.

Cheers,
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby hiker » 12 Jan 2011, 00:17

asciimonster {l Wrote}:Here's another:

Good catch - fixed in r7366 and 7368. Though that only happens if the random number generator returns RAND_MAX or RAND_MAX-1 (on windows RAND_MAX is 32767, so rather unlikely, but of course with enough races, and about 400 of this call per track, it could happen now and again).

Any more problems?

Thanks!
Joerg
hiker
 
Posts: 1435
Joined: 07 Dec 2009, 12:15
Location: Melbourne, Australia

Re: Debugging STK on Windows

Postby acme_pjz » 12 Jan 2011, 05:30

hiker {l Wrote}:Good catch - fixed in r7366 and 7368. Though that only happens if the random number generator returns RAND_MAX or RAND_MAX-1 (on windows RAND_MAX is 32767, so rather unlikely, but of course with enough races, and about 400 of this call per track, it could happen now and again).


Well, I think I just met this bug yesterday :D When I playing Penguin Playground grand prix, finishing the Scotland track the game crashes ... and I selected "debug", found that the random number returns -2147483648 and everything goes wrong ... I try to reproduce this bug but failed :|
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Debugging STK on Windows

Postby acme_pjz » 15 Jan 2011, 09:17

hiker {l Wrote}:Good catch - fixed in r7366 and 7368. ...


I think you haven't fully fixed this bug even in r7373 :| My solution is:

// In case of rounding errors
assert(next.size()>0);
if(indx>=(int)next.size()) indx=(int)next.size()-1;

Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Who is online

Users browsing this forum: No registered users and 1 guest