Debugging spring GDB + Windows

Debugging spring GDB + Windows

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Debugging spring GDB + Windows

Post by velteyn »

Hi all,
attempting to debug spring using gdb 7.5 + eclipse on windows here...

I have this problem: spring starts correctly and after Test Game (Empty mod + duck, null AI) the program finishes the init than exits !!!

If I launch spring.exe normally (no debug) anything works fine....

Can anyone explain to me this strange result ? :)

Thank you

GDB output

Code: Select all

[f=0000000] [Sound] Error: Unable to open audio file: sounds/multiselect.wav
[f=0000000] [Sound] Error: Unable to open audio file: FailedCommand
[f=0000000] [Sound] Error: CSound::GetSoundId: could not find sound: FailedCommand
[f=0000000] [unit_script.lua] Error: Loading gadget: Lua unit script framework  <unit_script.lua>
Quit (expect signal SIGINT when the program is resumed)



note: I had to exclude SIGSEGV from gdb init because I obtained many SIGSEGV stops , but I think that the code handles them !
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Debugging spring GDB + Windows

Post by jK »

velteyn wrote:note: I had to exclude SIGSEGV from gdb init because I obtained many SIGSEGV stops , but I think that the code handles them !
no, when gdb is running you want that gdb handles _all_ errors
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

Can this error:

Error: Loading gadget: Lua unit script framework <unit_script.lua>

make the program to exit ?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Debugging spring GDB + Windows

Post by gajop »

Most likely no.
Gadget/widget errors rarely cause termination of Spring itself.
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

I that case I think that is a Windows GDB 7.5 problem... I'll try to get gdb 7.6 and see if something changes. Its strange , program exits unexpectedly and with no error !!! When I run the program alone , anything works fine !!
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

QUESTION: Is there any angel here available to put up a remote session on my PC to try to help me and see what's wrong ? I sincerely want to start to learn the engine and give some contribution.. but I'm stuck on initial setup...
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

I have another clue :
aftter finalizing STEP I have

614,500 =thread-group-exited,id="i1",exit-code="01777777777770000000005"
614,515 *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",\
reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",reason="exited",e\
xit-code="030000000005"
614,515 (gdb)
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

cause of segmentation fault is this :


0x636050d8 in omp_in_final() from c:\MinGW32\bin\libgomp-1.dll

Process exited with code 030000000005

I think I can stop here because I'm not able go further..
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Debugging spring GDB + Windows

Post by abma »

the whole infolog.txt of such a crash would be really usefull...
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

you can find it in as file attach...

I doubt it can be of some use....

I'm starting to study libgomp .. I think the problem is here !!
Attachments
infolog.txt
Info Log File
(8.05 KiB) Downloaded 10 times
Last edited by velteyn on 09 Jul 2013, 15:34, edited 1 time in total.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Debugging spring GDB + Windows

Post by abma »

[f=0000000] Warning: [Watchdog] Hang detection triggered for Spring 94.1 (OMP).
-> increase HangTimeout or disable watchdog by setting it to -1

not sure if it helps, but at least it will reduce possible causes for a crash with gdb attached to the process.
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

Watchdog disabled

the result is the same as above,
I attach also a screenshot of gdb session with the SIGSEGV.

It only happens in gdb debug...
Attachments
Immagine.JPG
GDB session
(53.09 KiB) Downloaded 1 time
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Debugging spring GDB + Windows

Post by abma »

"Continuing" <- that looks wrong for me, imo the cause of the crash is before omp_in_final

whats the output of "bt full" before "continue" is called?

don't skip SIGSEGV... they are there for reason.

edit: you should investigate the very FIRST SIGSEV, any crash/problem after it is likely a side-effect of it.
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

here it is

Its obscure to me ....
Attachments
Immagine.JPG
obscure result
(125.46 KiB) Downloaded 1 time
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

Into the file attach you can find the very first SIGSEGV but is absolutely BEFORE spring starts to log something !!

After i skip it the program works normally until I start a map than hangs after the Finalizing step !

Cannot understand.... I start to think that Windows is not the right environment for a spring developer !!
Attachments
theFirst.JPG
(72.36 KiB) Downloaded 1 time
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Debugging spring GDB + Windows

Post by abma »

"dll-hell"...

which version of mingw did you install? whats the output of gcc -v? are you using current mingwlibs?

(and yes, its much more harder to setup a build env on windows than on linux...)
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

Im using, gcc 4.7.2 , but I had a try also with the official mingw 4.7.0 as described on the windows build instructions. The result was the same !

mingvlibs are the latest available!!
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Debugging spring GDB + Windows

Post by abma »

velteyn wrote:mingw 4.7.0 as described on the windows build instructions
an easy workaround could be, to remove omp from your mingw-install. imo your mingw installation is broken. i suggest to uninstall completely mingw and reinstall it without installing two instances of gcc into it.

please only use "MingW Stable", any thing else is known to fail. there is a reason why there is a screenshot for that...

that could be the cause of your problem, afaik omp is bound to the compiler used, if you use a different version of omp, then its very likely that it breaks.
velteyn
Posts: 40
Joined: 25 Jan 2012, 10:53

Re: Debugging spring GDB + Windows

Post by velteyn »

ah ok, but it would be the fifth try.. I always completely removed C:\MINGW32 dir erasing all the content before re-installing...

Now I search how to remove content from mingw install..

I'll try to follow this road !!
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Debugging spring GDB + Windows

Post by abma »

i'm currently compiling spring on win32 on my own, but compiling on windows is horrible slow, so will take a bit...
Post Reply

Return to “Engine”