IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32277


Ignore:
Timestamp:
Sep 1, 2011, 9:56:44 AM (15 years ago)
Author:
bills
Message:

m Gene: in BLOCKSET_LOCK when nextBlock or previousBlock are inFlight, check for memory corruption.
This has been running in the production build for awhile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110622/psLib/src/sys/psMemory.c

    r32189 r32277  
    515515            continue;
    516516        }
    517         if (memBlock->nextBlock && memBlock->nextBlock->inFlight) {
    518             // nope, we need to try again
    519             MUTEX_UNLOCK(&memBlockListMutex);
    520             usleep (BLOCK_SLEEP);
    521             retryLock ++;
    522             continue;
    523         }
    524         if (memBlock->previousBlock && memBlock->previousBlock->inFlight) {
    525             // nope, we need to try again
    526             MUTEX_UNLOCK(&memBlockListMutex);
    527             usleep (BLOCK_SLEEP);
    528             retryLock ++;
    529             continue;
    530         }
     517        if (memBlock->nextBlock && memBlock->nextBlock->inFlight) {
     518            // we reply on the value of 'inFlight'.  we should crash if this block is corrupted
     519            if (memBlock->nextBlock->startblock != P_PS_MEMMAGIC) {
     520                PS_MEM_ABORT(__func__, "Unsafe to Continue\n");
     521            }
     522            if (memBlock->nextBlock->endblock != P_PS_MEMMAGIC) {
     523                PS_MEM_ABORT(__func__, "Unsafe to Continue\n");
     524            }
     525            // nope, we need to try again
     526            MUTEX_UNLOCK(&memBlockListMutex);
     527            usleep (BLOCK_SLEEP);
     528            retryLock ++;
     529            continue;
     530        }
     531        if (memBlock->previousBlock && memBlock->previousBlock->inFlight) {
     532            // we reply on the value of 'inFlight'.  we should crash if this block is corrupted
     533            if (memBlock->previousBlock->startblock != P_PS_MEMMAGIC) {
     534                PS_MEM_ABORT(__func__, "Unsafe to Continue\n");
     535            }
     536            if (memBlock->previousBlock->endblock != P_PS_MEMMAGIC) {
     537                PS_MEM_ABORT(__func__, "Unsafe to Continue\n");
     538            }
     539            // nope, we need to try again
     540            MUTEX_UNLOCK(&memBlockListMutex);
     541            usleep (BLOCK_SLEEP);
     542            retryLock ++;
     543            continue;
     544        }
    531545
    532546        // the markers are ours!
Note: See TracChangeset for help on using the changeset viewer.