Program: 162846
Project: 162846
Buggy source:
/** 
 * @param entryCallback call this to get an entry, this class will take care of the locking
 * @return true if an entry was processed
 */
@Override public boolean nextEntry(@NotNull EntryCallback entryCallback,int chronicleId){
  while (true) {
    long position=nextPosition();
    if (position == NOT_FOUND) {
      this.position=NOT_FOUND;
      return false;
    }
    this.position=position;
    int tierIndexMinusOne=(int)(position >>> segmentIndexShift);
    try (CompiledReplicatedMapIterationContext<K,KI,MKI,V,VI,MVI,R> context=iterationContext()){
      if (iterationMainSegmentsAreaOrTierBulk < 0) {
        context.initSegmentIndex(tierIndexMinusOne);
      }
 else {
        long tierBaseAddr=tierIndexToBaseAddr(tierIndexMinusOne + 1);
        long tierCountersAreaAddr=tierBaseAddr + segmentHashLookupOuterSize;
        context.initSegmentIndex(TierCountersArea.segmentIndex(tierCountersAreaAddr));
        int tier=TierCountersArea.tier(tierCountersAreaAddr);
        long tierIndex=actualSegments + (iterationMainSegmentsAreaOrTierBulk << log2NumberOfTiersInBulk) + tierIndexMinusOne+ 1;
        context.initSegmentTier(tier,tierIndex,tierBaseAddr);
      }
      context.updateLock().lock();
      if (changesForUpdatesGet(position)) {
        entryCallback.onBeforeEntry();
        final long segmentPos=position & posMask;
        context.readExistingEntry(segmentPos);
        if (entryCallback.shouldBeIgnored(context,chronicleId)) {
          changesForUpdatesClear(position);
          continue;
        }
        context.segmentBytes().limit(context.valueOffset() + context.valueSize());
        context.segmentBytes().position(context.keySizeOffset());
        boolean success=entryCallback.onEntry(context.segmentBytes(),chronicleId,bootStrapTimeStamp());
        entryCallback.onAfterEntry();
        if (success)         changesForUpdatesClear(position);
        return success;
      }
    }
   }
}

Fixed version (ground truth):
/** 
 * @param entryCallback call this to get an entry, this class will take care of the locking
 * @return true if an entry was processed
 */
@Override public boolean nextEntry(@NotNull EntryCallback entryCallback,int chronicleId){
  while (true) {
    long position=nextPosition();
    if (position == NOT_FOUND) {
      this.position=NOT_FOUND;
      return false;
    }
    this.position=position;
    int segmentIndexOrTierIndexOffsetWithinBulk=(int)(position >>> segmentIndexShift);
    try (CompiledReplicatedMapIterationContext<K,KI,MKI,V,VI,MVI,R> context=iterationContext()){
      if (iterationMainSegmentsAreaOrTierBulk < 0) {
        context.initSegmentIndex(segmentIndexOrTierIndexOffsetWithinBulk);
      }
 else {
        TierBulkData tierBulkData=tierBulkOffsets.get(iterationMainSegmentsAreaOrTierBulk);
        long tierBaseAddr=tierAddr(tierBulkData,segmentIndexOrTierIndexOffsetWithinBulk);
        long tierCountersAreaAddr=tierBaseAddr + segmentHashLookupOuterSize;
        context.initSegmentIndex(TierCountersArea.segmentIndex(tierCountersAreaAddr));
        int tier=TierCountersArea.tier(tierCountersAreaAddr);
        long tierIndex=actualSegments + (iterationMainSegmentsAreaOrTierBulk << log2NumberOfTiersInBulk) + segmentIndexOrTierIndexOffsetWithinBulk+ 1;
        context.initSegmentTier(tier,tierIndex,tierBaseAddr);
      }
      context.updateLock().lock();
      if (changesForUpdatesGet(position)) {
        entryCallback.onBeforeEntry();
        final long segmentPos=position & posMask;
        context.readExistingEntry(segmentPos);
        if (entryCallback.shouldBeIgnored(context,chronicleId)) {
          changesForUpdatesClear(position);
          continue;
        }
        context.segmentBytes().limit(context.valueOffset() + context.valueSize());
        context.segmentBytes().position(context.keySizeOffset());
        boolean success=entryCallback.onEntry(context.segmentBytes(),chronicleId,bootStrapTimeStamp());
        entryCallback.onAfterEntry();
        if (success)         changesForUpdatesClear(position);
        return success;
      }
    }
   }
}