r 7847 crashes on Linux (Ubuntu)

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#16 Post by Dilvish »

Geoff the Medio wrote:Edit: patch attached. If that works, maybe try switching the GenerateSitrepMessage data parser to take a proper string ValueRef instead of just a string constant.
That patch worked fine for me. I took a stab at adjusting string_and_string_ref sub-parser used in the GenerateSitrepMessage parser, but apparently that's a bit past my parse-fu as yet.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: r 7847 crashes on Linux (Ubuntu)

#17 Post by Geoff the Medio »

Dilvish wrote:I took a stab at adjusting string_and_string_ref sub-parser used in the GenerateSitrepMessage parser, but apparently that's a bit past my parse-fu as yet.
Edit: try

Code: Select all

            string_and_string_ref
                =    parse::label(Tag_token)  >> tok.string [ _a = _1 ]
                >>   parse::label(Data_token)
                >> ( int_value_ref      [ _val = construct<string_and_string_ref_pair>(_a, new_<ValueRef::StringCast<int> >(_1)) ]
                   | double_value_ref   [ _val = construct<string_and_string_ref_pair>(_a, new_<ValueRef::StringCast<double> >(_1)) ]
                   | tok.string         [ _val = construct<string_and_string_ref_pair>(_a, new_<ValueRef::Constant<std::string> >(_1)) ]
                   | string_value_ref   [ _val = construct<string_and_string_ref_pair>(_a, _1) ]
                   )
                ;
Edit2: Several patches combined... StringValueRef, Statistic reorganization, GenerateSitrepMessage, misc tweaks..
Attachments

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


User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#18 Post by Dilvish »

Geoff the Medio wrote:Edit2: Several patches combined... StringValueRef, Statistic reorganization, GenerateSitrepMessage, misc tweaks..
That patch compiled & ran fine; the runtest included getting a 'Then colony on blah has reached recolonizing size." which is from a GenerateSitrepMessage Effect.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: r 7847 crashes on Linux (Ubuntu)

#19 Post by Geoff the Medio »

Dilvish wrote:That patch compiled & ran fine; the runtest included getting a 'Then colony on blah has reached recolonizing size." which is from a GenerateSitrepMessage Effect.
What if you use the same patch, but uncomment the statistic_3 parts in ValueRefParserImpl.h ?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#20 Post by Dilvish »

Geoff the Medio wrote:What if you use the same patch, but uncomment the statistic_3 parts in ValueRefParserImpl.h ?
compiles fine, but it goes back to initialization deadlock when I try to run it. That happens even if I leave the line

Code: Select all

        //|   statistic_3
commented out, apparently it's the reference to parse::value_ref_parser<T>() that throws it off.

I did get it to work, though. Taking a cue from initialize_expression_parsers(), I broke out the initialization of statistic_3 into a separate initialization and pass into it an intermediate form of the main value_ref parser. Compiles & appears to run fine, though I haven't tested the specific new functionality. I suppose that a limitation of this approach is that you can't do a statistic of a statistic of a valueRef, but that seems like a pretty modest and reasonable limitation.

Attached is a patch that includes your above patch plus my changes (to files ValueRefParserImpl.h, DoubleValueRefParser.cpp and IntValueRefParser.cpp).
Attachments

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

If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: r 7847 crashes on Linux (Ubuntu)

#21 Post by Geoff the Medio »

Does the attached build / run?

I'd rather keep the distinct parser types segregated by passing in the sub-parsers as in this patch...
Attachments

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


User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: r 7847 crashes on Linux (Ubuntu)

#22 Post by Dilvish »

Geoff the Medio wrote:Does the attached build / run?
Yes, it does.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply