跳到正文
Skillpedia
API 与服务器(后端)42k · #6445

competition-race-condition-state-drift

它能做什么

这个工具帮助你复现多个操作同时发生时出现的问题。它关注的是操作的顺序和时机如何导致意外错误,比如数据不正确或操作被重复执行。

适用场景

  • ✓当你怀疑是操作的顺序导致了错误时。
  • ✓想测试两个东西同时修改同一份数据会发生什么时。
  • ✓想了解临时故障如何导致不同结果时。

技能链接

https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想测试两个人同时从同一个账户取钱会发生什么。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会先找出系统中可能被修改的部分(比如数据库或缓存中的数据)。然后模拟同时发生的操作,只改变它们的顺序或时机,看看是否会产生与预期不同的结果。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Competition Race Condition State Drift

Use this skill only as a downstream specialization after $ctf-sandbox-orchestrator is already active and has established sandbox assumptions, node ownership, and evidence priorities. If that has not happened yet, return to $ctf-sandbox-orchestrator first.

Use this skill when the decisive behavior depends on request timing, async ordering, lock gaps, or stale state.

Reply in Simplified Chinese unless the user explicitly requests English.

Quick Start

  1. Identify mutable state first: rows, cache keys, queue payloads, session fields, counters, or files.
  2. Reproduce with smallest concurrent sequence and fixed timing assumptions.
  3. Capture one baseline run and one racing run with only one variable changed.
  4. Track read, check, write, enqueue, and commit boundaries separately.
  5. Prove final state drift from a clean reset.

Workflow

1. Map Mutable Boundaries

  • Record transaction scope, lock behavior, retry logic, idempotency keys, cache invalidation, and queue handoff.
  • Note where read-check-write is split across requests, workers, or services.
  • Keep each boundary tied to exact timestamps or sequence numbers.

2. Reproduce Timing Window

  • Build deterministic concurrent inputs with controlled delay, duplicate requests, or reordered worker execution.
  • Compare accepted and rejected paths under identical payloads.
  • Record which condition flips when ordering changes.

3. Reduce To Decisive Race Chain

  • Compress to: request A and B ordering -> stale check or lock gap -> conflicting writes -> resulting capability or artifact.
  • State whether root cause is missing lock, weak idempotency, stale cache read, delayed async commit, or retry side effect.
  • If the path becomes queue-dominant, hand off to queue worker drift skill.

Read This Reference

  • Load references/race-condition-state-drift.md for race harness ideas, evidence blocks, and parity checks.

What To Preserve

  • Mutable keys, transaction boundaries, lock behavior, and idempotency markers
  • Timestamped or sequenced traces for baseline and race runs
  • One minimal replayable concurrent sequence proving drift
常见问题

什么是“状态”(state)?

状态是系统在某一时刻所保存的信息,比如银行账户的余额或订单的状态。

什么是“竞态条件”(race condition)?

它是指多个并发操作同时进行时,结果取决于这些操作执行的精确先后顺序,从而引发的问题。

为什么“顺序”很重要?

在有大量操作同时进行的系统中,这些操作被处理的先后顺序会改变最终结果。如果顺序得不到控制,就可能出错。

详情

作者的原始描述

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for race windows, ordering bugs, idempotency failures, lock gaps, concurrent worker drift, and state inconsistencies that produce decisive effects. Use when the user asks to reproduce timing-sensitive bugs, concurrent state corruption, duplicate actions, stale reads, or privilege or balance drift caused by request orderin

repo: zhaoxuya520/reverse-skill

热度

GitHub 星标
42k
排名
#6445
许可证
MIT
更新时间
2026/9/22

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能