Java broken in my system

Non manjaro specific

Each time I do java --version i got

[0.021s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EINVAL) for attributes: stacksize: 1024k, guardsize: 4k, detached.
[0.021s][error  ][gc,task  ] Failed to create worker thread

This means I can’t compile anything (maven, gradle).

I have tried reinstalling all java versions, use archlinux-java status yields

Available Java environments:
  java-11-openjdk
  java-19-openjdk (default)
  java-8-openjdk

switching to the different versions still gave the same result. Please Help!!

That should be java -version, not java --version

Same thing

[alex@alex-b450aoruselite ~]$ java --version
[0.002s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EINVAL) for attributes: stacksize: 1024k, guardsize: 4k, detached.
[0.002s][error  ][gc,task  ] Failed to create worker thread
--------------------------------------------------------------------------------------------------------------------------- 17:02:48
[alex@alex-b450aoruselite ~]$ java -version
[0.002s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EINVAL) for attributes: stacksize: 1024k, guardsize: 4k, detached.
[0.002s][error  ][gc,task  ] Failed to create worker thread

maven and gradle fails with the same error, so it is java specific

mvn compile -f "/home/alex/GIT/NMQC/pom.xml" -D scijava.app.directory=/home/alex/Programas/Fiji.app/
[0.002s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EINVAL) for attributes: stacksize: 1024k, guardsize: 4k, detached.
[0.002s][error  ][gc,task  ] Failed to create worker thread

Did you reboot, then the problem still appeared?

Yep, Rebooted, changed kernel to LTS, nothing works. Its not manjaro or linux specific

Does other Java version e.g. 8 have the same problem?

yes, all versions show the same. I tried $ sudo archlinux-java fix and nothing, still happening the same

I have no problem with all Java versions. But:

I am not sure if this is related to some bad config for your CPU.

I just can’t find anything helpful in google. I am not running anything, so the memory error they mention makes no sense to me.

Everything else works fine. Just java fails

Can you provide info: inxi -Fazy ?

[alex@alex-b450aoruselite ~]$ inxi -Fazy
System:
  Kernel: 6.1.21-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=10db63cd-2294-494c-8b33-b85abc208398 rw quiet nowatchdog
    resume=UUID=62aa6a62-d638-465d-b76c-335425b00b70 udev.log_priority=3
    amdgpu.dc=0 acpi_enforce_resources=lax amd_pstate=passive audit=0
  Desktop: KDE Plasma v: 5.27.3 tk: Qt v: 5.15.8 wm: kwin_wayland vt: 1
    dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: Gigabyte model: B450 AORUS ELITE
    serial: <superuser required> UEFI: American Megatrends LLC. v: F63
    date: 01/24/2022
CPU:
  Info: model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ gen: 2
    level: v3 note: check built: 2018-21 process: GF 12nm family: 0x17 (23)
    model-id: 8 stepping: 2 microcode: 0x800820D
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 768 KiB desc: d-8x32 KiB; i-8x64 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB
    desc: 2x8 MiB
  Speed (MHz): avg: 2166 high: 2200 min/max: 2200/3700 boost: enabled
    scaling: driver: acpi-cpufreq governor: ondemand cores: 1: 2143 2: 2191
    3: 2176 4: 2131 5: 2138 6: 2192 7: 2149 8: 2142 9: 2189 10: 2186 11: 2184
    12: 2200 13: 2184 14: 2174 15: 2181 16: 2111 bogomips: 118217
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    disabled, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
    vendor: XFX Pine driver: amdgpu v: kernel arch: GCN-4 code: Arctic Islands
    process: GF 14nm built: 2016-20 pcie: gen: 3 speed: 8 GT/s lanes: 16 ports:
    active: DP-2 empty: DP-1, DP-3, DVI-D-1, HDMI-A-1 bus-ID: 07:00.0
    chip-ID: 1002:67df class-ID: 0300 temp: 45.0 C
  Device-2: Sonix USB Camera type: USB driver: uvcvideo bus-ID: 1-5.1:6
    chip-ID: 26e0:3c13 class-ID: 0e02
  Display: wayland server: X.org v: 1.21.1.7 with: Xwayland v: 23.1.0
    compositor: kwin_wayland driver: X: loaded: amdgpu dri: radeonsi gpu: amdgpu
    display-ID: 0
  Monitor-1: DP-2 res: 1920x1080 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 22.3.7 renderer: AMD Radeon RX 570 Series
    (polaris10 LLVM 15.0.7 DRM 3.49 6.1.21-1-MANJARO) direct-render: Yes
Audio:
  Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
    vendor: XFX Pine driver: snd_hda_intel bus-ID: 1-5.3:9 v: kernel pcie:
    chip-ID: 1b3f:2008 gen: 3 class-ID: 0300 speed: 8 GT/s lanes: 16
    bus-ID: 07:00.1 chip-ID: 1002:aaf0 class-ID: 0403
  Device-2: AMD Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 09:00.3
    chip-ID: 1022:1457 class-ID: 0403
  Device-3: Generalplus Usb Audio Device type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Device-4: DSEA A/S EPOS BTD 800 type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-6.2:8 chip-ID: 1395:0382
    class-ID: 0300 serial: <filter>
  Device-5: JMTek LLC. USB PnP Audio Device type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-6.4:11 chip-ID: 0c76:1695
    class-ID: 0300
  Sound API: ALSA v: k6.1.21-1-MANJARO running: yes
  Sound Interface: sndio v: N/A running: no
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.67 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: f000 bus-ID: 04:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: docker0 state: down mac: <filter>
  IF-ID-2: pan1 state: down mac: <filter>
