Crash on desing rotation [SVN 7757]

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
Cjkjvfnby
AI Contributor
Posts: 539
Joined: Tue Jun 24, 2014 9:55 pm

Crash on desing rotation [SVN 7757]

#1 Post by Cjkjvfnby »

Steps to reproduce:
- start game
- open design screen
- click right arrow near hull 4 times (see mouse pointer on screenshot)

Observed result:
- game crashes to desctop
- last items has incorrect name

Expected result:
- no crash

Windows 7x64
[SVN 7757]

logs in crash.zip
Attachments
crash.zip
(11.19 KiB) Downloaded 114 times
crash_on_click.png
crash_on_click.png (58.38 KiB) Viewed 1591 times
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Crash on desing rotation [SVN 7757]

#2 Post by Dilvish »

Cjkjvfnby wrote:Steps to reproduce:
- start game
- open design screen
- click right arrow near hull 4 times (see mouse pointer on screenshot)

Observed result:
- game crashes to desctop
- last items has incorrect name
I can't repeat that crash, and the last item has the correct name for me. Here is what that screen portion looks like for me, and after hitting that arrow 4 times (or more, doesn't change thereafter). DESIGN_WND_MONSTERS has entries in both en.txt and fr.txt (and of course even with others en.txt should be the fallback source). Could you have an error in your stringtable structure? Of course, even if you did, that shouldn't lead to a hard crash, but it might help track down the "main" crash cause.
Attachments
initial view
initial view
design_tabs.png (4.5 KiB) Viewed 1583 times
after pressing right arrow icon 4+ times
after pressing right arrow icon 4+ times
design_tabs1.png (3.82 KiB) Viewed 1583 times
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
Cjkjvfnby
AI Contributor
Posts: 539
Joined: Tue Jun 24, 2014 9:55 pm

Re: Crash on desing rotation [SVN 7757]

#3 Post by Cjkjvfnby »

Dilvish wrote:
Cjkjvfnby wrote:Of course, even if you did, that shouldn't lead to a hard crash, but it might help track down the "main" crash cause.
I fix my stringtables. Long name for last tab cause crash.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Crash on desing rotation [SVN 7757]

#4 Post by Dilvish »

Cjkjvfnby wrote:I fix my stringtables. Long name for last tab cause crash.
Ok, that sounds worth following up on, at least sometime. I'll hope that Mitten.O or someone else who's been active with GG lately might be motivated to look into this more (not that I'm suggesting any recent changes would be the cause).

Regarding your fix for the stringtable, was it simply to add the DESIGN_WND_MONSTERS entry directly to whatever stringtable you're using (i.e., the fallback to en.txt didn't work right), or had there been a different problem with the stringtable?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: Crash on desing rotation [SVN 7757]

#5 Post by Mitten.O »

You have summoned me not in vain. I figured this out using an artificially long title for the tab. The tabwnd wanted to show you the rest of the tab title by moving the view to the right, but there was nowhere to move to anymore, since it was at the last tab. This patch makes the right arrow be appropriately disabled in this situation.
Attachments

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

Any code by me in this post is released under GPL 2.0 or later.

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

Re: Crash on desing rotation [SVN 7757]

#6 Post by Dilvish »

Mitten.O wrote:You have summoned me not in vain.
:lol:

One thing though-- I think I follow the "more_to_show" determination and use fine, but I have to confess I don't have that same sense for the "more_to_hide" determination and use. Could you explain it a bit more?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: Crash on desing rotation [SVN 7757]

#7 Post by Mitten.O »

Pressing the button to the right works by hiding the leftmost tab to make room to show more. If the leftmost tab is the last tab, hiding it wouldn't make sense, since there would be nothing left to see. This was precisely what the code was previously trying to do when the title of the last tab was wider than the room for the entire bar.

Another option would be to not lock the movement at tab edges, but instead make it scroll smoothly. That would improve support for tab titles wider than the bar, but would be less convenient in all other situations, I think.

Am I making any sense?
Any code by me in this post is released under GPL 2.0 or later.

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

Re: Crash on desing rotation [SVN 7757]

#8 Post by Dilvish »

Mitten.O wrote:Am I making any sense?
Yes, thanks very much.

Code: Select all

r7772 | dilvish-fo | 2014-11-27 23:14:07 -0800 (Thu, 27 Nov 2014) | 1 line
patch by Mitten.O fixing a TabWnd crash problem
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