Program: 30799
Project: 30799
Buggy source:
private boolean readTxn(){
  int count=0;
  while (true) {
    long txn=txMem.getLong(TableUtils.TX_OFFSET_TXN);
    if (txn == this.txn) {
      return false;
    }
    Unsafe.getUnsafe().loadFence();
    long checkTxn;
    while ((checkTxn=txMem.getLong(TableUtils.TX_OFFSET_TXN_CHECK)) < txn) {
      LockSupport.parkNanos(1);
    }
    if (txn == checkTxn) {
      Unsafe.getUnsafe().loadFence();
      final long transientRowCount=txMem.getLong(TableUtils.TX_OFFSET_TRANSIENT_ROW_COUNT);
      final long fixedRowCount=txMem.getLong(TableUtils.TX_OFFSET_FIXED_ROW_COUNT);
      final long maxTimestamp=txMem.getLong(TableUtils.TX_OFFSET_MAX_TIMESTAMP);
      final long structVersion=txMem.getLong(TableUtils.TX_OFFSET_STRUCT_VERSION);
      this.symbolCountSnapshot.clear();
      int symbolMapCount=txMem.getInt(TableUtils.TX_OFFSET_MAP_WRITER_COUNT);
      if (symbolMapCount > 0) {
        txMem.grow(TableUtils.TX_OFFSET_MAP_WRITER_COUNT + 4 + symbolMapCount * 4);
        for (int i=0; i < symbolMapCount; i++) {
          symbolCountSnapshot.add(txMem.getInt(TableUtils.TX_OFFSET_MAP_WRITER_COUNT + 4 + i * 4));
        }
      }
      Unsafe.getUnsafe().loadFence();
      if (txn == txMem.getLong(TableUtils.TX_OFFSET_TXN)) {
        this.txn=txn;
        this.transientRowCount=transientRowCount;
        this.rowCount=fixedRowCount + transientRowCount;
        this.maxTimestamp=maxTimestamp;
        this.structVersion=structVersion;
        LOG.info().$("String_Node_Str").$(txn).$("String_Node_Str").$(transientRowCount).$("String_Node_Str").$(fixedRowCount).$("String_Node_Str").$(maxTimestamp).$("String_Node_Str").$(count).$(']').$();
        break;
      }
      count++;
      LockSupport.parkNanos(1);
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean readTxn(){
  int count=0;
  final long deadline=configuration.getClock().getTicks() + configuration.getSpinLockTimeoutUs();
  while (true) {
    long txn=txMem.getLong(TableUtils.TX_OFFSET_TXN);
    if (txn == this.txn) {
      return false;
    }
    Unsafe.getUnsafe().loadFence();
    if (txn == txMem.getLong(TableUtils.TX_OFFSET_TXN_CHECK)) {
      Unsafe.getUnsafe().loadFence();
      final long transientRowCount=txMem.getLong(TableUtils.TX_OFFSET_TRANSIENT_ROW_COUNT);
      final long fixedRowCount=txMem.getLong(TableUtils.TX_OFFSET_FIXED_ROW_COUNT);
      final long maxTimestamp=txMem.getLong(TableUtils.TX_OFFSET_MAX_TIMESTAMP);
      final long structVersion=txMem.getLong(TableUtils.TX_OFFSET_STRUCT_VERSION);
      this.symbolCountSnapshot.clear();
      int symbolMapCount=txMem.getInt(TableUtils.TX_OFFSET_MAP_WRITER_COUNT);
      if (symbolMapCount > 0) {
        txMem.grow(TableUtils.TX_OFFSET_MAP_WRITER_COUNT + 4 + symbolMapCount * 4);
        for (int i=0; i < symbolMapCount; i++) {
          symbolCountSnapshot.add(txMem.getInt(TableUtils.TX_OFFSET_MAP_WRITER_COUNT + 4 + i * 4));
        }
      }
      Unsafe.getUnsafe().loadFence();
      if (txn == txMem.getLong(TableUtils.TX_OFFSET_TXN)) {
        this.txn=txn;
        this.transientRowCount=transientRowCount;
        this.rowCount=fixedRowCount + transientRowCount;
        this.maxTimestamp=maxTimestamp;
        this.structVersion=structVersion;
        LOG.info().$("String_Node_Str").$(txn).$("String_Node_Str").$(transientRowCount).$("String_Node_Str").$(fixedRowCount).$("String_Node_Str").$(maxTimestamp).$("String_Node_Str").$(count).$(']').$();
        return true;
      }
    }
    count++;
    if (configuration.getClock().getTicks() > deadline) {
      LOG.error().$("String_Node_Str").$(configuration.getSpinLockTimeoutUs()).utf8("String_Node_Str").$();
      throw CairoException.instance(0).put("String_Node_Str");
    }
    LockSupport.parkNanos(1);
  }
}