compiler questions

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#16 Post by Geoff the Medio »

...i found a few AI_xxx.log files with content like 2006-06-03 19:23:19,269 FATAL AI : Initiating Exit (code 1 - error termination).

so maybe its also AI related :)
It's not the AI. I've got the same log files, and my local build runs fine.

Edit: see this post.

maelstrom512
Space Floater
Posts: 28
Joined: Thu Apr 13, 2006 8:22 pm

#17 Post by maelstrom512 »

As far as Linux debugers are concerned, the old standard is gdb, chances are your distro comes with it. If not: http://www.gnu.org/software/gdb/

If you want something more graphical, there is also DDD (Data Display Debugger) which is just a graphical frontend for gdb. http://www.gnu.org/software/ddd/ A lot of distros come with that as well, but it's not nearly as ubiquitous.

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#18 Post by renihs »

thanks for the answers, gdb i know about, ddd i will take a closer look soon.
however since the game crashes every few seconds /actions i doubt its just some bugs but a more sincere problem with compiler/libraries or anything.
i will soon update my dvd to latest graphviz etc, maybe that will fix my problems.

i ll report back as soon as i know something more conclusive :)

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#19 Post by renihs »

finally i found some time to test on freeorion a bit and as i suspected its some library thingie...

1150222255 DEBUG : HumanClientApp::HandleMessageImpl : Received GAME_START message; starting player turn...
1150222255 DEBUG : Single-Player game
1150222256 DEBUG : HumanClientApp::HandleMessageImpl : Universe setup complete.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1231239472 (LWP 14073)]
0xb7cf7928 in GG::ListBox::GetRow () from /usr/local/lib/libGiGi.so
(gdb)

on my new install i will fetch the latest gigi and orion version and try again :)

maelstrom512
Space Floater
Posts: 28
Joined: Thu Apr 13, 2006 8:22 pm

#20 Post by maelstrom512 »

It might be helpful to run a backtrace (which will print out the call stack) to see how it got to this point. To do this in gdb just type 'bt'. In DDD there is probably a command 'bt' somewhere... If not, I think there is a panel where you can enter commands to the gdb engine...

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#21 Post by renihs »

thanks alot, the "bt" command has been proven most usefull :)
here is the output of a crash (dragging a scout to newfleet)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1223661872 (LWP 17958)]
0x0000000d in ?? ()
(gdb) bt
#0 0x0000000d in ?? ()
#1 0x4ee197a4 in __dynamic_cast () from /usr/lib/gcc/i686-pc-linux-gnu/4.1.0/libstdc++.so.6
#2 0xb7d11154 in GG::Wnd::AttachChild () from /usr/local/lib/libGiGi.so
#3 0x082f186f in (anonymous namespace)::ShipDataPanel::SetShipIcon ()
#4 0x082f1bd4 in (anonymous namespace)::ShipDataPanel::Refresh ()
#5 0x08093eec in boost::function0<void, std::allocator<void> >::operator() ()
#6 0x08094091 in boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()(), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int> ()
#7 0x080944d5 in boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function<void ()(), std::allocator<void> > >::operator() ()
#8 0x0811eb43 in Fleet::AddShip ()
#9 0x081d8e28 in NewFleetOrder::ExecuteImpl ()
#10 0x081d58f2 in Order::Execute ()
#11 0x081e66d7 in OrderSet::IssueOrder ()
#12 0x082e2181 in FleetWnd::CreateNewFleetFromDrops ()
#13 0x082f08ba in boost::function2<void, Ship*, std::vector<int, std::allocator<int> > const&, std::allocator<void> >::operator() ()
#14 0x082f0a71 in boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<Ship*, std::vector<int, std::allocator<int> > const&, boost::function<void ()(Ship*, std::vector<int, std::allocator<int> > const&), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int> ()
#15 0x082f0ec5 in boost::signal2<void, Ship*, std::vector<int, std::allocator<int> > const&, boost::last_value<void>, int, std::less<int>, boost::function<void ()(Ship*, std::vector<int, std::allocator<int> > const&), std::allocator<void> > >::operator() ()
#16 0x082dd13e in FleetDataPanel::AcceptDrops ()
#17 0xb7cb19ed in GG::GUI::HandleGGEvent () from /usr/local/lib/libGiGi.so
#18 0xb7ee3e35 in SDLGUI::HandleSystemEvents () from /usr/local/lib/libGiGiSDL.so
#19 0xb7c961c8 in GG::EventPump::operator() () from /usr/local/lib/libGiGi.so
#20 0xb7ee4254 in SDLGUI::Run () from /usr/local/lib/libGiGiSDL.so
#21 0xb7cacb61 in GG::GUI::operator() () from /usr/local/lib/libGiGi.so
#22 0xb7ee401d in SDLGUI::operator() () from /usr/local/lib/libGiGiSDL.so
#23 0x082754a5 in main ()
(gdb)

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#22 Post by renihs »

