Server crash on exception in r3703

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: Server crash on exception in r3703

#31 Post by q1w2e3r4 »

Just start with removing them from the serialize function, as suggested above.
Done. I stripped the function to just:

Code: Select all

template <class Archive>
void System::serialize(Archive& ar, const unsigned int version)
{
    printf("Serialize System\n");
    ar  & BOOST_SERIALIZATION_BASE_OBJECT_NVP(UniverseObject);
}
It still failed at the same spot. Are trying to remove the members from System still worth it now?

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

Re: Server crash on exception in r3703

#32 Post by Geoff the Medio »

q1w2e3r4 wrote:The only output I get is:

Code: Select all

main() caught exception(std::exception): unregistered class
which leads to me do believe debugging is not on somehow. And that is why I am not seeing the other serializing messages from the code posted earlier in this thread.
I think you're confused about what Logger().debugStream() does. It doesn't output anything to the console, ever. Rather, it outputs to freeorion.log or freeoriond.log (for the client or server, respecitvely) which should be located in ~/.freeorion/

Could you have a look in those files and see what debug lines are present from the changes to Universe::serialized as discussed in this post? viewtopic.php?p=43834#p43834
q1w2e3r4 wrote:Are trying to remove the members from System still worth it now?
Probably not.

As a random guess, could you try replacing the contents of SerializeUniverseExports.ipp, after the #include lines, with

Code: Select all

BOOST_CLASS_EXPORT(System)
BOOST_CLASS_EXPORT(Planet)
BOOST_CLASS_EXPORT(Building)
BOOST_CLASS_EXPORT(Fleet)
BOOST_CLASS_EXPORT(Ship)
(if you haven't already), and if that doesn't work,

Code: Select all

BOOST_CLASS_EXPORT(Planet)
BOOST_CLASS_EXPORT(Building)
BOOST_CLASS_EXPORT(Fleet)
BOOST_CLASS_EXPORT(Ship)
BOOST_CLASS_EXPORT(System)
where I've changed the order of exporting, and if that doesn't work,

Code: Select all

BOOST_CLASS_EXPORT(Planet)
BOOST_CLASS_EXPORT(Building)
BOOST_CLASS_EXPORT(Fleet)
BOOST_CLASS_EXPORT(Ship)
BOOST_CLASS_EXPORT_GUID(System, "System")

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: Server crash on exception in r3703

#33 Post by q1w2e3r4 »

I think you're confused about what Logger().debugStream() does.
You are right, I was. I have now been enlightened. I have attached the log for when I compiled with the removed members of System::serialize()

I did a few test compiles with moving around the Boost macros in your suggestions. They all failed. Also, browsing among boost/serialization/export.hpp, I find that BOOST_CLASS_EXPORT just expands to be BOOST_CLASS_EXPORT_GUID anyways. And BOOST_CLASS_EXPORT_GUID expands to:

Code: Select all

BOOST_CLASS_EXPORT_KEY2(System, "System")
BOOST_CLASS_EXPORT_IMPLEMENT(System)
The hack in SerializeUniverseExports.ipp is a rewrite of BOOST_CLASS_EXPORT_KEY2 without the inline piece of code.
Attachments
freeoriond.log.zip
(13.34 KiB) Downloaded 108 times

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

Re: Server crash on exception in r3703

#34 Post by Geoff the Medio »

Another random idea from googling: Could you try adding this to the start of Universe::serialize in SerializeUniverse.cpp?

Code: Select all

ar.template register_type<System>();

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: Server crash on exception in r3703

#35 Post by q1w2e3r4 »

It worked!

I did a few extra compiles with varying optimizations just to make sure. Inlining is working again. Also, the hack in SerializeUniverseExports.ipp is no longer necessary.

Could you explain what that line of code is actually doing? I am curious.

q

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

Re: Server crash on exception in r3703

#36 Post by Geoff the Medio »

q1w2e3r4 wrote:It worked!
Hmm.
Could you explain what that line of code is actually doing? I am curious.
I don't know... I just found it in some serialization example code here and thought it sounded worth a try, since it appears to involve registering a class, and the exception is about an unregistered class. Why that is necessary for System only, or why it's not done already by exporting the class, I have no idea...

Edit: I've committed some serialization code modifications based on this thread. Could you let me know if they work in GCC?

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: Server crash on exception in r3703

#37 Post by q1w2e3r4 »

I've committed some serialization code modifications based on this thread. Could you let me know if they work in GCC?
Works like a charm.

I am going to do another test on a system with a different version of GCC - I've been doing my compiling with GCC 4.4.1, I am going to try on a system with 4.5

Alucard
Space Krill
Posts: 3
Joined: Sat Oct 02, 2010 9:48 pm

Re: Server crash on exception in r3703

#38 Post by Alucard »

I can also confirm r3806 works for me. I'm finally on turn 1 :D

Debian / gcc 4.3.5 here.

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: Server crash on exception in r3703

#39 Post by q1w2e3r4 »

rats. linking failed with gcc 4.5 on all three executables. attached is the console output of the compilation.

Edit: On second thought, I don't think this has to do with rev 3806 - I think something went wrong with my build environment for openSUSE. Ignore for now...

Edit2: Yeah. something goofy happened to the oS 11.3 build environments in the openSUSE BuildService - unpatched freeorion doesn't link anymore either. I think that rev. 3806 is good.
Attachments
oS11.3_gcc4.5_x86_64_output.txt.zip
(5.3 KiB) Downloaded 136 times

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

Re: Server crash on exception in r3703

#40 Post by Geoff the Medio »

Someone on IRC also reports that 3806 works. Looking at your link error, it doesn't make much sense, as that function is defined... It is a templated function, though, so it's possible it's not generating the relevant code for some reason...

Edit: I'm wondering if a similar problem is going to pop up when trying to start 3D battles, since those involve serializing a system object separately from the code I modified as discussed in this thread. Could someone who was getting the unregistered class crash try starting a game with "freeorion --test-3d-combat" and then get into a battle, and see if things work properly?

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

Re: Server crash on exception in r3703

#41 Post by Geoff the Medio »

I should probably make a new post for this question (from the previous post), since it might otherwise be missed:
Geoff the Medio wrote:Edit: I'm wondering if a similar problem is going to pop up when trying to start 3D battles, since those involve serializing a system object separately from the code I modified as discussed in this thread. Could someone who was getting the unregistered class crash try starting a game with "freeorion --test-3d-combat" and then get into a battle, and see if things work properly?

Post Reply