Crash with "Z_Malloc: failed on allocation of such and such bytes"

Issue #248 resolved
Former user created an issue

At seemingly random times the game will crash when trying to load from the most recent save, for example after dying. It seems to work fine when I load the second most recent save, but then in 20 minutes or so the problem will repeat with a new most recent save.

Official response

  • Frank Sapone

    This is very possible it is a 64-bit specific issue. I need to know how you guys played the game as I cannot reproduce this.

    Do you:

    • Start a new game.
    • Play the e1m1a, create a save.
    • Go to e1m1b, create a save at some safe point (not right at the start).
    • etc.

    Are you back tracking from e1m1b to e1m1a, etc.? I'm curious the exact play style and how many enemies do you kill. Do you ever die and then reload from the autosave (the save that starts you at the beginning of the map)? To be fair, when we play tested it we rip through the maps pretty quickly so it's possible there's an alignment issue with 64-bit saving that we missed but I don't see anything obvious... yet <g>. I almost never restore from player created saves, only from the autosaves, but there's a few moments in the game I will use a normal save and I have never had a problem and I only use the 64-bit builds on Windows.

    With that said, I wonder if there's a lot of back tracking between changelevel triggers and things like that which could be corrupting memory on 64-bit in unique ways.

    If someone can find a reliable way to trigger this bug from a new game or just loading a map and saving at a specific point every time then we can narrow this down.

