[GhostBSD] Java hard lockup on AMD Ryzen 5 PRO 2400GE

I searched but can't seem to find any information on this issue. I have GhostBSD installed (24.10.1) which is based on FreeBSD 14.1-STABLE on a system with the AMD Ryzen 5 PRO 2400GE CPU. If I install Java (openjdk version 8 or 17), some operations on some projects cause my computer to hard lock up (mouse also freezes, I have to hold the power button for 5 seconds to shut down). This is very repeatable, for example, if I generate a project from https://start.vertx.io/ and then run "./mvnw exec:run", it starts downloading jar files and then hard locks up. On a different project, if I invoke the coffeescript compiler, it will hard lock up. However other projects do compile and run, so I am not sure exactly where the problem is. If I switch to linux and run the same project and operation, it works fine.

I should also mention that this CPU had an issue with both Linux and FreeBSD that was causing random hard lockups until I set the "idle=nomwait" on Linux and "machdep.idle_mwait=0" on FreeBSD. In both cases this fixed the issue completely, but initially I thought the java lockup in FreeBSD was related to this, but this only seems to affect Java in certain circumstances.

Things I have tried:
- copy project to different hard drive and try there
- run the mvnw command in a thin jail
- try different java version
- try more "cpu fixes" for the AMD CPU, e.g. "machdep.idle=hlt", "cpucontrol -m '0xc0011029|=0x2000' /dev/cpuctlXXX"

I was still getting the hard lockups, making debugging really difficult since the dmesg is reset when I reboot. Anyone else experience something similar? Any ideas on what I can try?
 
I've done some more testing to narrow the issue down:

On a clean install of FreeBSD 14.1:
- apply machdep.idle_mwait=0 CPU fix
- install openjdk21, try to compile and run app. This works fine, no lockup.
- Install openjdk17 and try to compile and run app, locks up

On the GhostBSD installation:
- Install openjdk21, try to compile and run app, works fine, no lockup.

So it seems like the problem is specifically with openjdk17 on FreeBSD, which is the default that is installed when you install libreoffice, for example. I have also had lockups on openjdk8 on a separate project (Scala 2, locks up when fetching JARs for coffeescript compilation).
 
I compiled 2009Scape yesterday FreeBSD 14.1 and OpenJDK 17 with mvn and gradle seemingly no problem (notes).

I should also mention that this CPU had an issue with both Linux and FreeBSD that was causing random hard lockups until I set the "idle=nomwait" on Linux and "machdep.idle_mwait=0" on FreeBSD.

I have dev.hwpstate_intel.0.epp=0 set and disable C-States in BIOS; I usually do that on Windows and Linux too but didn't try without forcing high-perf.
 
I ran the FreeBSD test with no desktop installed, just from the terminal. Would the AMD DRM driver be used in this case? The maven build tool is a command line tool that I don't think makes use of GPU, but I could be wrong.
 
Yes during a build, for example it will show something like:

$ ./mvnw compile
...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom (1.3 kB at 52 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom (4.0 kB at 145 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/18/maven-shared-components-18.pom
Progress (2/4): ...


And lock up at the "Progress" part. If I reboot and try again, it will continue to download more jars and then potentially lock up again at another "Progress" part, or if I'm lucky it might just go through to the end and complete the compile. If I then clear the "~/.m2" folder and try again, without fail, it will lock up again.
 
Back
Top