3582 Build Errors, OS X 10.6

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
night
Space Kraken
Posts: 102
Joined: Sun Jun 12, 2011 1:21 pm

Re: 3582 Build Errors, OS X 10.6

#106 Post by night »

Getting the bind exception means I get the message main() caught exception(std::runtime_error): bind: Address already in use in my debugger. After that the app crashes when reaching line 184.

I tried to reboot, but that did not work. When I execute sudo lsof -i -P | grep -i "listen" on my system I get:

Code: Select all

freeorion 184      username   14u  IPv4 0x0b9d5b58      0t0    TCP *:12346 (LISTEN)
So FreeOrion still blocks the port after it crashed.
Here's my freeoriond.log:

Code: Select all

2011-06-18 00:58:41,971 DEBUG Server : (ServerFSM) Idle
2011-06-18 00:58:41,972 DEBUG Server : FreeOrion server waiting for network events
2011-06-18 00:58:43,323 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 01:01:58,776 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 01:06:57,784 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 08:06:16,525 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 08:24:01,244 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 08:32:02,747 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 08:37:50,837 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 08:48:23,304 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player
2011-06-18 08:55:01,527 DEBUG Server : ServerNetworking::AcceptConnection : connected to new player

night
Space Kraken
Posts: 102
Joined: Sun Jun 12, 2011 1:21 pm

Re: 3582 Build Errors, OS X 10.6

#107 Post by night »

I changed the two ports to 12347 and 12348.
The bind: Address already in use error does not occur. Instead I get this message in my debugger:

Code: Select all

FreeOrion server waiting for network events
But the app keeps crashing.
Here's the stack trace:

Code: Select all