Comments (38)

  1. Luzio Corvi

    Reporter here, just wanted to add that when starting a new game after downloading the recommended pak file update through the menu, the issue has thus far (played to e1m3a) not come up again.

  2. Barnabás Balázs

    Hy, I'm facing the same exact issue currently and I haven't been able to solve it so far.

    I have the steam version, used the 64 bit 1.3 installer released on 12.23. I can see the pak6 file in the data directory, so I think I have the correct version.

    The game crashed after 15-20 minutes and all my previous save files were corrupted. If I tried to load them I get a very similar error you did, just with a different negative number at the end. Starting a new game works, but I'm afraid everything will corrupt again.

    How exactly did you solve this issue? I can't see any update prompt in the game's menu.

    Thanks in advance.

  3. Frank Sapone

    To both users: are you launching through steam? It may be possible steam is somehow corrupting the memory. I have seen this happen before in the past.

    If someone can send me a corrupted save it may help.

  4. Frank Sapone

    Also, we need some more info. What OS are you using (if Windows 10 which version i.e. 1803 Pro, 1809 Home, etc)? What video card? Video card driver version? 32-bit or 64-bit? What map are you playing when this occurred? Did you save a game or try to restore from the autosave? What skill level?

  5. Barnabás Balázs

    Thanks for the responses.

    Yes, I'm launching through steam. I'm using Windows 10 Pro 1809.

    I'm currently on a laptop, the game is forced to use my dedicated VGA through NVidia Control Panel which is a GTX1050ti. Driver version: 419.35

    The issue occurred on the second map I think, still in the swamps, after the bridge is blown up and you fall into a crocodile pit. The crash happened after the crocodile killed me. I guess at that point the game maybe tried to reload the last save before the first crash. I saved myself, it was not an autosave. I used the middle difficulty (samurai?).

    I installed the 64-bit version of the 1.3 patch. Yesterday I got a tip on the steam forums that maybe I should use the 32-bit one instead, so I uninstalled the game and reinstalled the 32-bit version after. Sadly with the uninstall my corrupted saves seem to have been removed, so I can't send you those. :/ I played ~40 minutes with the 32-bit version (got much farther than the first time) and so far no issues. I don't want to jinx it, but hopefully, this solved it, I'll report back if it happens again though.

  6. Frank Sapone

    The save files for 32-bit and 64-bit are located in different folders. %userprofile%\Documents\My Games\Daikatana\data\save_x64 is the location. Let me know if the files are still there.

    When you made the save, where were you?

  7. Barnabás Balázs

    Attached my old x64 save files. Some of them might be from after I tried to restart, but savea1 definitely crashed on my end. It was made just before the bridge.

  8. Doug Underwood

    I'm having the same issue. Here is the error portion of the log: ------- Server Initialization ------- Map title: Sewer System [part 2] info_player_start WARNING: P_GetFuncForString() No function for "äùÐl"! WARNING: P_GetFuncForString() No function for "Load"! WARNING: P_GetFuncForString() No function for "Player"! Shutting down OpenAL. Freeing Audio Engine DLL...

    Z_Malloc: failed on allocation of -993700600 bytes

    I am using the GOG version of the game, 64-bit version of the patch with pak6 installed. I am simply launching the game through daikatana.exe. I should mention that this has happened several times so far, not just on this level.

  9. Barnabás Balázs

    @MindBoglin You should try installing the 32-bit version instead. I played ~3 hours with that version, no crashed so far!

  10. Frank Sapone

    This is very possible it is a 64-bit specific issue. I need to know how you guys played the game as I cannot reproduce this.

    Do you:

    • Start a new game.
    • Play the e1m1a, create a save.
    • Go to e1m1b, create a save at some safe point (not right at the start).
    • etc.

    Are you back tracking from e1m1b to e1m1a, etc.? I'm curious the exact play style and how many enemies do you kill. Do you ever die and then reload from the autosave (the save that starts you at the beginning of the map)? To be fair, when we play tested it we rip through the maps pretty quickly so it's possible there's an alignment issue with 64-bit saving that we missed but I don't see anything obvious... yet <g>. I almost never restore from player created saves, only from the autosaves, but there's a few moments in the game I will use a normal save and I have never had a problem and I only use the 64-bit builds on Windows.

    With that said, I wonder if there's a lot of back tracking between changelevel triggers and things like that which could be corrupting memory on 64-bit in unique ways.

    If someone can find a reliable way to trigger this bug from a new game or just loading a map and saving at a specific point every time then we can narrow this down.

  11. Barnabás Balázs

    Yes, I think I did all of these.

    Backtracked multiple times accidentally between e1m1a and e1m1b. I killed every enemy I encountered, but also died quite a lot at the beginning. The autosave was probably reloaded as well at some point, but I also reloaded my own saves.

  12. Barnabás Balázs

    No, I didn't restart the game before the first crash, however, I did start a new game once after I made a save at the wrong spot and died multiple times.

  13. Barnabás Balázs

    Well, to be honest, the 32-bit version is working fine now, I don't want to uninstall the working version and reinstall the one that might crash again. :(

  14. Frank Sapone

    We need someone to find a reliable way to trigger this bug or a save that happened right before it got botched and then one that was able to generated right after. As it stands, I cannot reproduce this bug.

  15. Doug Underwood

    I wish I could remember exactly what I did when the crash happened, but there really wasn't anything out of the ordinary. The last time it happened, I didn't backtrack to a previous area or anything. I knew a room full of enemies was around the corner, so I saved. The enemies killed me, so I tried to load the save, but the crash happened. In all instances, the autosaves created by the game work fine, it's only manual saves that seemed to break now and again.

    That said, I didn't realize before that the game supports quicksaving/quickloading, since it isn't listed among the keybindings. I've been using quicksaves and quickloads for moment-to-moment saving since I made that post in here, and haven't experienced any crashes.

  16. Kool Kid

    I support that issue, also having the same problem of save corruption on virtually every levels if saving by hand, but none if it’s an autosave from save transmission.

  17. Frank Sapone

    Can you reliably reproduce it? It seems to be unique to 64-bit with a small subset of users, but I have never been able to reproduce it across multiple machines and neither have any of the testers.

  18. Frank Sapone

    If you have a manual save that works but if you cross into an autosave that makes it crash and does this every time that would probably help.

  19. Christoffer Bovbjerg

    I have not been able to reproduce the issue. But it has happened a few times now. I have been playing through the campaign and currently reached episode 3.

  20. Kool Kid

    Only happens in the 64bit version. It can be reliably reproduced by saving within a level EXCLUDING ANY AUTOSAVES. Autosaves do not crash the game but any manual or crystal saves will crash the game.

  21. Frank Sapone

    I do manual saves all the time in the 64-bit version from the main menu. I have never had this problem.

    Are you using the console to do the saving or are you using the main menu? Are you running the game with antivirus, discord, steam, twitch, etc. overlays? There has to be a common link here… And I’ve never been able to find one.

    If it is very problematic for any one here then use the 32-bit version. Performance will basically be the same, it’s 2020 and even a pathetic intel integrated from 5 years ago can play this game just fine.

  22. Christoffer Bovbjerg

    I am running the game from steam.

    I have discord running in the background. I am not certain it was running every time it happened, but it is likely it did.

    No antivirus, using Windows defender.

    Requesting a very negative amount of memory could suggest some type issue passing wrong integer sizes.

  23. Frank Sapone

    It’s very possible, i just find it strange I haven’t been able to reproduce it on any system I’ve tested. My thoughts were that overlays were doing things corrupting memory.

    I recently ran the entire codebase through PVS Studio awhile ago and it did find some issues. I could send you a test build if you want to see if it fixes the problem. I haven’t released it yet because some regression testing is needed.

  24. Christoffer Bovbjerg

    Sure, but since i am not able to reliably reproduce the issue it would be hard to determine if it is fixed. Other than of cause loading my corrupted save game.

  25. Kool Kid

    I’m using GOG to launch the game on WIndows 10. For me the issue always happens on manual saves, but not autosaves, as mentionned.

    I can test it out if you’re willing to send me a build.

  26. Frank Sapone

    Hi fellow DK users. Sorry for the delay, but the new build with the PVS analyzed codebase (as well as other fixes) is now available. I am unsure if this will fix the issue. Let me know if it persists.

  27. Frank Sapone

    Part of the issue with corrupted saves was related to the player netname not being saved properly in 64-bit builds. It’s fixed in the 05-25-2020 build. Let me know if the issue persists.

  28. Log in to comment