Author Topic: [invalid] r4476: SegF when disk full while writing savegame  (Read 849 times)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
When the filesystem where MG tries to create a savegame has run full, MG will run into a segmentation fault. It would be nicer to handle this situation gracefully (display a message box).

Ideally the same should happen for other file output operations (logfiles) where it doesn't impact performance (I assume it does not since it should be sufficient to handle the error when it occurs, i.e. there should be no need to check whether the next packet will writable before it is actually written).



Update:

To ease testing, this should also be reproducible when pointing --data-dir or UserData_Root to a location which is readable but not writable, such as a small filesystem created on a partitioned (e.g. using GNU parted + partprobe) USB key using, e.g.:
Code: [Select]
sudo mkfs.ext4 -L MegaGlest /dev/DEVICENAME
sudo mount -o users /dev/DEVICENAME /mnt/
# now copy files to /mnt/ as needed, then make it read-only ro prepare for testing
mount --remount,ro /mnt/

Or, possibly even easier, use a loop device, see the example in losetup(8) (no need for encryption, though).
« Last Edit: 22 June 2013, 09:51:09 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: r4476: SegF when disk full while writing savegame
« Reply #1 on: 23 June 2013, 05:43:41 »
I think we're asking too much here. The expectation is that there is somewhere to write for megaglest. There are many scenarios like once we have written to a file and the disk fills after we are able to create the file, etc.. etc..

To check for all possible cases of failure is simply too much. However, if there is a value we could add a setting to force NO WRITES to any file (But you lose some features like changing anything or saving anything).

Thanks