#0	0x0069bfe2 in swap<boost::detail::thread_data_base*> [inlined] at /usr/include/c++/4.0.0/bits/stl_algobase.h:93
#1	0x0069bfe2 in _ZN5boost10shared_ptrINS_6detail16thread_data_baseEE4swapERS3_ [inlined] at /Users/jsiwek/src/boost_1_42_0/boost/smart_ptr:442
#2	0x0069bfe2 in boost::thread::start_thread() ()
#3	0x006d7ab5 in boost::thread::thread<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ClientNetworking>, boost::_bi::list1<boost::_bi::value<ClientNetworking*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, ClientNetworking>, boost::_bi::list1<boost::_bi::value<ClientNetworking*> > >, boost::disable_if<boost::is_convertible<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ClientNetworking>, boost::_bi::list1<boost::_bi::value<ClientNetworking*> > >&, boost::detail::thread_move_t<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ClientNetworking>, boost::_bi::list1<boost::_bi::value<ClientNetworking*> > > > >, boost::thread::dummy*>::type) ()
#4	0x006b2c45 in ClientNetworking::ConnectToServer(std::string const&, boost::posix_time::seconds) at *path-to-sdk*/freeorion-sdk/FreeOrion/network/ClientNetworking.cpp:184
#5	0x006b3309 in ClientNetworking::ConnectToLocalHostServer(boost::posix_time::seconds) ()
#6	0x004b7c3c in HumanClientApp::NewSinglePlayerGame(bool) ()
#7	0x002ddd61 in IntroScreen::OnQuickStart() ()
#8	0x002edead in boost::_mfi::mf0<void, IntroScreen>::operator()(IntroScreen*) const ()
#9	0x002ee2bb in void boost::_bi::list1<boost::_bi::value<IntroScreen*> >::operator()<boost::_mfi::mf0<void, IntroScreen>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, IntroScreen>&, boost::_bi::list0&, int) ()
#10	0x002ee304 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, IntroScreen>, boost::_bi::list1<boost::_bi::value<IntroScreen*> > >::operator()() ()
#11	0x002ee16d in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, IntroScreen>, boost::_bi::list1<boost::_bi::value<IntroScreen*> > >, void>::invoke(boost::detail::function::function_buffer&) ()
#12	0x01073b1b in boost::function0<void>::operator()() const ()
#13	0x00226cbe in boost::signals::detail::unusable boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >::operator()<boost::signals::detail::connection_slot_pair>(boost::signals::detail::connection_slot_pair const&) const ()
#14	0x00361e70 in boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>::dereference() const ()
#15	0x00013807 in boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>::reference boost::iterator_core_access::dereference<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator> >(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator> const&) ()
#16	0x00013837 in boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int>::operator*() const ()
#17	0x00013865 in boost::detail::postfix_increment_proxy<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator> >::postfix_increment_proxy(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator> const&) ()
#18	0x00013894 in boost::detail::postfix_increment_result<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::signals::detail::unusable const&, boost::single_pass_traversal_tag>::type boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int>(boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, int>&, int) ()
#19	0x000138e1 in void boost::last_value<void>::operator()<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator> >(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound0<void>::caller<boost::function<void ()()> >, boost::signals::detail::named_slot_map_iterator>) const ()
#20	0x00013adc in boost::signal0<void, boost::last_value<void>, int, std::less<int>, boost::function<void ()()> >::operator()() ()
#21	0x00de8bcf in GG::Button::LClick(GG::Pt const&, GG::Flags<GG::ModKey>) ()
#22	0x01055e5e in GG::Wnd::HandleEvent(GG::WndEvent const&) ()
#23	0x00ee6d90 in GG::GUIImpl::HandleRelease(unsigned int, GG::Pt const&, int) ()
#24	0x00eea3e9 in GG::GUI::HandleGGEvent(GG::GUI::EventType, GG::Key, unsigned int, GG::Flags<GG::ModKey>, GG::Pt const&, GG::Pt const&) ()
#25	0x00ddf71b in OISInput::mouseReleased(OIS::MouseEvent const&, OIS::MouseButtonID) ()
#26	0x00ddf5b4 in non-virtual thunk to OISInput::mouseReleased(OIS::MouseEvent const&, OIS::MouseButtonID) ()
#27	0x006a4699 in OIS::MacMouse::_mouseCallback(OpaqueEventRef*) ()
#28	0x006a1066 in MouseWrapper(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) ()
#29	0x972e1c2f in DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) ()
#30	0x972e0ef6 in SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) ()
#31	0x973037f3 in SendEventToEventTarget ()
#32	0x9731534f in ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) ()
#33	0x972e2080 in DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) ()
#34	0x972e0ef6 in SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) ()
#35	0x973037f3 in SendEventToEventTarget ()
#36	0x0858d9df in Ogre::WindowEventUtilities::messagePump() ()
#37	0x00dd71d9 in (anonymous namespace)::OgreModalEventPump::operator()() ()
#38	0x00dd7b47 in GG::OgreGUI::Run() ()
#39	0x00edf70a in GG::GUI::operator()() ()
#40	0x0001b36b in mainSetupAndRunOgre() ()
#41	0x0062c477 in -[OgreController applicationDidFinishLaunching:] ()
#42	0x98fce3bf in _nsnote_callback ()
#43	0x9380e793 in __CFXNotificationPost ()
#44	0x9380e19a in _CFXNotificationPostNotification ()
#45	0x98fc325c in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#46	0x98fd0669 in -[NSNotificationCenter postNotificationName:object:] ()
#47	0x95c06422 in -[NSApplication _postDidFinishNotification] ()
#48	0x95c06332 in -[NSApplication _sendFinishLaunchingNotification] ()
#49	0x95d5d4ed in -[NSApplication(NSAppleEventHandling) _handleAEOpen:] ()
#50	0x95d5d10d in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()
#51	0x990036c8 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#52	0x9900348c in _NSAppleEventManagerGenericHandler ()
#53	0x910a2f58 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*) ()
#54	0x910a2e57 in dispatchEventAndSendReply(AEDesc const*, AEDesc*) ()
#55	0x910a2d61 in aeProcessAppleEvent ()
#56	0x97316197 in AEProcessAppleEvent ()
#57	0x95bd69ca in _DPSNextEvent ()
#58	0x95bd5fce in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#59	0x95b98247 in -[NSApplication run] ()
#60	0x95b902d9 in NSApplicationMain ()
#61	0x0062c2d1 in main ()

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

Re: 3582 Build Errors, OS X 10.6

#108 Post by Geoff the Medio »

It's possible there's a problem with the SVN version of boost... Is there a reason you're using that and not a release version?

I don't think the relevant code has changed significantly since the last release, so it would be nice to know if things stopped working at a particular release...

Do you have any firewall software running that could be interfering?

I'm not sure what else to suggest...

night
Space Kraken
Posts: 102
Joined: Sun Jun 12, 2011 1:21 pm

Re: 3582 Build Errors, OS X 10.6

#109 Post by night »

My firewall is disabled of course.
I thought of going back to a stable release of Boost, too.
I am going to start from scratch with a fresh SDK and a stable release of boost so I get a nice and clean build of FreeOrion.

night
Space Kraken
Posts: 102
Joined: Sun Jun 12, 2011 1:21 pm

Re: 3582 Build Errors, OS X 10.6

#110 Post by night »

