Intermittent Linux kernel oops only under heavy memory pressure despite MemTest86 passing
Environment
Workstation: AMD Ryzen 7 5800X with 32GB DDR4 (2x16GB) in dual-channel, running Ubuntu 22.04 with stock kernel 5.15; MemTest86 completed multiple passes with no errors; VMs and containerized workloads run concurrently.
Symptoms
Under sustained memory- and I/O-heavy workloads (large builds and simultaneous VM workloads), the system intermittently experiences kernel oops/panics referencing 'NULL pointer dereference' in kernel slab allocator code and OOM-like stack traces. Reboots recover system. Issue does not occur under light desktop use or when running memory stress tests that allocate but do not exercise specific kernel paths.
Observations
dmesg logs after reboot contain oops backtraces pointing to kmalloc/scheduler code paths and occasionally show 'uncorrectable ECC' messages in some traces on systems with non-ECC RAM (meaning message is synthetic). MemTest86 passes; swapping RAM sticks between DIMM slots did not change frequency of oops. Using an older kernel (5.13) reduced occurrence rate but did not eliminate it. CPU and motherboard temperatures within spec; BIOS is latest stable release with default settings (XMP disabled).
Already attempted
Updated BIOS to latest stable, swapped DIMMs into alternate slots, tested each stick individually under MemTest86 (no errors), tried different kernel versions (5.13, 5.15), and disabled performance‑boosting BIOS options (PBO/auto overclocking). Observed oops less frequently with older kernel, suggesting a possible kernel regression or a timing-sensitive hardware interaction.
Question
Given passing MemTest86 but kernel oops under heavy Linux memory pressure, what diagnostic sequence will help determine whether this is a kernel bug, microcode/CPU erratum, or a subtle memory subsystem issue (training/IMC), and what non-destructive mitigations should I try first?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags