rbray89 / ActiveTextureManagement

Compresses the Textures after loading in KSP
63 stars 10 forks source link

Memory Corruption on Linux x64 #20

Open StarkRG opened 9 years ago

StarkRG commented 9 years ago

I've been struggling to get a pack with all the mods I want (I like to play with a lot, so that's part of the issue, I've been trying to cut back, but it's hard). I just had an unrelated OS issue which required me to reinstall and start from scratch, which isn't such a terrible thing, really.

I started by putting a bunch of mods in that I figured were pretty safe, not a lot of parts, no plugins that were too extensive. I got KSP booted up just fine. I then threw in ATM and let it do its thing (better to work out the kinks little by little than try everything all at once). With the mods I'd installed at that point KSP booted fine. I then threw in a few of the larger mods, B9, Deadly Reentry, etc. And here's where I started having problems.

The first thing I noticed was that KSP would simply freeze during load. I checked the logs but there wasn't anything obviously wrong. I tried launching it from a command line and found it gave me a "double free or corruption (!prev)" error. I tried it without ATM and it loaded fine (I'm nowhere near done building my pack so I will, eventually, need ATM). I tried removing the most recent texture cache, this time I got a "malloc(): memory corruption" error, but it didn't re-create the texture cache I'd removed. I then thought that perhaps it was an issue with one of the other textures it created recently so I removed all of the recent ones and let it go through them again. This time it DID recreate them all and seemed to fail at the same place. The last addon ATM created textures for was Action Groups Extended, however removing that addon didn't stop the problem.

I'm going to keep trying to nail down which addon is conflicting with ATM, but besides removing them all and trying them one-by-one I rather at a loss of how to best to proceed. Any suggestions would be most welcome.

StarkRG commented 9 years ago

Here's the Player.log from my most recent launch attempt which resulted in a "double free or corruption" error.

I seem to be making some slow progress by disabling compression for really small images (icons, buttons, GUI elements, etc). However after disabling the compression, removing the cache, and having that work to a point (it gets past the hangup it had been having, but crashes elsewhere), on subsequent attempts the issue with the same file occasionally (ie. not every time) will crop up again and I'll have to remove the cache for that file again.

In case it helps I grabbed the basic config, made it scale by half, and made the following additions to the config file:

    .*/[Ii]cons/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    FerramAerospaceResearch/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    KSP-AVC/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    MagicSmokeIndustries/Textures/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    Contracts.Window/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    NavyFish/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    CustomBiomes/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    AmbientLightAdjustment/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    kOS/GFX/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
    ExtraplanetaryLaunchpads/Textures/.*
    {
        compress = false
        mipmaps = false
        scale = 1
        max_size = 0
        make_not_readable = false
    }
StarkRG commented 9 years ago

Ok, new datapoint. I created new config files for Ferram and KSP-AVC which I though should have caused ATM to skip them altogether.

ACTIVE_TEXTURE_MANAGER_CONFIG
{
    folder = FerramAerospaceResearch
    enabled  = false
}

After deleting the old caches for those KSP started up. Not wanting to look a gift horse in the mouth I shut it down and started it up again without changing anything, and it crashed again at Ferram. Looking at the texture cache it doesn't look like ATM skipped them as there's a new cache for Ferram and AVC. I'm going to try removing the caches again and starting it up to see if I can get it to start properly, if I can I'll get you the player.log for that.

StarkRG commented 9 years ago

Sure enough. When I removed the Ferram and AVC caches it booted up perfectly. Player.log

Is there a better way of disabling ATM caching on a directory-by-directory (or even file-by-file) basis?