FreeOrion is back to the mac.
I started the project from scratch using a fresh SDK, revision 4000 of FreeOrion, revision 1042 of GG and Boost 1.46.1 headers and binaries. Everything is working correctly now.
At the moment I am uploading "my" SDK so everyone will be able to compile FreeOrion on their mac again.

EDIT: You can get it here.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#111 Post by neuro »

WOW! I got it building fine. I got it to play, and even a few turns into the game. It takes a long time for a "Generating Universe" to complete, but it works.

After looking at the Xcode Project, there's in-active links within the "Dependencies/Static Libraries/boost" for the new boost libraries. Should we remove those dependencies?

And should we move the boost library references at the top of the project to inside that folder?

EDIT:
Last, there's 3 sets of duplicate references to the libboost_filesystem, libboost_python, etc. libraries (even though they're all the same file). These are actually references to the linkages of them used in FreeOrionClient, FreeOrionServer, and FreeOrionAI. So don't delete them! I did and caused some compile issues. But it's still ok to delete the old references, and put the boost refs into the "boost" folder.

EDIT:
Should we update the Wiki for Compiling with Mac to include these steps, this post, or these references?

I did get a small crash mid-game of this :
Application Specific Information:
Assertion failed: (it != m_rows.end()), function ClickAtRow, file /Users/dominictancredi/Downloads/freeorion-sdk-1/FreeOrion/Xcode/../GG/src/ListBox.cpp, line 1865.


But that's for some other day. I was trying to get a colony ship to colonize.

So I guess now we've got a build of FreeOrion running on Mac! I guess I'll tackle my previous task of splitting the FleetWnd's.

Unless there are other priority items you need Geoff to get us to v0.4 or finish v0.3.x, or want to pair program on something night? I'm glad we have a buildable version back up for Mac dev's.

night
Space Kraken
Posts: 102
Joined: Sun Jun 12, 2011 1:21 pm

Re: 3582 Build Errors, OS X 10.6

#112 Post by night »

You can just move the libs around and delete the old ones in the Dependencies folder.
I will have a look at the code and see what I can do with my current C++ skills... maybe we can find something we can work on as a team (apart from keeping FreeOrion running on the newest MacOSs/Xcodes).
OS X 10.7 Lion will be out in 2 weeks...

EDIT: Rewriting the wiki article would make sense. Maybe we can "polish" my upload so there is a new SDK for Intel macs.
EDIT2: Do you know a good IRC Client for OS X? Communication would be a bit easier and faster...

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

Re: 3582 Build Errors, OS X 10.6

#113 Post by Geoff the Medio »

night wrote:EDIT: Rewriting the wiki article would make sense. Maybe we can "polish" my upload so there is a new SDK for Intel macs.
Having an updated SDK would be good.
neuro wrote:I did get a small crash mid-game of this :
Application Specific Information:
Assertion failed: (it != m_rows.end()), function ClickAtRow, file /Users/dominictancredi/Downloads/freeorion-sdk-1/FreeOrion/Xcode/../GG/src/ListBox.cpp, line 1865.
This sounds like the same crash I've been having with the load file dialog, where it crashes if you click below the files shown in a list. I have no idea why it started happening recently, but this seems to fix it for me:

Code: Select all

Index: ListBox.cpp
===================================================================
--- ListBox.cpp	(revision 1042)
+++ ListBox.cpp	(working copy)
@@ -1862,16 +1862,15 @@
 
 void ListBox::ClickAtRow(iterator it, Flags<ModKey> mod_keys)
 {
-    assert(it != m_rows.end());
-    assert(!m_rows.empty());
-
     SelectionSet previous_selections = m_selections;
     if (m_style & LIST_SINGLESEL) {
         // No special keys are being used; just clear all previous selections,
         // select this row, set the caret here.
         m_selections.clear();
-        m_selections.insert(it);
+        if (it != m_rows.end())
+            m_selections.insert(it);
         m_caret = it;
+
     } else {
         if (mod_keys & MOD_KEY_CTRL) { // control key depressed
             if (mod_keys & MOD_KEY_SHIFT && m_caret != m_rows.end()) {
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#114 Post by neuro »

Thanks Geoff, I'll apply that fix.
EDIT2: Do you know a good IRC Client for OS X? Communication would be a bit easier and faster...
I used to use Chatzilla from Firefox plugin. But I think Colloquy is pretty good too.

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

Re: 3582 Build Errors, OS X 10.6

#115 Post by Geoff the Medio »

Geoff the Medio wrote:This sounds like the same crash I've been having with the load file dialog, where it crashes if you click below the files shown in a list. I have no idea why it started happening recently, but this seems to fix it for me:
tzlaine has committed a patch to GG that reportedly fixes this issue (differently from how my patch did).

Post Reply