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

Server crash after loading savegame with worker tasks
0%
Description
When loading save from Bug #657396 (toltecs-T0276-Y01784-manual.sav.bz2)
And taking player(jtn) server sometimes crashes.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 extra_number (pextra=0x200000003) at extras.c:136
136 return pextra->id;
(gdb) bt
#0 extra_number (pextra=0x200000003) at extras.c:136
#1 0x00005650e30f71b5 in package_and_send_worker_tasks (pcity=0x5650e49efa30) at citytools.c:3207
#2 0x00005650e308ed4c in send_all_info (dest=<optimized out>) at srv_main.c:628
#3 0x00005650e3091035 in srv_ready () at srv_main.c:3149
#4 0x00005650e30929d5 in srv_main () at srv_main.c:3284
#5 0x00005650e30886e3 in main (argc=<optimized out>, argv=0x7ffc313cb528) at civserver.c:476
History
#1
Updated by Anonymous about 4 years ago
- File toltec-crash.sav.bz2 toltec-crash.sav.bz2 added
Hmm, its a bit modified save , it crashes when starting.
#2
Updated by Anonymous about 4 years ago
Its not related to qt client, to reproduce that save you can use save from Bug #657396, load in gtk2, put all units on sentry, save. try reload.
#3
Updated by Jacob Nevins about 4 years ago
Hm, I've not managed to reproduce this crash in a couple of minutes of trying, either from the savegame attached here or by the method in comment 2.
package_and_send_worker_tasks() in the backtrace is probably a big clue.
#4
Updated by Jacob Nevins about 4 years ago
(The file attached to this ticket is a straight copy of the one referenced in the other ticket, not a modified version.)
Still can't reproduce it, but staring at code I notice that sg_load_player_cities() doesn't initialise (struct worker_task)->tgt if the savegame 'target' is "-", which it is in the two tasks in this save file.
#5
Updated by Jacob Nevins about 4 years ago
- File 26c_workertask.sav.bz2 26c_workertask.sav.bz2 added
And indeed if I run valgrind on the server with a rather smaller savegame containing a terrain-conversion city task (attached):
==6000== Conditional jump or move depends on uninitialised value(s) ==6000== at 0x4A4BC1: package_and_send_worker_tasks (citytools.c:3206) ==6000== by 0x43BB4B: send_all_info (srv_main.c:675) ==6000== by 0x43DDC5: srv_ready (srv_main.c:3236) ==6000== by 0x43F834: srv_main (srv_main.c:3371) ==6000== by 0x435319: main (civserver.c:476)
#6
Updated by Jacob Nevins about 4 years ago
- File m-30-load-game-init-worker-task.patch m-30-load-game-init-worker-task.patch added
- File 26-load-game-init-worker-task.patch 26-load-game-init-worker-task.patch added
- Status changed from New to Resolved
- Assignee set to Jacob Nevins
mir3x, can you confirm whether the attached patch makes your crash go away?
(I'll apply it for 2.6.0 anyway, it's clearly a bug.)
#7
Updated by Anonymous about 4 years ago
Patch works (No crash)
#8
Updated by Jacob Nevins about 4 years ago
- Subject changed from Server crash to Server crash after loading savegame with worker tasks
- Status changed from Resolved to Closed