fix a bug in calculate_rollbacking_trace_length