VirtualBox

Opened 2 weeks ago

Last modified 9 days ago

#22064 new defect

On LLVM clang compiled Linux kernel host, VirtualBox hard-freezes the host when launching a Virtual Machine.

Reported by: dreieck Owned by:
Component: host support Version: VirtualBox-7.0.16
Keywords: freeze Cc: dreieck
Guest type: all Host type: Linux

Description (last modified by dreieck)

Ahoj,

I am on Linux, kernel version 6.8.8, VirtualBox version 7.0.16 (EDIT: also with version 7.0.18 as tested later, see follow-up comment).

Virtual Box host module compiled via DKMS for all installed kernels.

When I want to run any VortualBox virtual machine with a Linux kernel compiled using the LLVM clang compiler, the system freezes immediately, only a hard reset helps (also the Linux' SysRq does not work anymore). A dmesg -w running in parallel in another window does not show anything (before system freeze).

When I instead use a kernel compiled with GCC (otherwise same kernel configuration), VirtualBox virtual machine runs as expected.

Note that using LLVM clang is a supported compiler for Linux.

Compiler versions:

  • clang --version:
    clang version 17.0.6
    Target: x86_64-pc-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin
    
  • ld.lld --version: LLD 17.0.6 (compatible with GNU linkers)
  • gcc --version | head -n1: gcc (GCC) 13.2.1 20240417

I attach the following files for background information:

  • Kernel config of the GCC compiled kernel: config_6.8.8-gcc.gz (compressed),
  • Kernel config of the LLVM clang compiled kernel: config_6.8.8-clang.gz (compressed),
  • diff between those two kernel configurations: config-diff_6.8.8-gcc-clang.txt,
  • dmesg output after booting the system with the GCC compiled kernel: dmesg_6.8.8-gcc.log,
  • dmesg output after booting the system with the LLVM clang compiled kernel: dmesg_6.8.8-clang.log,
  • hwinfo output (captured with the LLVM clang compiled kernel): hwinfo_6.8.8-clang.log.zstd (compressed),
  • inxi -F output (captured with the LLVM clang compiled kernel): inxi_6.8.8-clang.log,
  • lspci -vvv output (captured with the LLVM clang compiled kernel): lspci_6.8.8-clang.log,
  • The VirtualBox-logfile of sucessfully running a Virtual Machine from the host booted with the GCC compiled kernel: VirtualBox-machine-log_CD boot-2024-05-04-19-58-26_6.8.8-gcc.log. *(All occurances of <censored> in those logs are censorings of my username.)*

Regards!

Attachments (9)

config_6.8.8-gcc.gz (69.2 KB ) - added by dreieck 2 weeks ago.
Linux kernel configuration of the GCC compiled kernel
config_6.8.8-clang.gz (69.2 KB ) - added by dreieck 2 weeks ago.
Linux kernel config of the clang compiled kernel
config-diff_6.8.8-gcc-clang.txt (2.1 KB ) - added by dreieck 2 weeks ago.
diff between the two kernel configs (GCC and clang compiled kernel)
dmesg_6.8.8-gcc.log (109.9 KB ) - added by dreieck 2 weeks ago.
dmesg output after booting the system with the GCC compiled kernel
dmesg_6.8.8-clang.log (108.3 KB ) - added by dreieck 2 weeks ago.
dmesg output after booting the system with the clang compiled kernel
hwinfo_6.8.8-clang.log.zst (251.1 KB ) - added by dreieck 2 weeks ago.
hwinfo output (captured with the LLVM clang compiled kernel)
inxi_6.8.8-clang.log (3.0 KB ) - added by dreieck 2 weeks ago.
inxi -F output (captured with the LLVM clang compiled kernel)
lspci_6.8.8-clang.log (94.3 KB ) - added by dreieck 2 weeks ago.
lspci -vvv output (captured with the LLVM clang compiled kernel)
VirtualBox-machine-log_CD boot-2024-05-04-19-58-26_6.8.8-gcc.log (327.3 KB ) - added by dreieck 2 weeks ago.
The VirtualBox-logfile of sucessfully running a Virtual Machine from the host booted with the GCC compiled kernel

Download all attachments as: .zip

Change History (23)

by dreieck, 2 weeks ago

Attachment: config_6.8.8-gcc.gz added

Linux kernel configuration of the GCC compiled kernel

by dreieck, 2 weeks ago

Attachment: config_6.8.8-clang.gz added

Linux kernel config of the clang compiled kernel

by dreieck, 2 weeks ago

diff between the two kernel configs (GCC and clang compiled kernel)

by dreieck, 2 weeks ago

Attachment: dmesg_6.8.8-gcc.log added

dmesg output after booting the system with the GCC compiled kernel

by dreieck, 2 weeks ago

Attachment: dmesg_6.8.8-clang.log added

dmesg output after booting the system with the clang compiled kernel

by dreieck, 2 weeks ago

Attachment: hwinfo_6.8.8-clang.log.zst added

hwinfo output (captured with the LLVM clang compiled kernel)

by dreieck, 2 weeks ago

Attachment: inxi_6.8.8-clang.log added

inxi -F output (captured with the LLVM clang compiled kernel)

by dreieck, 2 weeks ago

Attachment: lspci_6.8.8-clang.log added

lspci -vvv output (captured with the LLVM clang compiled kernel)

by dreieck, 2 weeks ago

The VirtualBox-logfile of sucessfully running a Virtual Machine from the host booted with the GCC compiled kernel

comment:1 by dreieck, 2 weeks ago

Description: modified (diff)

comment:2 by dreieck, 2 weeks ago

Description: modified (diff)

comment:3 by dreieck, 2 weeks ago

Also happens with VirtualBox version 7.0.18, and with "Enable 3D Acceleration" switched off and with USB 1.1 instead of USB 3.0.

comment:4 by dreieck, 2 weeks ago

Description: modified (diff)

comment:5 by dreieck, 2 weeks ago

Description: modified (diff)

comment:6 by dreieck, 2 weeks ago

Description: modified (diff)

comment:7 by dreieck, 2 weeks ago

Description: modified (diff)

comment:8 by galitsyn, 12 days ago

Hi dreieck,

Please update to version 7.0.18.

comment:9 by dreieck, 12 days ago

Please update to version 7.0.18.

As I wrote in this follow-up comment (timestamp 2024-05-04T21:55:23+01:00) and in the edited post, I have updated to 7.0.18 and tested there; it also appears in 7.0.18.

Last edited 12 days ago by dreieck (previous) (diff)

comment:10 by galitsyn, 12 days ago

Hi dreieck,

We do not officially support CLANG on Linux host (only GCC is supported). We also do not support DKMS anymore. I wonder if you are dealing with host modules which come with your Linux distribution?

comment:11 by dreieck, 12 days ago

We do not officially support CLANG on Linux host (only GCC is supported).

That is sad. Since clang is a compiler supported by the Linux kernel I hereby feature request that VirtualBox host modules support it, too. Only with clang the linux kernel can be optimised by link time optimisation (LTO), which gives a performance gain.

This actually then will mean I prioritise moving my virtual machines away from VirtualBox to qemu/KVM/libvirt, since this does not have all those problems and seems more open; and going to stop using your software.

We also do not support DKMS anymore. I wonder if you are dealing with host modules which come with your Linux distribution?

Yes; virtualbox-host-dkms of Artix Linux: package, package recipe.

Last edited 12 days ago by dreieck (previous) (diff)

comment:12 by galitsyn, 11 days ago

Hi dreieck,

Try to uninstall VirtualBox package which comes with your Linux distribution and install official one from Downloads page to see if the issue is still present.

comment:13 by dreieck, 9 days ago

install official one from Downloads

You do not have Arch Linux packages.

And I _will not_ run a (possibly shady) shell script to install your software, maybe messing with my installation.

Do you have precompiled binaries available as e.g. a .tar.gz file, which are quite "relaxed" with regard to versioned dependencies/ statically compiled?, which perfectly can run out of /opt/?

---

What I am currently doing, going to test and then going to report back:

  • Compiling vanilla Linux kernel with GCC and CLANG; and with CLANG
    • without LTO,
    • with ThinLTO,
    • with Full LTO.
Last edited 9 days ago by dreieck (previous) (diff)

comment:14 by dreieck, 9 days ago

What I am currently doing, going to test and then going to report back:

  • Compiling vanilla Linux kernel with GCC and CLANG; and with CLANG
    • without LTO,
    • with ThinLTO,
    • with Full LTO.

Already the clang-compiled linux kernel without LTO enabled -- based on the default configuration of my distribution (Artix) -- did lead to the freeze, whereas the same kernel based on the same configuration compiled with gcc did not.

So LTO is not the issue here.

So I still need to proof or disproof if this also happens with VirtualBox compiled "officially" by oracle.

Last edited 9 days ago by dreieck (previous) (diff)
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use