Help 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 #856480

Unit order sub_target sometimes not initialised after loading savegame

Added by Jacob Nevins over 2 years ago. Updated over 2 years ago.

Start date:
Due date:
% Done:


Estimated time:


In #854922-5, Chippo Elder reports that on loading "freeciv-T0044-Y-1850-auto.sav.xz" attached to that ticket, they get

Trying to put -1037224192 into 16 bits; it will result 14080 at receiving side.
Trying to put 1129066305 into 16 bits; it will result 12097 at receiving side.

I can reproduce. Debug logging and valgrind point to sub_target in PACKET_INFO_INFO orders[] array not being initialised.

There are paths in savegame3.c which can do that, for orders other than those on a particular list (probably including the common MOVE order).

m-unit-sub-target-uninit.patch (1 KB) m-unit-sub-target-uninit.patch master Jacob Nevins, 2020-01-18 11:13 PM
freeciv-T0074-Y-0650-auto.sav.bz2 (74.8 KB) freeciv-T0074-Y-0650-auto.sav.bz2 Chippo Elder, 2020-02-16 08:42 PM

Related issues

Related to Freeciv - Bug #871781: Valid orders with non extra sub targets deletedClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>


#1 Updated by Jacob Nevins over 2 years ago

#2 Updated by Jacob Nevins over 2 years ago

  • Status changed from Resolved to Closed

#3 Updated by Chippo Elder over 2 years ago

I haven't seen this error for quite a while, and thought that it had been fixed everywhere.

I see it again in 2.6.2+ (1b52914594). The exact text is:

Trying to put 17.680769 with factor 1000000 in 32 bits; it will result 17.680767 at receiving side, having error of 1.907349 units.

Attached is a savegame that produces it on loading.

As before, I don't see any badness other than a worrying message.

#4 Updated by Jacob Nevins over 2 years ago

That is almost certainly unrelated; the "Trying to put ..." message can have a lot of different causes. Notice the "factor 1000000" that wasn't in the messages in this bug. And it surely isn't the topic of this bug, which had a specific root cause for which a fix has long since been committed. Please raise a new bug. (Although this one looks like it's just a conversion accuracy thing.)

#5 Updated by Sveinung Kvilhaugsvik over 2 years ago

  • Related to Bug #871781: Valid orders with non extra sub targets deleted added

Also available in: Atom PDF