Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

Encryption-related regression/connection issues with 10th/11th gen Intel + new AMD CPUs

Open Camotoy opened this issue 2 years ago • 29 comments

Describe the bug

There is some encryption-related bug where players are only able to play for a short time before communication essentially ceases and no actions go through to Geyser if the server is running a 10th or 11th generation Intel processor. It appears not all 10th generation Intel processors are affected, but potentially all 11th generation processors are (if the processor has AVX-512 support, then it is affected).

Fix

Java versions at, or greater than, 17.0.6 and 19.0.2, and OpenJDK 20 build 17 or greater, have this encryption bug fixed.

If you cannot update to these versions: add the following JVM parameters to your startup arguments: -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics (add these before -jar)

Geyser Version

As of https://github.com/GeyserMC/Geyser/commit/7bd5b595650322d8915558731a282985235d1d07

Additional Context

:(

Camotoy avatar Feb 23 '22 03:02 Camotoy

Any update on this ticket?

pcboii avatar Jun 03 '22 21:06 pcboii

I have recently been able to test on a Gen 11 machine - it may actually be a JDK bug. ~~For anyone affected, try using Java 18.0.1+ - using Adoptium's JDK 18.0.1+10 Windows release, I was unable to replicate the bug.~~

Camotoy avatar Jun 04 '22 00:06 Camotoy

I have recently been able to test on a Gen 11 machine - it may actually be a JDK bug. For anyone affected, try using Java 18.0.1+ - using Adoptium's JDK 18.0.1+10 Windows release, I was unable to replicate the bug.

Just tested on 10th gen Intel (Surface Laptop 3), I have this bug. Good to know I'm not the only one :P

zurgeg avatar Jun 08 '22 15:06 zurgeg

Posting for those interested.

Yes, it is an OpenJDK bug that only affects processors with AVX-512. The bug seems to occur when encrypting/decrypting less than 16 bytes at a time. The relevant code is here https://github.com/openjdk/jdk/blob/9bff3b76f2e5d0ecede6c0d4042f65d377a28325/src/hotspot/cpu/x86/macroAssembler_x86_aes.cpp#L783-L814

It looks like the preloop assumes there is at least 16 bytes of input, leading to corruption of the cipher state such as the counter variable.

A bug report and potential fix has been sent. Waiting on their response.

AJ-Ferguson avatar Aug 05 '22 22:08 AJ-Ferguson

Thank you so much for the temp fix 🙏worked perfectly, was stressing so hard over this

Swirren avatar Aug 29 '22 20:08 Swirren

Is this proleam only with 10/11th gen or is it also effecting older ones and is it effecting 12gen?

Ai-Kiwi avatar Sep 02 '22 22:09 Ai-Kiwi

Older ones are definitely not affected. Newer ones very likely are but we haven't confirmed if to the same degree or worse.

Camotoy avatar Sep 03 '22 02:09 Camotoy

~~This breaks on Intel Xeon E5-2670 v1 with these specs:~~ https://www.cpu-world.com/CPUs/Xeon/Intel-Xeon%20E5-2670.html

~~Including the startup options~~ -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics ~~does not fix.~~

ETA: Updating to latest build of Geyser-Spigot fixed it for me (ended up being a 2.0.5 -> 2.1.0-snapshot update).

josiahcarlson avatar Sep 30 '22 04:09 josiahcarlson

same on a raspberry pi

Fefedu973 avatar Sep 30 '22 15:09 Fefedu973

Unless a new Raspberry Pi model was introduced with AVX-512 support, it is very likely not affected. Same with a Xeon processor for 2012. Make sure you're using the latest Geyser version, and if the issue persists please make a new issue.

Camotoy avatar Sep 30 '22 15:09 Camotoy

@Camotoy I'm pretty sure this is fixed on OpenJDK 20 rev 17+ and OpenJDK 21

DylanKeir avatar Dec 16 '22 10:12 DylanKeir

We're aware that this issue is fixed in an upcoming version. If I remember correctly they aren't released yet, but they will be in the coming month.

Tim203 avatar Dec 16 '22 10:12 Tim203

It's fixed in 11.0.18, 15.0.10, 17.0.6 and 19.0.2. These versions will all release on 2023-01-17. And you're right, it's fixed in build 17 and higher of OpenJDK 20.

After January the 17th it'll be up to the hosting providers to update their Java versions. Link to the bug tracker: https://bugs.openjdk.org/browse/JDK-8292158

Tim203 avatar Dec 24 '22 14:12 Tim203

is it got fixed on java 19.0.2? (i tested and not fixed) still i am getting a lag issue on new chunks and get disconnected

adalmo avatar Jan 17 '23 22:01 adalmo

https://user-images.githubusercontent.com/88581750/213038228-b6ec092d-566e-4869-969f-c31e9f71c76c.mp4

hmm i was on window 10 edition (1.19.51) and i got fps lags when i get close to new chunks

adalmo avatar Jan 17 '23 23:01 adalmo

same as on jdk 17.0.6

adalmo avatar Jan 18 '23 03:01 adalmo

то же, что и в jdk 17.0.6

That is, there is no full support for AVX-512 in jdk 19?

DimaSergeew avatar Jan 26 '23 09:01 DimaSergeew

AVX-512 support has been implemented in Java 11 I believe. This was simply a bug in their implementation.

Tim203 avatar Jan 26 '23 10:01 Tim203

I had a similar thing happen, but the bedrock client experiencing it was iOS. The first time it happened, all chunks just stopped loading until relog, and the second time, all players (not sure if other entities were affected) were frozen on the client-side.

hw2007 avatar Jun 08 '23 15:06 hw2007

Seems to also affect the new Epyc genoa 9654 cpu's (the flags do fix it, it seems)

smashyalts avatar Jun 09 '23 13:06 smashyalts

Yes it will happen on any CPU with AVX512 support, so basically as more new CPUs are released more are affected by this issue. That's why the best solution at this point is to update Java rather than rely on the flags.

Kas-tle avatar Jun 09 '23 15:06 Kas-tle

Yes it will happen on any CPU with AVX512 support, so basically as more new CPUs are released more are affected by this issue. That's why the best solution at this point is to update Java rather than rely on the flags.

what java fixes this?, currently running java 17

smashyalts avatar Jun 09 '23 16:06 smashyalts

nvm just saw the java 20 thing above

smashyalts avatar Jun 09 '23 16:06 smashyalts

On bedrock, for me, I can load in and join fine but no chunks load and I fall in the void. It was working earlier too which is just strange. This seems to be a recurring issue.

riqvip avatar Jul 03 '23 10:07 riqvip

having issues on nodecraft, cannot figure out how to add fix to jar or whatever is going on there, and it doesnt seem like i can update, halp plz

yoopgim avatar Jan 01 '24 03:01 yoopgim

If you're aware that your java runtime is outdated, and you're unable to add the startup flags that patch the issue, then all you can do is ask your hosting provider.

Konicai avatar Jan 01 '24 05:01 Konicai

its more like i dont know how to do it

yoopgim avatar Jan 02 '24 04:01 yoopgim

its more like i dont know how to do it

Try contacting your host. Some hosts allow changing startup flags some doesn't.

hasankayra04 avatar Jan 02 '24 06:01 hasankayra04

Hey, so we updated our JVMs today, can you see if the issue persists?

NitradoYannick avatar Jan 04 '24 12:01 NitradoYannick

Closing this given the JVM fixes have been out for some time now. If you are still experiencing this, please ensure you are on the latest OpenJDK build available from your OpenJDK vendor.

Kas-tle avatar Mar 19 '24 05:03 Kas-tle