2024-04-19 20:00 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006105Spring engineGeneralpublic2018-12-22 21:08
Reportergajop 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityrandom
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0006105: Double lock in Bitmap.cpp -> watchdog freeze
DescriptionI have a deadlock in:
    uint8_t* Alloc(size_t size) {
        std::lock_guard<spring::mutex> lck(bmpMutex);
        return (AllocRaw(size));
    }

This happens once the bitmap fails to load, as we are trying to reaquire the lock we already acquired in 484


CBitmap:Load:484
        std::lock_guard<spring::mutex> lck(texMemPool.GetMutex());

        ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
        ilEnable(IL_ORIGIN_SET);

        ILuint imageID = 0;
        ilGenImages(1, &imageID);
        ilBindImage(imageID);

        {
            // do not signal floating point exceptions in devil library
            ScopedDisableFpuExceptions fe;

            const bool success = !!ilLoadL(IL_TYPE_UNKNOWN, buffer.data(), buffer.size());

            // FPU control word has to be restored as well
            streflop::streflop_init<streflop::Simple>();

            ilDisable(IL_ORIGIN_SET);

            if (!success) {
/* Stuck here*/ AllocDummy();
                return false;
            }
        }

PS: The callstack is attached, thread 1 (main) seems relevant.
Steps To ReproduceDifficult to reproduce (at least before reading the code).

Happened when I was adding some bitmap to SB assets, and probably also a few days ago when I was reloading images that weren't written to disk (assuming ilLoadL failed then, and it went through the same code path - didn't debug)
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0019624

Kloot (developer)

Fix 9bad771358008be73e8f6810ae0e4424504ae1ae committed to develop branch: fix 0006105
downgrade detailtex/infomap loading exceptions, repo: spring changeset id: 11260

~0019625

Kloot (developer)

Fix 262946915da5cb5945e6f9e507a13ed45890f66a committed to maintenance branch: fix 0006105
downgrade detailtex/infomap loading exceptions

Conflicts:
    rts/Rendering/Textures/Bitmap.cpp, repo: spring changeset id: 11261
+Notes

-Issue History
Date Modified Username Field Change
2018-12-22 06:44 gajop New Issue
2018-12-22 06:44 gajop File Added: callstack.txt
2018-12-22 13:38 Kloot Assigned To => Kloot
2018-12-22 13:38 Kloot Status new => assigned
2018-12-22 21:04 Kloot Changeset attached => spring develop 9bad7713
2018-12-22 21:04 Kloot Note Added: 0019624
2018-12-22 21:04 Kloot Status assigned => resolved
2018-12-22 21:04 Kloot Resolution open => fixed
2018-12-22 21:08 Kloot Changeset attached => spring maintenance 26294691
2018-12-22 21:08 Kloot Note Added: 0019625
+Issue History