Re: PROBLEM: Probabilistic segfault on AMD hardware with INVLPGB
From: Matt Fleming
Date: Thu Jul 09 2026 - 03:22:08 EST
On Wed, Jul 08, 2026 at 09:17:39AM -0700, Borislav Petkov wrote:
> Hey man,
>
> what's up?
>
> I see you're having fun. :-P
Hey! Yep, you know me mate... slightest whiff of a CPU bug and I'm there ;-)
> On Tue, Jul 07, 2026 at 01:18:30PM +0100, Matt Fleming wrote:
> > Hi Rik and Henrik,
> >
> > I've got a small C reproducer that triggers this within the first round
> > on Cloudflare's AMD Turin machines:
> >
> > https://gist.github.com/mfleming/ca26ad3f8d65a12d23d62fb176480fc1
> >
> > Build:
> >
> > gcc -O2 -Wall -Wextra -pthread -static -o repro-invlpgb repro-invlpgb.c
>
> You need to have -std=c11 here on Debian-based systems because it says
>
> repro-invlpgb.c:94:30: error: implicit declaration of function ‘ATOMIC_VAR_INIT’; did you mean ‘ATOMIC_FLAG_INIT’? [-Wimplicit-function-declaration]
> 94 | static atomic_bool running = ATOMIC_VAR_INIT(true);
>
> here due to not "seeing" the stdatomic.h include. I guess atomics are a C11
> thing... :)
Thanks! I guess Ubuntu's GCC defaults masked this.