]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bug fix: reconstruction crash when the output buffer size exceed
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 8 Nov 2009 01:46:59 +0000 (01:46 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 8 Nov 2009 01:46:59 +0000 (01:46 +0000)
HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATracker.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.cxx

index f649f16d4bd9b3542c0d8e8ab507f388868e28fb..05d461992aa5175aa76e085f097e0f2895726738 100644 (file)
@@ -79,6 +79,7 @@ void AliHLTTPCCASliceOutput::Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nT
   {
          if (outputControl->fOutputMaxSize < memsize)
          {
+                  outputControl->fEndOfSpace = 1;
                  ptrOutput = NULL;
                  return;
          }
index a32fde62f385ef376e59118524073791fd9a1d72..3f740d822df1950f6dcf4a8d212801fbe1f6071b 100644 (file)
@@ -33,11 +33,12 @@ class AliHLTTPCCASliceOutput
 
        struct outputControlStruct
        {
-               outputControlStruct() : fObsoleteOutput( 1 ), fDefaultOutput( 1 ), fOutputPtr( NULL ), fOutputMaxSize ( 0 ) {}
+               outputControlStruct() : fObsoleteOutput( 1 ), fDefaultOutput( 1 ), fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {}
                int fObsoleteOutput;    //Enable Obsolete Output
                int fDefaultOutput;             //Enable Default Output
                char* fOutputPtr;               //Pointer to Output Space, NULL to allocate output space
-               int fOutputMaxSize;             //Max Size of Output Data if Pointer to output space is given
+               int fOutputMaxSize;             //Max Size of Output Data if Pointer to output space is given
+               bool fEndOfSpace; // end of space flag 
        };
 
     GPUhd() int NTracks()                    const { return fNTracks;              }
index fc24d4a16bb5de65e561df1563b67b831ab1deea..33cbf568c0b0bda83933b8de8fbf2580358d6072 100644 (file)
@@ -422,7 +422,7 @@ GPUh() int AliHLTTPCCATracker::CheckEmptySlice() const
     {
       AliHLTTPCCASliceOutput::Allocate(*fOutput, 0, 0, fOutputControl);
       AliHLTTPCCASliceOutput* useOutput = *fOutput;
-      if (fOutput == NULL) return(1);
+      if (useOutput == NULL) return(1);
       useOutput->SetNTracks( 0 );
       useOutput->SetNTrackClusters( 0 );
       useOutput->SetNOutTracks(0);
index d21dc8044d8b770f3016d5de1b93760d7f57c363..d6c91a3c1495f2b83a0b296c6417b261c3a2c452 100644 (file)
@@ -440,7 +440,7 @@ int AliHLTTPCCATrackerComponent::DoEvent
       if ( !found ) {
         slices.push_back( slice );
         sliceCnts.push_back( 1 );
-      } else *slCntIter++;
+      } else (*slCntIter)++;
     }
 
          if ( slices.size() == 0 ) {
@@ -505,7 +505,7 @@ int AliHLTTPCCATrackerComponent::DoEvent
   int slicecount = maxslice + 1 - minslice;
   if (slicecount > fTracker->MaxSliceCount())
   {
-       maxslice = minslice + (slicecount = fTracker->MaxSliceCount());
+       maxslice = minslice + (slicecount = fTracker->MaxSliceCount()) - 1;
   }
   int nClustersTotalSum = 0;
   AliHLTTPCCAClusterData* clusterData = new AliHLTTPCCAClusterData[slicecount];
@@ -687,6 +687,7 @@ int AliHLTTPCCATrackerComponent::DoEvent
   //Prepare Output
   AliHLTTPCCASliceOutput::outputControlStruct outputControl;
   //Set tracker output so tracker does not have to output both formats!
+  outputControl.fEndOfSpace = 0;
   outputControl.fObsoleteOutput = fOutputTRAKSEGS;
   outputControl.fDefaultOutput = !fOutputTRAKSEGS;
 
@@ -710,6 +711,12 @@ int AliHLTTPCCATrackerComponent::DoEvent
 
   for (int islice = 0;islice < slicecount;islice++)
   {
+    if( outputControl.fEndOfSpace ){
+      HLTWarning( "Output buffer size exceed, tracks are not stored" );
+      ret = -ENOSPC;
+      error = 1;
+      break;     
+    }
          slice = minslice + islice;
 
          if (sliceOutput[islice])