bugFreeciv - Bugs: bug #21899, Crash on clicking unit that was...

 
 
Show feedback again

bug #21899: Crash on clicking unit that was moved out of city

Submitted by:  None
Submitted on:  Tue 08 Apr 2014 05:22:18 AM UTC  
 
Category: generalSeverity: 4 - Important
Priority: 5 - NormalStatus: Fixed
Assigned to: pepeto <pepeto>Originator Email: -unavailable-
Open/Closed: ClosedRelease: 2.4.2
Operating System: GNU/LinuxPlanned Release: 2.4.3,2.5.0,2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 14 Sep 2014 01:49:14 PM UTC, comment #14:

The 2.4.2 Windows crash in comment #1 is not obviously related to everything else here.

However, if the original poster asserts that it happened after an alliance breakup (they didn't say explicitly), I guess it might be a knock-on effect?

Otherwise it is reminiscent of the never-explained 2.3.4 backtraces in bug #21272 and bug #20939, although not identical.

If it looks like it's unrelated to alliance breakup, please raise a new ticket rather than discussing it here.

Jacob Nevins <jtn>
Project Administrator
Tue 20 May 2014 11:52:47 AM UTC, comment #13:

Revisions 24904, 24905 and 24906 fix this particular bug. But a more general bug about out of sight packets is still present (see bug #22049).

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 20 May 2014 11:50:08 AM UTC, SVN revision 24909:

Even if errors are detected, do not return before unloading the cargo from a
transport. Else, there could potentially freed unit pointers in the cargo unit
list.

From an anonymous report

See gna bug #21899

(Browse SVN revision 24909)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 20 May 2014 11:50:03 AM UTC, SVN revision 24908:

Even if errors are detected, do not return before unloading the cargo from a
transport. Else, there could potentially freed unit pointers in the cargo unit
list.

From an anonymous report

See gna bug #21899

(Browse SVN revision 24908)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 20 May 2014 11:49:56 AM UTC, SVN revision 24907:

Even if errors are detected, do not return before unloading the cargo from a
transport. Else, there could potentially freed unit pointers in the cargo unit
list.

From an anonymous report

See gna bug #21899

(Browse SVN revision 24907)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 20 May 2014 11:41:03 AM UTC, SVN revision 24906:

Don't send out of sight for transported units when moving their transporter.

Reported anonymously

See gna bug #21899

(Browse SVN revision 24906)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 20 May 2014 11:41:00 AM UTC, SVN revision 24905:

Don't send out of sight for transported units when moving their transporter.

Reported anonymously

See gna bug #21899

(Browse SVN revision 24905)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 20 May 2014 11:40:57 AM UTC, SVN revision 24904:

Don't send out of sight for transported units when moving their transporter.

Reported anonymously

See gna bug #21899

(Browse SVN revision 24904)

pepeto <pepeto>
Project MemberIn charge of this item.
Sat 17 May 2014 11:34:06 AM UTC, comment #6:

Updated server patch to apply over patch #4693.

(file #20749)

pepeto <pepeto>
Project MemberIn charge of this item.
Fri 16 May 2014 07:06:56 PM UTC, comment #5:

Actually, the player doesn't lose vision, but the server seems to assume it did.

In "server/unittools.c", unit_move():

can_player_see_unit() returns FALSE because can_player_see_units_in_city() does. unit_goes_out_of_sight() is called whereas it shouldn't for the cargo units.

pepeto <pepeto>
Project MemberIn charge of this item.
Fri 16 May 2014 06:53:06 PM UTC, comment #4:

Do the units being transported belong to (another) allied player? Otherwise I don't understand how one would lose vision when trasnport is moved out but the cargo units, and their vision, still remain.

Marko Lindqvist <cazfi>
Project Administrator
Fri 16 May 2014 06:48:31 PM UTC, comment #3:

Summary:
Diplomatic state is canceled (alliance to peace). The units inside cities are thrown outside. But when a transport is bounced, then it loses vision of the city tile. Cargo units are still there when the server send out of sight signal (removing unit for owned units).

1) The server shouldn't send out of sight signal because the cargo units will follow the transport.
2) The client refuses to unload units which aren't at same tile of their transport. It results that freed pointers are still in usage in the cargo list. This is what why the client crashes when opening the unit selection dialog.

Attached fix for both bugs, separately.

(file #20743, file #20744)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 08 Apr 2014 08:03:42 PM UTC, comment #2:

I confirm with the current S2_4 branch. When canceling the treaty with Westphalians, I get series of failed assertion : first, I get 3 times

and afterward, an alternation with :

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 08 Apr 2014 01:47:28 PM UTC, comment #1:

Am not the same user who posted the original bug.
But I can confirm the bug also exists in Windows Freeciv 2.4.2
The client crashes, the server is fine. The bug report is below.

This report is almost identical to the series I posted earlier
bug #21874: Windows Freeciv 2.4.2 GTK access violation causes client crash But the cause is completely different and this one is reproducible.

Anonymous
Tue 08 Apr 2014 05:22:18 AM UTC, original submission:

There seems to be a bug after units are automatically moved due to downgrading pact from Alliance to Armistice. Clicking the moved unit will result in a crash.

How to reproduce:

0) Load attachment file
1) Center on Grevenbroich
2) Cancel treaty with Westphalians
3) Click on the transport next to Grevenbroich

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20744:  unit_transport_unload.patch added by pepeto (572B - text/x-patch)
file #20497:  freeciv_AI_WATCH-T0280-Y01810-auto.sav.bz2 added by None (596kB - application/x-bzip2)

 

Digest:
   patch dependencies.

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by pepeto (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 14 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 20 May 2014 11:52:47 AM UTCpepetoStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 17 May 2014 11:34:06 AM UTCpepetoAttached File-=>Added transported_units_not_out_of_sight2.patch, #20749
    Fri 16 May 2014 06:49:02 PM UTCpepetoDependencies-=>Depends on patch #4693
    Fri 16 May 2014 06:48:31 PM UTCpepetoAttached File-=>Added transported_units_not_out_of_sight.patch, #20743
      Attached File-=>Added unit_transport_unload.patch, #20744
      StatusConfirmed=>Ready For Test
      Planned Release=>2.4.3,2.5.0,2.6.0
    Thu 15 May 2014 03:46:37 PM UTCpepetoAssigned toNone=>pepeto
    Mon 12 May 2014 01:47:57 PM UTCpepetoDependencies-=>bugs #20722 is dependent
    Tue 08 Apr 2014 08:03:42 PM UTCpepetoCategoryNone=>general
      Severity3 - Normal=>4 - Important
      StatusNone=>Confirmed
    Tue 08 Apr 2014 05:22:18 AM UTCNoneAttached File-=>Added freeciv_AI_WATCH-T0280-Y01810-auto.sav.bz2, #20497
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup