IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2008, 2:59:24 PM (18 years ago)
Author:
Paul Price
Message:

Got '* glibc detected * ppStack: double free or corruption (): 0x00007f743f3f9190 *' mentioning pmConceptsAverageCells. Suspect that there's some memory corruption going on by calling pmConceptsAverageCells multiple times within threads. Moved it out of the stacking into ppStackLoop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackReadout.c

    r19346 r19475  
    196196    psArray *stack = psArrayAlloc(num); // Array for stacking
    197197
    198     pmCell *outCell = outRO->parent;    // Output cell
    199     pmChip *outChip = outCell->parent;  // Output chip
    200     pmFPA *outFPA = outChip->parent;    // Output FPA
    201 
    202     float totExposure = 0.0;            // Total exposure time
    203     psList *fpaList = psListAlloc(NULL); // List of input FPAs, for concept averaging
    204     psList *cellList = psListAlloc(NULL); // List of input cells, for concept averaging
    205198    int numGood = num;                  // Number of good inputs: images that haven't been completely rejected
    206199    for (int i = 0; i < num; i++) {
     
    222215        }
    223216
    224         float exposure = psMetadataLookupF32(NULL, ro->parent->concepts, "CELL.EXPOSURE"); // Exposure time
    225         if (!isfinite(exposure)) {
    226             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    227                     "CELL.EXPOSURE is not set for input file %ld", stack->n);
    228             psFree(fpaList);
    229             psFree(cellList);
    230             psFree(stack);
    231             return false;
    232         }
    233         totExposure += exposure;        // Total exposure time
    234 
    235217        // Ensure there is a mask, or pmStackCombine will complain
    236218        if (!ro->mask) {
     
    239221        }
    240222
    241         psListAdd(fpaList, PS_LIST_TAIL, fpa);
    242         psListAdd(cellList, PS_LIST_TAIL, ro->parent);
    243 
    244223        pmStackData *data = pmStackDataAlloc(ro, weighting);
    245224        data->reject = psMemIncrRefCounter(rejected->data[i]);
     
    250229                        numGood != num, useVariance, false)) {
    251230        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    252         psFree(fpaList);
    253         psFree(cellList);
    254231        psFree(stack);
    255232        return false;
     
    267244#endif
    268245
    269     psMetadataAddF32(outCell->concepts, PS_LIST_TAIL, "CELL.EXPOSURE", PS_META_REPLACE,
    270                      "Summed exposure time (sec)", totExposure);
    271     psMetadataAddF32(outCell->parent->parent->concepts, PS_LIST_TAIL, "FPA.EXPOSURE", PS_META_REPLACE,
    272                      "Summed exposure time (sec)", totExposure);
     246    pmCell *outCell = outRO->parent;    // Output cell
     247    pmChip *outChip = outCell->parent;  // Output chip
    273248
    274249    outRO->data_exists = true;
    275250    outCell->data_exists = true;
    276     outCell->parent->data_exists = true;
    277 
    278     // Copy other concepts
    279     pmConceptsAverageFPAs(outFPA, fpaList);
    280     pmConceptsAverageCells(outCell, cellList, NULL, NULL, true);
    281     psFree(fpaList);
    282     psFree(cellList);
     251    outChip->data_exists = true;
    283252
    284253    psFree(stack);
Note: See TracChangeset for help on using the changeset viewer.