[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Update of bug #18546 (project freeciv): Status: Ready For Test = Fixed Assigned to:None = syntron Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Follow-up Comment #6, bug #18546 (project freeciv): Oh, we certainly are not going to support loading savegames that are missing required (= non-optional) parts. What we should do, is to abort savegame loading with error message to user (Savegame is corrupted - cannot load it) The attached patch stops loading a savegame if the element savefile.options is missing as this will result in a NULL pointer in my_has_capability(). Both patches should be applied! (file #14156) ___ Additional Item Attachment: File name: 0027-check-for-savefile.options-if-loading-a-savegame.patch Size:0 KB ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Follow-up Comment #3, bug #18546 (project freeciv): I did try to continue, but without the information from savefile.options there are to much possibilities and one will kill the server. You can try it yourself - take a savegame, delete the line and open it ... ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Follow-up Comment #4, bug #18546 (project freeciv): I did try to continue, but without the information from savefile.options Oh, we certainly are not going to support loading savegames that are missing required (= non-optional) parts. What we should do, is to abort savegame loading with error message to user (Savegame is corrupted - cannot load it) ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Follow-up Comment #5, bug #18546 (project freeciv): ... but you need to add at least a check my_has_capability(), else you get only this bug. This is my first try of the patch: if (capstr == NULL) { return FALSE; } ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
URL: http://gna.org/bugs/?18546 Summary: segfault when loading an incomplete map Project: Freeciv Submitted by: akfaew Submitted on: Mon Aug 22 15:22:16 2011 Category: None Severity: 3 - Normal Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Release: S2.3 Discussion Lock: Any Operating System: None Planned Release: ___ Details: I know this is rather unimportant, but I also believe this should be reported. The save is basically this, plus the map itself: 1 [scenario] 2 name=_(Earth (classic/giant)) 3 description=_(Map of the Earth.) 4 5 [map] 6 topology_id=1 7 height=180 8 width=468 #0 0x002ad6e8 in my_has_capability (cap=0x40e379 version2, capstr=0x0, cap_len=8) at capability.c:48 48 GET_TOKEN(capstr, next); (gdb) bt #0 0x002ad6e8 in my_has_capability (cap=0x40e379 version2, capstr=0x0, cap_len=8) at capability.c:48 #1 0x002ad898 in has_capabilities (us=0x40e378 +version2, them=0x0) at capability.c:81 #2 0x001a481c in savegame2_load (file=0x2086f8080) at savegame2.c:527 #3 0x00117594 in load_command (caller=Variable caller is not available. ) at stdinhand.c:3584 #4 0x0010bfb0 in srv_prepare () at srv_main.c:2265 #5 0x0010dc2c in srv_main () at srv_main.c:2536 #6 0x00103e78 in main (argc=16, argv=0xfffbf008) at civserver.c:375 ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Update of bug #18546 (project freeciv): Category:None = general Status:None = Ready For Test Planned Release: = 2.3.1,2.4.0 ___ Follow-up Comment #1: Your map is missing one important part - the entry savefile.options. Thus, a NULL string is used in my_has_capability(), resulting in the crash. The patch adds an assert to catch this. But without the entry the scenario will not load due to more errors ... A real savegame would have helped! (file #13957) ___ Additional Item Attachment: File name: 0005-check-for-capability-string-NULL.patch Size:0 KB ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18546] segfault when loading an incomplete map
Follow-up Comment #2, bug #18546 (project freeciv): The patch adds an assert to catch this Assert doesn't prevent it from crashing. Can savegame loading still easily error out in this situation? I know that it would be hard later when some data structures are already loaded and are not easily reverted, but that should not be the case when only checking capabilities. ___ Reply to this item at: http://gna.org/bugs/?18546 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev