{
  "slug": "aba-problem",
  "term": "ABA problem",
  "aliases": [
    "ABA"
  ],
  "definition": "The ABA problem occurs when a value changes from A to B and back to A, making equality with an earlier observation insufficient to detect the intervening changes.",
  "note": "Mechanism: A successful value comparison does not prove that a location stayed unchanged. ABA matters when an algorithm relies on that stronger assumption. [michael]\n\nLifetime: ABA can arise without freeing memory, for example when live nodes move between lists. Safe reclamation and logical history validation are separate obligations. Hazard pointers do not by themselves repair an algorithm already subject to ABA under garbage collection. [michael]\n\nRelative pointers: A native atomic_pptr example restores the same offset after A-B-A and then accepts a stale expected pointer. It checks 16 prescribed histories with live targets, not concurrent executions or allocator recovery. [example]\n\nScope: This result concerns the ordinary pointer header. The Ralloc paper separately describes 34-bit counters in internal partial-list and superblock-free-list heads. It is not evidence that the allocator omits ABA protection. [ralloc]",
  "status": "research",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-12-05",
  "related": [
    "compare-and-swap",
    "self-relative-pointer",
    "region-id-in-value",
    "ralloc",
    "linearizability"
  ],
  "citations": [
    {
      "id": "michael",
      "title": "Michael. Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects. IEEE TPDS 15(6), 2004, section 2.3, p. 493.",
      "url": "https://www.eecg.toronto.edu/~amza/ece1747h/papers/hazard_pointers.pdf",
      "accessed": "2026-12-05"
    },
    {
      "id": "ralloc",
      "title": "Cai et al. Understanding and Optimizing Persistent Memory Allocation. ISMM 2020, section 4.2, p. 65.",
      "url": "https://www.cs.rochester.edu/u/scott/papers/2020_ISMM_Ralloc.pdf",
      "accessed": "2026-12-05"
    },
    {
      "id": "example",
      "title": "Hesela. Relative-pointer checks: prescribed native ABA histories, controls, source hashes and limitations.",
      "url": "https://hesela.dev/research/relative-pointers/README.md",
      "accessed": "2026-12-05"
    }
  ],
  "provenance": [
    "Michael section 2.3 reviewed for logical ABA without reclamation; no hazard-pointer implementation or performance result is reproduced.",
    "The native example executes a prescribed single-thread history using pinned Ralloc headers, not its counted list heads or an allocator correctness test."
  ]
}
