3582 Build Errors, OS X 10.6

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

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

Re: 3582 Build Errors, OS X 10.6

#91 Post by night » Fri Jun 17, 2011 9:43 pm

Here's the content of freeorion.log:

Code: Select all

2011-06-17 23:18:11,031 ERROR Client : Could not open or read StringTable file "eng_stringtable.txt"
2011-06-17 23:18:11,213 ERROR Client : main() caught exception(GG::Font::BadFile): Face object created from "DejaVuSans.ttf" was invalid

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

Re: 3582 Build Errors, OS X 10.6

#92 Post by Geoff the Medio » Fri Jun 17, 2011 9:47 pm

night wrote:

Code: Select all

2011-06-17 23:18:11,031 ERROR Client : Could not open or read StringTable file "eng_stringtable.txt"
2011-06-17 23:18:11,213 ERROR Client : main() caught exception(GG::Font::BadFile): Face object created from "DejaVuSans.ttf" was invalid
I think both the stringtable and font files are expected to be in the default directory, which is itself in the root data directory.

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

Re: 3582 Build Errors, OS X 10.6

#93 Post by night » Fri Jun 17, 2011 10:10 pm

The files are not missing. I can find them here:

FreeOrion.app/Contents/Resources/default/DejaVuSans.ttf
FreeOrion.app/Contents/Resources/default/eng_stringtable.txt


These paths should be correct.

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

Re: 3582 Build Errors, OS X 10.6

#94 Post by Geoff the Medio » Fri Jun 17, 2011 10:13 pm

Try deleting config.xml. I think I changed the stored pathes for those files from relative to absolute recently, so if the old version is stored in your config.xml, that would explain the problem and be consistent with the error messages lacking a bunch of directory tree details before the final file name...

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

Re: 3582 Build Errors, OS X 10.6

#95 Post by neuro » Fri Jun 17, 2011 10:15 pm

The boost libraries you link to are just for filesystem and system (and a static_ptr_helper.o - not sure where this goes.) Do you have the other files? I'm downloading and re-building the latest from boost (1.46) and trying that.

FreeOrionServer
"_main", referenced from:

"boost::system::generic_category()", referenced from:

"boost::system::system_category()", referenced from:

"boost::signals::detail::call_notification::call_notification(boost::shared_ptr<boost::signals::detail::signal_base_impl> const&)", referenced from:

"boost::signals::detail::named_slot_map::end()", referenced from:

"boost::signals::detail::named_slot_map::begin()", referenced from:

"boost::signals::detail::call_notification::~call_notification()", referenced from:

"boost::signals::trackable::~trackable()", referenced from:

"boost::signals::detail::signal_base::~signal_base()", referenced from:

"boost::signals::detail::signal_base::signal_base(boost::function2<bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group> const&, boost::any const&)", referenced from:

"ServerApp::GetApp()", referenced from:

"ServerApp::GetUniverse()", referenced from:

"ServerApp::Empires()", referenced from:

"boost::filesystem2::detail::dir_itr_close(void*&, void*&)", referenced from:

"boost::filesystem2::detail::dir_itr_increment(void*&, void*&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, boost::filesystem2::file_status&, boost::filesystem2::file_status&)", referenced from:

"boost::filesystem2::detail::not_found_error()", referenced from:

"boost::filesystem2::detail::dir_itr_first(void*&, void*&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, boost::filesystem2::file_status&, boost::filesystem2::file_status&)", referenced from:

"boost::filesystem2::detail::status_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::system::error_code&)", referenced from:

"boost::this_thread::sleep(boost::posix_time::ptime const&)", referenced from:

"ClientApp::GetApp()", referenced from:

"ClientApp::EmpireID() const", referenced from:

"boost::filesystem2::detail::get_current_path_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)", referenced from:

"boost::filesystem2::detail::create_directory_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:

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

Re: 3582 Build Errors, OS X 10.6

#96 Post by night » Fri Jun 17, 2011 10:16 pm

WTF?! I deleted all files in /Users/username/Library/Application Support/FreeOrion to get clean logs and all of a sudden the game works!

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

Re: 3582 Build Errors, OS X 10.6

#97 Post by Geoff the Medio » Fri Jun 17, 2011 10:19 pm

night wrote:WTF?! I deleted all files in /Users/username/Library/Application Support/FreeOrion to get clean logs and all of a sudden the game works!
If that included config.xml, that makes sense. See my previous post.

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

Re: 3582 Build Errors, OS X 10.6

#98 Post by night » Fri Jun 17, 2011 10:35 pm

<EDIT>
Here are my Boost includes, so you do not have to do all the svn stuff.
</EDIT>

Just get Boost from their svn:

Code: Select all

svn co http://svn.boost.org/svn/boost/trunk boost-trunk
Replace the include files in freeorion-sdk/FreeOrion/Xcode/dep/local/include/boost with those you got from svn.

Now you should only have linker errors left when you try to build FreeOrion.

Build the i386 version of the Boost libs now (or try to use my files first so you do not have to wait).

Some libs won't compile, but you will still get the .o files.

Have a look at the linker errors now. You will see that they are all somehow related to a part of boost like:

Code: Select all

boost::filesystem3:: ...
Then just import the .a/.o file of the respective lib into your target and put it at the top of the list.
Last edited by night on Fri Jun 17, 2011 10:51 pm, edited 1 time in total.

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

Re: 3582 Build Errors, OS X 10.6

#99 Post by night » Fri Jun 17, 2011 10:43 pm

When I try to start a new game, it crashes again:

Code: Select all

main() caught exception(std::runtime_error): bind: Address already in use

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

