---
title: "RocksDB development finds a CPU bug"
description: "A RocksDB unit test that generated thousands of SST file unique IDs across many threads exposed a hardware bug: the RDSEED instruction on a newer AMD CPU sometimes returned 0 while reporting success, but only on some cores and only under memory load."
url: "https://swe.quest/articles/rocksdb-development-finds-a-cpu-bug-3928169c558d3987"
canonical: "https://rocksdb.org/blog/2026/02/17/cpu-bug.html"
source: "RocksDB Blog"
published: "2026-02-17"
difficulty: "medium"
kind: "Incident"
reading_minutes: 4
tags: ["hardware","testing","debugging","storage-engines","c-cpp"]
---

# RocksDB development finds a CPU bug

A post on [RocksDB Blog](https://swe.quest/sources/rocksdb.md), published 2026-02-17, 4 min read, Incident. Original: [https://rocksdb.org/blog/2026/02/17/cpu-bug.html](https://rocksdb.org/blog/2026/02/17/cpu-bug.html)

## Summary

A RocksDB unit test that generated thousands of SST file unique IDs across many threads exposed a hardware bug: the RDSEED instruction on a newer AMD CPU sometimes returned 0 while reporting success, but only on some cores and only under memory load. The failure appeared only through libstdc++'s std::random\_device, not through rdrand, /dev/urandom or libc++. It was reproduced by scaling the thread count to roughly the core count, and was mitigated with a Linux kernel patch that marks RDSEED unavailable, followed by an AMD microcode update tracked as a high-severity CVE. The takeaways are to test what you depend on, combine redundant entropy sources, and add sanity checks, because even CPUs can be wrong.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [C & C++](https://swe.quest/tags/c-cpp.md) (Languages)

## Prerequisites

- random number generation basics
- multithreaded testing ([easy posts on Testing](https://swe.quest/tags/testing.md?difficulty=easy))

## Keywords

RocksDB, RDSEED, AMD, std::random\_device, libstdc++, SST files

## Related posts

- [Core dump epidemiology: fixing an 18-year-old bug](https://swe.quest/articles/core-dump-epidemiology-fixing-an-18-year-old-bug-49f918c45e5e4eb3.md): OpenAI · 2026-06-30 · Hard · 16 min read · Debugging, C & C++, Linux, Hardware, Incidents & postmortems
  Mysterious return-to-bogus-address crashes in Rockset's C++ execution layer turned out to be two unrelated bugs: silent register corruption on a single bad Azure host, and an 18-year-old race in GNU libunwind's \_Ux86\_64\_setcontext, which read the synthesized ucontext\_t after moving %rsp past it, letting a frequent SIGUSR2 CPU-time signal clobber it during exception unwinding.
- [An adventure in writing compatible systems](https://swe.quest/articles/an-adventure-in-writing-compatible-systems-f48d37f87fc6e365.md): Turso · 2025-08-28 · Medium · 4 min read · SQLite, Storage engines, Formal methods, Debugging, Rust
  Turso, a Rust rewrite of SQLite, hit a bug where every write after the database crossed 1GB made SQLite's integrity checks fail, even though Turso's own checks found the file intact.
- [Fuzzing rust-minidump for Embarrassment and Crashes – Part 2](https://swe.quest/articles/fuzzing-rust-minidump-for-embarrassment-and-crashes-part-2-036e58ccd9566822.md): Mozilla Hacks · 2022-06-23 · Medium · 16 min read · Testing, Rust, Debugging, Vulnerability research
  Fuzzing rust-minidump with cargo-fuzz and libfuzzer turned up a series of real bugs in a Rust rewrite of Breakpad's minidump processor that had otherwise shipped cleanly.
- [The effect of switching to TCMalloc on RocksDB memory use](https://swe.quest/articles/the-effect-of-switching-to-tcmalloc-on-rocksdb-memory-use-97e46a9ddc75be5e.md): Cloudflare · 2021-02-03 · Medium · 8 min read · Memory management, Performance engineering, Linux, Storage engines
  Quicksilver's memory roughly doubled after its storage moved to RocksDB, climbing from about 15GB to 30GB over several days.
- [A Higgs-bugson in the Linux Kernel](https://swe.quest/articles/a-higgs-bugson-in-the-linux-kernel-ee1594bf1b749860.md): Jane Street Tech Blog · 2025-07-02 · Hard · 11 min read · Debugging, Linux, Storage systems, Identity & auth, Networking
  Rare EACCES failures during large file copies over Kerberized NFSv3 came from a Linux kernel bug in RPCSEC\_GSS reply verification.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