another one from closing a fleet window (sound played though :)



----snip---
....
0236339 DEBUG : Object: 562 : Sandage IV
1150236339 DEBUG : Object: 579 : Home Fleet
1150236339 DEBUG : Object: 580 : Scout
1150236339 DEBUG : Object: 581 : Scout
1150236339 DEBUG : Object: 582 : Colony Ship
1150236339 DEBUG : ServerApp::HandleNonPlayerMessage : Server now in mode 3 (SERVER_WAITING).
1150236339 DEBUG : ServerApp::HandleMessage : Received orders from player 1
1150236339 DEBUG : ServerApp::HandleMessage : Received orders from player 2
1150236339 DEBUG : ServerApp::HandleMessage : Received orders from player 3
1150236339 DEBUG : ServerApp::HandleMessage : Received orders from player 4
1150236359 ERROR : main() caught exception(std::exception): vector::_M_range_check
[Thread -1235924064 (LWP 18004) exited]
[Thread -1227531360 (LWP 18003) exited]
1150236359 FATAL : Initiating Exit (code 1 - error termination)
1150236359 FATAL : Initiating Exit (code 1 - error termination)
1150236359 FATAL : Initiating Exit (code 1 - error termination)
1150236359 FATAL : Initiating Exit (code 1 - error termination)
[Thread -1263535200 (zombie) exited]
[Thread -1244316768 (zombie) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1222932784 (LWP 18002)]
0xb7f8d627 in NET2_TCPClose () from /usr/local/lib/libGiGiNet.so
(gdb) bt
#0 0xb7f8d627 in NET2_TCPClose () from /usr/local/lib/libGiGiNet.so
#1 0x08277e68 in ClientNetworkCore::~ClientNetworkCore ()
#2 0x0825f900 in ClientApp::~ClientApp ()
#3 0x08272edb in HumanClientAppSoundFMOD::~HumanClientAppSoundFMOD ()
#4 0x082754ad in main ()
Last edited by renihs on Tue Jun 13, 2006 9:58 pm, edited 1 time in total.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#23 Post by Geoff the Medio »

Are these with the newest GG and FO ?

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#24 Post by renihs »

yes i did a "svn co https://svn.sourceforge.net/svnroot/freeorion/trunk freeorion"
about 20 minutes ago
compiled gigi, and downloaded fmod-3.75 (didnt find source to compile?)
(and copied/linked the .so and copied the inc/.h

then compiled freeorion
(i think it was revision 532)

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#25 Post by renihs »

i guess my problem is that the libfmod-3.75.so is compiled with "i dont know" and thus breaking my gcc 4.1.0 only build
or something else...:)

i will recompile freeorion without fmod tomorow, i guess it will run more stable then, disabling sound has no effect.

3.74 fmod is in gentoo portage, too bad 3.75 is required

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

#26 Post by Geoff the Medio »

There is an OpenAL version of the human client app sound source files.... I don't know if they work... but they're there.