Re: 3582 Build Errors, OS X 10.6

#100 Post by Geoff the Medio » Fri Jun 17, 2011 10:50 pm

night wrote:When I try to start a new game, it crashes again:

Code: Select all

main() caught exception(std::runtime_error): bind: Address already in use
Seems to be a Unix networking problem... Something's already using the port that FreeOrion is trying to use to connect between the client and server, or perhaps FreeOrion crashing after starting a game before left the port busy?

I believe the relevant ports are 12345 and 12346.

If you could find the line, function or library call where that crash happens though, it'd be useful... There should probably be a try / catch block around it to show an error instead of crashing.

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

Re: 3582 Build Errors, OS X 10.6

#101 Post by night » Fri Jun 17, 2011 11:09 pm

The error could be in ClientNetworking.cpp in line 184.

Code: Select all

    try {
        for (tcp::resolver::iterator it = resolver.resolve(query); it != end_it; ++it) {
            m_socket.close();
            boost::asio::deadline_timer timer(m_io_service);
            if (TRACE_EXECUTION)
                Logger().debugStream() << "ClientNetworking::ConnectToServer : attempting to "
                                       << "connect to server at " << ip_address;
            m_socket.async_connect(*it, boost::bind(&ClientNetworking::HandleConnection, this,
                                                    &it,
                                                    &timer,
                                                    boost::asio::placeholders::error));
            timer.expires_from_now(timeout);
            timer.async_wait(boost::bind(&ClientNetworking::CancelRetries, this));
            m_cancel_retries = false;
            m_io_service.run();
            m_io_service.reset();
            if (Connected()) {
                m_socket.set_option(boost::asio::socket_base::linger(true, SOCKET_LINGER_TIME));
                if (TRACE_EXECUTION)
                    Logger().debugStream() << "ClientNetworking::ConnectToServer : starting "
                                           << "networking thread";
184 --->                boost::thread(boost::bind(&ClientNetworking::NetworkingThread, this));
                break;
            }
        }
    } catch (const std::exception& e) {
        Logger().errorStream() << "ClientNetworking::ConnectToServer unable to connect to server at " << ip_address << " due to exception: " << e.what();
    }
I'll go to bed now.

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

Re: 3582 Build Errors, OS X 10.6

#102 Post by neuro » Fri Jun 17, 2011 11:14 pm

Thanks night! I grabbed the latest from svn, copied over the boost lib, and was recompiling. But it's quicker to just use your libs.

I'll follow your steps and try to catch up before I crash tonight.

Thanks again.

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

Re: 3582 Build Errors, OS X 10.6

#103 Post by Geoff the Medio » Fri Jun 17, 2011 11:15 pm

night wrote:The error could be in ClientNetworking.cpp in line 184.

Code: Select all

184 --->                boost::thread(boost::bind(&ClientNetworking::NetworkingThread, this));
[...]
    } catch (const std::exception& e) {
I think std::runtime_error is derived from std::exception, so if that line was where the exception was thrown, it should presumably be caught by the catch block there, avoiding a crash, since the exception is not re-thrown.

Also, from what I'm reading, the "bind" in the error message doesn't appear to be boost::bind but rather is something to do with sockets. There are lots of hits on google for "bind: Address already in use" that appear to be non-boost related.

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

Re: 3582 Build Errors, OS X 10.6

#104 Post by night » Sat Jun 18, 2011 6:50 am

The exception is thrown before line 184 is executed. I created some breakpoints just before that line.
I start the game, then I click on Quick Start, after that I get the bind exception. When I go on everything works up to line 184 where the game crashes.
I set TRACE_EXECUTION to true in ClientNetworking.cpp and got this log:

Code: Select all

2011-06-18 08:37:43,942 DEBUG Client : OpenAL initialized. Version 1.1Renderer SoftwareVendor Apple Computer Inc.
Extensions: AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER

2011-06-18 08:37:45,661 DEBUG Client : BuildDesignatorWnd::BuildSelector::Refresh()
2011-06-18 08:37:45,959 DEBUG Client : PartsListBox::Populate time: 0.007
2011-06-18 08:37:46,367 DEBUG Client : Limited FPS to 60
2011-06-18 08:37:46,386 DEBUG Client : HumanClientApp::HumanClientApp window size: 1920x1080 at 0x0
2011-06-18 08:37:46,386 DEBUG Client : OpenGL Version Number: 2.1
2011-06-18 08:37:46,386 DEBUG Client : (HumanClientFSM) IntroMenu
2011-06-18 08:37:46,386 DEBUG Client : (HumanClientFSM) IntroMenuIdle
2011-06-18 08:37:46,390 DEBUG Client : HumanClientApp::Enter2DMode()
2011-06-18 08:37:50,837 DEBUG Client : ClientNetworking::ConnectToServer : attempting to connect to server at 127.0.0.1
2011-06-18 08:37:50,837 DEBUG Client : ClientNetworking::HandleConnection : connected
2011-06-18 08:37:50,837 DEBUG Client : ClientNetworking::ConnectToServer : starting networking thread

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

Re: 3582 Build Errors, OS X 10.6

#105 Post by Geoff the Medio » Sat Jun 18, 2011 7:42 am

Does the bind problem keep happening after a system reboot?

Can you find out if anything else is running that's using network ports 12345 or 12346 on your system?

What do you mean by you "get the bind exception" but are then able to continue on? Is the exception being thrown / reported by the client, or the server that the client launches when you try to start a game? If the latter, there's probably a freeoriond.log file being created as well, and the client's crash isn't directly due to the exception, but is a secondard consequence of the resulting failure of networking stuff to be set up properly...

Post Reply