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 #797679

Buggy (City):inspire_partisans(plr) in clients

Added by Alexandro Ignatiev over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Client
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Strange behaviour of Lua function (City):inspire_partisans(plr): returns 1 for plr=owner and 0 for other players. Moreover, on certain conditions it makes client to fail. Fragment of console output:

1: in citizens_nation_get() [citizens.c::83]: assertion 'pcity->nationality != ((void *)0)' failed.
2: Backtrace:
2:     0: /opt/freeciv2_6/lib/libfreeciv.so.0(backtrace_print+0x37) [0x7fb4df2fe4e7]
2:     1: /opt/freeciv2_6/lib/libfreeciv.so.0(vdo_log+0x97) [0x7fb4df305707]
2:     2: /opt/freeciv2_6/lib/libfreeciv.so.0(do_log+0xa6) [0x7fb4df3057e6]
2:     3: /opt/freeciv2_6/lib/libfreeciv.so.0(fc_assert_fail+0x14a) [0x7fb4df305aba]
2:     4: /opt/freeciv2_6/lib/libfreeciv.so.0(citizens_nation_get+0xae) [0x7fb4df2171be]
2:     5: /opt/freeciv2_6/bin/freeciv-gtk3(api_methods_city_inspire_partisans+0xbb) [0x55c7d532104b]
2:     6: /opt/freeciv2_6/bin/freeciv-gtk3(+0x142b33) [0x55c7d530ab33]
2:     7: /opt/freeciv2_6/bin/freeciv-gtk3(+0x129c27) [0x55c7d52f1c27]
2:     8: /opt/freeciv2_6/bin/freeciv-gtk3(+0x13895d) [0x55c7d530095d]
2:     9: /opt/freeciv2_6/bin/freeciv-gtk3(+0x129f8f) [0x55c7d52f1f8f]
2:    10: /opt/freeciv2_6/bin/freeciv-gtk3(+0x129fe1) [0x55c7d52f1fe1]
2:    11: /opt/freeciv2_6/bin/freeciv-gtk3(+0x129352) [0x55c7d52f1352]
2:    12: /opt/freeciv2_6/bin/freeciv-gtk3(+0x12a3bb) [0x55c7d52f23bb]
2:    13: /opt/freeciv2_6/bin/freeciv-gtk3(lua_pcallk+0xd5) [0x55c7d52ed185]
2:    14: /opt/freeciv2_6/bin/freeciv-gtk3(luascript_call+0x17f) [0x55c7d52fc49f]
2:    15: /opt/freeciv2_6/bin/freeciv-gtk3(script_client_do_file+0x13) [0x55c7d5242603]
2:    16: /opt/freeciv2_6/bin/freeciv-gtk3(+0x5810d) [0x55c7d522010d]
2:    17: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x19d) [0x7fb4dd2be10d]
...
2:    34: /opt/freeciv2_6/bin/freeciv-gtk3(_start+0x2a) [0x55c7d52183fa]

Maybe that is because I have taken Mali in editor but it somehow stayed a computer player? That seems wrong but I don't know, that's why I put the bug into Client category.

clientscript.lua (2.23 KB) clientscript.lua the script Alexandro Ignatiev, 2019-01-12 08:58 PM
freeciv-T0078-Y-0550-quitidle.sav.gz (52.6 KB) freeciv-T0078-Y-0550-quitidle.sav.gz The savegame on which it fails Alexandro Ignatiev, 2019-01-12 08:59 PM
0013-Fix-client-crash-in-lua-call-to-city-inspire_partisa.patch (2.1 KB) 0013-Fix-client-crash-in-lua-call-to-city-inspire_partisa.patch Marko Lindqvist, 2019-12-03 03:36 PM

History

#1 Updated by Marko Lindqvist over 2 years ago

inspire_partisans() require omniscience, the client has not (and shouldn't have - no support for cheating) all the required information.
The solution is probably something like moving inspire_partisans() to server only side of lua.

#2 Updated by Marko Lindqvist over 1 year ago

Attached patch keeps the lua API untouched, but when called from the client side inspire_partisans() return FALSE also when it cannot determine correct answer.

#3 Updated by Marko Lindqvist over 1 year ago

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

Also available in: Atom PDF