Arnljot
Space Floater
Posts: 19
Joined: Mon Mar 27, 2006 8:19 am
Location: Sweden

#27 Post by Arnljot »

I have compiled FO ver. 1846 with gcc 4.0.2 and and moving scouts to new fleet worked for me. I have used fmod 3.75 on all versions and before ver. 1846 I changed 3.75 to 3.74 to get scons satisfied.

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#28 Post by renihs »

hmm there is a huge difference between 4.0 and 4.1, anyhow i am currently trying to compile freeorion with openal instead of fmod
soon i will know more :)

btw: you *downgraded* fmod? (to 3.74) in order to get scons satisfied?
i had to upgrade (from 3.74) to 3.75 todo so :)
Last edited by renihs on Thu Jun 15, 2006 2:03 pm, edited 1 time in total.

renihs
Space Floater
Posts: 35
Joined: Fri Feb 10, 2006 12:14 pm

#29 Post by renihs »

hmm i was unsuccessfull in recompiling with openal,
however i disabled fmod but that did not improve stability much.
i still experience alot crashes..

for example

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1222416688 (LWP 11662)]
0x082da10b in FleetWnd::PlotMovement ()
(gdb) bt
#0 0x082da10b in FleetWnd::PlotMovement ()
#1 0x082da42c in FleetWnd::SystemBrowsed ()
#2 0x08289d93 in boost::function1<void, int, std::allocator<void> >::operator() ()
#3 0x0828a29a in boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<int, boost::function<void ()(int), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int> ()
#4 0x082937b1 in boost::signal1<void, int, boost::last_value<void>, int, std::less<int>, boost::function<void ()(int), std::allocator<void> > >::operator() ()
#5 0x08320190 in MapWnd::MouseEnteringSystem ()
#6 0x08289d93 in boost::function1<void, int, std::allocator<void> >::operator() ()
#7 0x0828a29a in boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<int, boost::function<void ()(int), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int> ()
#8 0x082937b1 in boost::signal1<void, int, boost::last_value<void>, int, std::less<int>, boost::function<void ()(int), std::allocator<void> > >::operator() ()
#9 0x0839defd in SystemIcon::MouseEnter ()
#10 0xb7da4b14 in GG::Wnd::HandleEvent () from /usr/local/lib/libGiGi.so
#11 0xb7d43694 in GG::GUI::CheckedGetWindowUnder () from /usr/local/lib/libGiGi.so
#12 0xb7d455a9 in GG::GUI::HandleGGEvent () from /usr/local/lib/libGiGi.so
#13 0xb7f78e35 in SDLGUI::HandleSystemEvents () from /usr/local/lib/libGiGiSDL.so
#14 0xb7d2b1c8 in GG::EventPump::operator() () from /usr/local/lib/libGiGi.so
#15 0xb7f79254 in SDLGUI::Run () from /usr/local/lib/libGiGiSDL.so
#16 0xb7d41b61 in GG::GUI::operator() () from /usr/local/lib/libGiGi.so
#17 0xb7f7901d in SDLGUI::operator() () from /usr/local/lib/libGiGiSDL.so
#18 0x08273c95 in main ()

i dont know which information i could provide which would be usefull

maelstrom512
Space Floater
Posts: 28
Joined: Thu Apr 13, 2006 8:22 pm

#30 Post by maelstrom512 »

If you run:

Code: Select all

scons debug=1
that should build FO with debug targets. This means gdb will be able cite exact line numbers in FO code. This should cause a full rebuild so you will have to be patient. Make sure that it rebuilds the executables too (I had some trouble with that, but I may be crazy)

Also, is it crashing in consistent spots, or does it seem like a different place every time?

Finally, if you are running under Linux, another tool for you to try out... Valgrind, a memory debugger tool. You can find it at http://valgrind.org/ Once you have it installed just run

Code: Select all

valgrind freeorion
and FreeOrion should run (albeit slowly) bear with it and try and reproduce the bug. Valgrind will print a message if any data is read from or written to improper memory addresses.

Post Reply