View Issue Details

IDProjectCategoryView StatusLast Update
0006470The Dark ModSaving/Loadingpublic01.03.2026 13:50
Reporterdatiswous Assigned Tostgatilov  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSManjaro XFCEOS Versionrolling
Summary0006470: Issues with the savegame tool object which may crash TDM
DescriptionThe savegame tool object does not work as expected, at least on Linux.

On Manjaro XFCE rolling release:
When I activate an atdm:playertools_savegame inventory item, TDM crashes.
There have been 2 in-mission similar situations.
* A night in Altham used to have an autosave function, until somewhere in Beta. On Linux systems this crashed the system.
* Hazard Pay on Expert mode has Save-rooms, where you can save the game by activating an inventory-item to an entity. If you do this on a Linux sytem, the game crashes.
Tested on TDM 2.12 beta 04

Info added by Fiver:
On Debian 11 Bullseye:
In Training Mission, an entry "Save_0" is created in the list of saved games as expected.
When quickloading (a previously saved quickload), or trying to load the entry "Save_0" from the list of saved games, the load screen appears with the progress bar reading "Mission Loading", but the bar is at 0% and does not move. TDM does not seem to respond and the process can be killed to exit the game.
After this, no other saved games on that level could be loaded either, even after deleting "Save_0" or switching to another mission and back.
However, once the issue disappeared it could not be reproduced again. See Additional information and workaround.
Tested on TDM 2.12/64 #10651 (beta212-07) = Release 2.12

On a Windows (10) system:
A save is made as expected.
Steps To Reproduce1. Go to console.
2. Type: spawn atdm:playertools_savegame
3. The item is invisible (for some reason), so you have to walk around clicking/frobbing everywhere to pick it up (not difficult). (Crouch, look down, walk forward slowly and frob when the white dot appears at the center of the screen.)
4. Pick it up and activate it (use it).
5a. TDM crashes. (Manjaro, TDM 2.12 beta 04), or
5b. Game is saved but restoring any saved game did not work (until "Save_0" entry was deleted and then the issue could no longer be reproduced). (Debian, TDM 2.12 release)

Additional InformationInfo added by Fiver:
For a possible workaround for Debian 11 Bullseye TDM 2.12 release, try:
* After deleting "Save_0" object from the list of save objects, start the mission from start, do a quicksave, restore the quicksave, repeat the steps to create the "Save_0" object. Now both "Save_0" and all other saves work again and the issue cannot be reproduced.
TagsCrash, save

Relationships

related to 0004967 closed Quicksave causes disruptions to HUD 
related to 0003830 resolvedObsttorte Add the possibility for mappers to alter the savegame-mechanics. 
related to 0006561 new A saved game created by a savegame tool object does not show a thumbnail when selected 

Activities

datiswous

datiswous

03.07.2024 09:48

reporter   ~0016786

Last edited: 20.07.2024 12:33

Could an on-Linux dev take a look at this? Would be nice.
Fiver

Fiver

16.07.2024 21:12

reporter   ~0016797

@datiswous: I found some issues with the save object, but it did not crash for me on 2.12 and I updated the issue with my findings. Can you reproduce the crash on the 2.12 release too?
datiswous

datiswous

15.01.2025 17:23

reporter   ~0016953

I just tried spawn atdm:playertools_savegame in 2.13, but couldn't find the thing. Maybe this doesn't work anymore. It's probably fixed anyway because I think it's related to a fix mentioned in this report:

https://bugs.thedarkmod.com/view.php?id=4967#c16947

Mission Hazard Pay does not crash anymore in 2.13 on Linux
stgatilov

stgatilov

01.03.2026 13:31

administrator   ~0017218

Autosave mod uses the same "savegame" script event, and it regularly generated corrupted savefile:
  https://forums.thedarkmod.com/index.php?/topic/23119-loading-saves-just-hangs-after-closereopen-the-game/
stgatilov

stgatilov

01.03.2026 13:36

administrator   ~0017219

I believe the problem is caused by the fact that script event saves the game on frontend thread.
It does try to delay the saving already, but it still does not do it at the right place.

To fix this, I have simply rerouted the script event via "savegame" console command.
It is much easier to delay-run console commands.

r11197 Deleted "tdm_nosave" cvar from the code.
r11198 Refactored console commands "savegame"/"loadgame", added "unrestricted" argument to savegame.
r11199 Use "savegame" console command in delayed manner in "savegame" sctipt event, don't save the game immediately.
r11200 Deleted "saveGameName" cvar state and "triggeredSave" game method.
stgatilov

stgatilov

01.03.2026 13:48

administrator   ~0017220

Strictly speaking, the text buffer for scheduled commands it global.
So if we access it simultaneously from two threads, it can break.

This commit should avoid this problem:
  r11201 Protected the global buffer for scheduled console commands with a mutex.

Issue History

Date Modified Username Field Change
27.01.2024 03:05 datiswous New Issue
27.01.2024 03:05 datiswous Tag Attached: Crash
27.01.2024 03:05 datiswous Tag Attached: save
03.07.2024 09:48 datiswous Note Added: 0016786
16.07.2024 21:07 Fiver Summary Activating an atdm:playertools_savegame crashes TDM on Linux => Issues with the savegame tool object which may crash TDM
16.07.2024 21:07 Fiver Description Updated
16.07.2024 21:07 Fiver Steps to Reproduce Updated
16.07.2024 21:07 Fiver Additional Information Updated
16.07.2024 21:12 Fiver Note Added: 0016797
16.07.2024 21:39 Fiver Relationship added related to 0006558
20.07.2024 12:33 datiswous Note Edited: 0016786
24.07.2024 21:54 Fiver Steps to Reproduce Updated
15.01.2025 17:23 datiswous Note Added: 0016953
15.01.2025 17:24 datiswous Relationship deleted related to 0006558
15.01.2025 17:27 datiswous Description Updated
15.01.2025 17:27 datiswous Additional Information Updated
16.01.2025 21:20 Fiver Relationship added related to 0004967
01.03.2026 11:36 stgatilov Relationship added related to 0003830
01.03.2026 13:30 stgatilov Assigned To => stgatilov
01.03.2026 13:30 stgatilov Status new => assigned
01.03.2026 13:31 stgatilov Note Added: 0017218
01.03.2026 13:36 stgatilov Note Added: 0017219
01.03.2026 13:48 stgatilov Note Added: 0017220
01.03.2026 13:50 stgatilov Relationship added related to 0006561
01.03.2026 13:50 stgatilov Status assigned => resolved
01.03.2026 13:50 stgatilov Resolution open => fixed