FS#13089 - RockDoom savegame memory leak?

Attached to Project: Rockbox
Opened by Jason Arthur Taylor ( - Thursday, 17 November 2016, 14:27 GMT
Last edited by MichaelGiacomelli (saratoga) - Wednesday, 30 November 2016, 01:30 GMT
Task Type Bugs
Category Games
Status Closed
Assigned To No-one
Operating System Sansa Clip Zip
Severity Very Low
Priority Normal
Reported Version Release 3.13
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


RockDoom gives zmalloc error then does data abort if you save a game in doom. To reproduce, install per the instructions. Play default plug in a little. Save game. Crash may occur then.

The more times a game is saved the greater the chance of a crash upon saving a game.
Sometimes the save game feature works but my guess is that there is a memory leak in the routine.
This task depends upon

Closed by  MichaelGiacomelli (saratoga)
Wednesday, 30 November 2016, 01:30 GMT
Reason for closing:  Not a Bug
Additional comments about closing:  This is a known limitation of running doom on the hardware. Workarounds to reduce memory usage or avoid fragmentation are welcome.
Comment by MichaelGiacomelli (saratoga) - Friday, 18 November 2016, 03:57 GMT
Your player doesn't have an MMU, so memory returned by free() is often lost due to fragmentation. This is a memory leak, but one caused by a hardware limitation of trying to use malloc on a device without an MMU.
Comment by Jason Arthur Taylor ( - Sunday, 27 November 2016, 18:04 GMT
Hi. Michael. If you go to plugins, games, doom.rock, the top option is "Game". If you select that, there are two or three other confusing options: Freedoom (the default which if selected gives a memory leak), "Doom Shareware," and "doom 2." Doom shareware is only a few levels inside a single wad file. The game begins with you looking at a dead monster on a pool of water. There is a menu to two other games inside, but since this is the shareware version, they don't work. This version doesn't work with addons, so it is limited in that you can't download new wads, unless you rename files. I don't know which files to rename yet. If you know please tell me.

Anyway, to get to my point, as you may not be aware of this, there are zero problems with the "Doom Shareware" game. You can save and load it all day long without any problems. This is with the same exact same hardware.

Therefore, with all respect that might be due to your comment, you are definitely wrong that this leak is caused by a hardware issue that cannot be fixed.
Comment by MichaelGiacomelli (saratoga) - Wednesday, 30 November 2016, 01:29 GMT
It can be fixed, just rewrite the function to not expect an MMU. Anyway, this is a long known issue with doom, so it's not necessary to report.