A colleague found a crash at line 24965: cell_next_[t] = t+1; I forced resizing before the loop if (cell_next_.size()<pool_end-1) cell_next_.resize(pool_end-1); and the problem goes away. Could it be out-of-bound?