Bluetooth:
  Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: USB
    driver: btusb v: 0.8 bus-ID: 1-7:7 chip-ID: 0a12:0001 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:
  Local Storage: total: 3.21 TiB used: 2.06 TiB (64.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 970 EVO 500GB
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: 2B2QEXE7 temp: 35.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD20EZRZ-00Z5HB0
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 5400 serial: <filter> rev: 0A80 scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Hitachi model: HDT725050VLA360
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
    type: N/A serial: <filter> rev: A7EA scheme: GPT
  ID-4: /dev/sdc maj-min: 8:32 vendor: Hitachi model: HTS725050A9A364
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: C70E scheme: GPT
  ID-5: /dev/sdd maj-min: 8:48 type: USB vendor: SanDisk model: Cruzer Force
    size: 29.81 GiB block-size: physical: 512 B logical: 512 B type: N/A
    serial: <filter> rev: 1.00 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  ID-1: / raw-size: 465.46 GiB size: 457.09 GiB (98.20%)
    used: 229.05 GiB (50.1%) fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 296 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 1.79 TiB size: 1.76 TiB (98.37%)
    used: 1.33 TiB (75.3%) fs: ext4 dev: /dev/sda2 maj-min: 8:2
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 29.3 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/sda1 maj-min: 8:1
  ID-2: swap-2 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram0
  ID-3: swap-3 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram1
  ID-4: swap-4 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram2
  ID-5: swap-5 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram3
  ID-6: swap-6 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram4
  ID-7: swap-7 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram5
  ID-8: swap-8 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram6
  ID-9: swap-9 type: zram size: 1000.7 MiB used: 0 KiB (0.0%) priority: 32767
    dev: /dev/zram7
  ID-10: swap-10 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram8
  ID-11: swap-11 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram9
  ID-12: swap-12 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram10
  ID-13: swap-13 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram11
  ID-14: swap-14 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram12
  ID-15: swap-15 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram13
  ID-16: swap-16 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram14
  ID-17: swap-17 type: zram size: 1000.7 MiB used: 0 KiB (0.0%)
    priority: 32767 dev: /dev/zram15
Sensors:
  System Temperatures: cpu: 44.5 C mobo: 35.0 C gpu: amdgpu temp: 45.0 C
  Fan Speeds (RPM): cpu: 1397 fan-1: 0 fan-3: 1421 fan-4: 1159 gpu: amdgpu
    fan: 1903
  Power: 12v: N/A 5v: N/A 3.3v: 3.38 vbat: 3.36 gpu: amdgpu watts: 34.07
Info:
  Processes: 431 Uptime: 3h 40m wakeups: 0 Memory: 31.27 GiB
  used: 7.11 GiB (22.7%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.1 alt: 10/11/9 clang: 15.0.7
  Packages: 2920 pm: dpkg pkgs: 0 pm: pacman pkgs: 2901 libs: 601
  tools: pamac,paru pm: flatpak pkgs: 17 pm: snap pkgs: 2 Shell: Bash v: 5.1.16
  running-in: konsole inxi: 3.3.25

Test:

Try disabling CPU hyperthreading and SVM in BIOS, if the problem is gone?

I can’t restart now. But I will try this later, thanks for the hint!

Are you in testing branch ?

I’ve tried stable, testing and unstable: no change. There shall be some dirtiness in my system, I just don’t know where

When did the problem appear? → After switching from the unstable branch to the stable branch it happened?

There sure is something odd:

uname -a
Linux manjaro18 6.1.19-1-MANJARO #1 SMP PREEMPT_DYNAMIC Mon Mar 13 12:59:35 UTC 2023 x86_64 GNU/Linux

java -version
find-the-command: "java" is not found locally, searching in repositories...
find-the-command: /var/cache/pkgfile/*.files are out of date, update? [Y/n] n
find-the-command: "java" may be found in the following packages:
	extra/java-runtime-common
	extra/jdk8-openjdk
	extra/jre-openjdk-headless
	extra/jre11-openjdk-headless
	extra/jre17-openjdk-headless
	extra/jre8-openjdk-headless
	community/gephi

archlinux-java status
Available Java environments:
  java-11-openjdk
  java-17-openjdk
  java-19-openjdk
  java-20-openjdk-bin
  java-21-openjdk
  java-8-openjdk
No Java environment set as default

A few days ago this was set on my system :thinking:

How to solve:

sudo archlinux-java set java-19-openjdk
[sudo] Passwort für andreas:

archlinux-java status
Available Java environments:
  java-11-openjdk
  java-17-openjdk
  java-19-openjdk (default)
  java-20-openjdk-bin
  java-21-openjdk
  java-8-openjdk

java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7)
OpenJDK 64-Bit Server VM (build 19.0.2+7, mixed mode)

:footprints:

For me it sounds like a wrong memory config somewhere on your system.

Would you try if
java -Djdk.lang.processReaperUseDefaultStackSize=true -version
could be a workaround?

1 Like

Nope

[alex@alex-b450aoruselite ~]$ java -Djdk.lang.processReaperUseDefaultStackSize=true -version
[0.002s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EINVAL) for attributes: stacksize: 1024k, guardsize: 4k, detached.
[0.002s][error  ][gc,task  ] Failed to create worker thread