Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Saving broken #3620

Closed
wzdev-ci opened this issue Jul 11, 2012 · 13 comments
Closed

Saving broken #3620

wzdev-ci opened this issue Jul 11, 2012 · 13 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by cybersphinx


Saving either skirmish or campaign games is broken, crashes in game.cpp:3897 (master), saveGame.sNetPlay = NetPlay. Reverting 134c51c8902bf80c699d29a8db1c71fea9a4e85d helps.


Issue migrated from trac:3620 at 2022-04-16 09:58:13 -0700

@wzdev-ci
Copy link
Contributor Author

cybersphinx uploaded file warzone2100.gdmp-ibMhTT (42.3 KiB)

@wzdev-ci
Copy link
Contributor Author

vexed commented


Odd, it is working for me in bugfixes.

@wzdev-ci
Copy link
Contributor Author

eisnerd commented


I could confirm that yesterdays 3.1 branch crashes when trying to save after writing 8 bytes to .gam file

@wzdev-ci
Copy link
Contributor Author

dak180 changed _comment0 which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

tnmurphy@... commented


This seems to relate to the use of std::string mapFileName in the NETPLAY struct. I get a crash in the copy constructor unless I define a non-inline copy constructor but then I get a crash in the destructor for the old string - didn't try making that non-inline too.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff44ed6c3 in ?? () from /usr/lib64/libstdc++.so.6
(gdb) bt
#0  0x00007ffff44ed6c3 in ?? () from /usr/lib64/libstdc++.so.6
#1  0x00007ffff44eeaf6 in std::string::assign(std::string const&) () from /usr/lib64/libstdc++.so.6
#2  0x000000000059065e in NETPLAY::operator= (this=0x7fffffff56b0) at ../lib/netplay/netplay.h:265
#3  0x0000000000573091 in writeGameFile (fileName=0x7fffffffb820 "savegames/skirmish/crsh.gam", saveType=4) at game.cpp:3901

What fixes it for me is to use a C string. I will attach this in a patch file

@wzdev-ci
Copy link
Contributor Author

tnmurphy@... uploaded file use_cstring_for_mapfilename.patch (1.7 KiB)

patch to fix skirmish game save in head.

@wzdev-ci
Copy link
Contributor Author

Per commented


Related bug #3636

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

Per Inge Mathisen commented


Do not use std::string in a memory structure that is memset().
Patch by tnmurphy, closes #3620

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 1, 2012

Per Inge Mathisen commented


Do not use std::string in a memory structure that is memset().
Patch by tnmurphy, closes #3620

2 similar comments
@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 2, 2012

Per Inge Mathisen commented


Do not use std::string in a memory structure that is memset().
Patch by tnmurphy, closes #3620

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 4, 2012

Per Inge Mathisen commented


Do not use std::string in a memory structure that is memset().
Patch by tnmurphy, closes #3620

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant