Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #911885

Qt: delete race condition when exiting if the gotodlg was shown

Added by John Robertson 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
gui-qt
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

SIGSEV when exiting if the gotodlg was ever shown. This was caused by the gotodlg class destructor and the global cleanup thread deleting the same 'working' map tile. This proposed fix minimizes the 'working' tile exposure that is held by the gotodlg class.

History

#1 Updated by Marko Lindqvist 7 months ago

Which branches are affected?

#2 Updated by John Robertson 7 months ago

Any Qt branch that caches the 'working' tile (not sure when that was introduced); I haven't checked the S3_0 or S2_6 branches yet. I have mainly been working on a unit-stack-count for the map view (see Feature #911906: Qt - in the map view, display the unit stack count). I have the Qt platform working and need to implement the two GTK and the one SDL platforms. I'll work on this in conjunction with the unit-stack-count feature.

#3 Updated by Marko Lindqvist 7 months ago

Should the destructor have direct 'working' tile cleanup at all. Shouldn't dialog always get closed before destruction, and that closing to free the 'working' tile?

#4 Updated by Marko Lindqvist 7 months ago

  • Status changed from New to In Progress

John Robertson wrote:

the gotodlg class destructor and the global cleanup thread deleting the same 'working' map tile.

There's no multiple threads in play in here, and it's not double free that it's trying to do.
Rather it seems that city hash has already been freed ( idex_free() ) when the destructor is called, causing lookup for the city on tile to crash. We free city hash as part of our explicit cleanup, before global destructors run.

#5 Updated by Marko Lindqvist 7 months ago

There's also a related (I think the proper fix for one will fix also the other) bug that gotodlg is not popped down at all when leaving the game.

#6 Updated by Marko Lindqvist 7 months ago

Here's my proposal for the fix.

#7 Updated by John Robertson 7 months ago

Yes, I think your fix is better.

#8 Updated by Marko Lindqvist 7 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF