Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Discussions related to using VirtualBox on Linux hosts.
hottobar
Posts: 28
Joined: 4. Feb 2021, 11:56

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by hottobar »

fth0 wrote:Bummer! :( Anyway, thanks for trying. :)

I'm out of ideas for the moment. IMHO, the next step would call for Windows kernel debugging, but I'm not savvy enough for that (yet). I'll post my current state of knowledge to the Bugtracker (possibly in #20165), either tonight or tomorrow, and then we'll have to wait if or when we'll get any reaction from the VirtualBox developers.
Thanks for your help anyway! :)

I'm willing to do other testing if necessary.

That ticket seems pertinent and I've commented on it, but it's not correctly categorized and maybe a more descriptive title would be better?
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by fth0 »

hottobar wrote:That ticket seems pertinent and I've commented on it, but it's not correctly categorized and maybe a more descriptive title would be better?
If you like, you can create another ticket, and I'll comment on that. I won't create a ticket myself, because I cannot reproduce the problem, and would therefore be an unsuited primary contact in the case of potential queries.
hottobar
Posts: 28
Joined: 4. Feb 2021, 11:56

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by hottobar »

I've converted this VM's vdi file to qcow2 and tested it with QEMU/KVM on the same host, and it didn't crash.

The VM's setup is obviously different but I tried to keep it as close as possible to the VBox one.
Under qemu/kvm the CPU is identified as "Intel Xeon Processor (Icelake)".
fth0 wrote:If you like, you can create another ticket, and I'll comment on that.
I've created this new ticket: https://www.virtualbox.org/ticket/20180

Feel free to comment on it with your findings on the matter.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by fth0 »

I've commented on 20180, and also put a question at the end trying to provoke a reaction. ;)

In the meantime, I've experimented a little bit with Windows system crash dumps, and I was able to analyze a (totally different) crash that I provoked myself. If you like, the both of us could try to get one step further, but no promises. Do the following:

In the VM configuration, add a shared folder to enable copying files from the guest to the host later on. Start the VM from its virtual hard disk (not from the ISO file), and let it run for a few hours, so that it has enough time to crash a few times. In the VirtualBox Manager, you can look at the VBox.log file while the VM is running (don't forget to manually refresh the view when keeping it open ;)). Depending on the Windows guest's configuration, you'll find several minidump files in C:\Windows\Minidump, or one file named C:\Windows\MEMORY.DMP, or both. Copy those files to the host, and provide the (zipped) VBox.log file and at least one of the mini dump files, preferably from a STATUS_DATATYPE_MISALIGNMENT exception.
Lean_geek
Posts: 44
Joined: 14. Apr 2018, 22:25

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by Lean_geek »

As the same code running on different cpu/ host causes no error, it can be assumed that kernel or something running in kernel mode causes Alignment Fault. By default this fault is masked in x86 or x64. Somehow it gets unmasked.

So can you give a list of register values
1. After the crash (from windows dump/ attached windbg)
2. When guest is running normally.
3. In conditions when this exception doesn't happen. (linux guest, different host kernel).
4. If possible (someone else) running on amd or another intel cpu, the same windows 10 iso on 5.8 or newer kernel.

And of host control registers running older and newer kernel (provided old kernel doesn't cause the fault). (Not that important)


The primary suspect can be something (kernel or virtualbox) is doing something funny with cr0 AM bit.
Also a test could be permanently enable cr0 AM using some fake driver and run it on hardware/ kvm, to see if windows 10 causing Alignment Fault independent of vbox.
hottobar
Posts: 28
Joined: 4. Feb 2021, 11:56

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by hottobar »

fth0 wrote:Start the VM from its virtual hard disk (not from the ISO file), and let it run for a few hours, so that it has enough time to crash a few times. Depending on the Windows guest's configuration, you'll find several minidump files in C:\Windows\Minidump, or one file named C:\Windows\MEMORY.DMP, or both. Copy those files to the host, and provide the (zipped) VBox.log file and at least one of the mini dump files, preferably from a STATUS_DATATYPE_MISALIGNMENT exception.
I didn't find any Minidump, only a MEMORY.DMP file.

I'll attach the logfile of this test that has many exceptions (the VM rebooted various times), the dump file is here: https://drive.google.com/file/d/1IuHQNp ... sp=sharing

The memory dump has been copied from the VM just after the first misalignment exception.
Attachments
VBox_long_test.log.zip
(32.15 KiB) Downloaded 13 times
Lean_geek
Posts: 44
Joined: 14. Apr 2018, 22:25

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by Lean_geek »

I am not very familiar with memory dump, so not sure how or if control registers are visible. On your host and a linux guest (live would work), you can use the code in following answer to see the crX. On running windows you can use similar approach to create such a driver, though you need specialized build environment. On crashed windows windbg maybe best suited if memory dump doesn't help. @fth0 can you check that?

https://stackoverflow.com/questions/741 ... g-segmenta
hottobar
Posts: 28
Joined: 4. Feb 2021, 11:56

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by hottobar »

Lean_geek wrote:On your host ... you can use the code in following answer to see the crX
https://stackoverflow.com/questions/741 ... g-segmenta
I've used the linked code (only slighlty modified for better output) to read cr0 on two hosts, same VM.
Don't know if of any use tho:

Host Intel i5-1135G7 linux 5.9.16

Code: Select all

before Win10 VM start:
cr0 = 0x0000000080050033 AM
Win10 VM running:
cr0 = 0x0000000080050033 AM
after Win10 guest misalignment crash:
cr0 = 0x0000000080050033 AM
The "after misalignment crash" value is just after I realized the VM crashed and proceeded to read the value, so again not sure if relevant. Other automated and more precise methods would probably be better.

Host AMD R9 3900X linux 5.8.18

Code: Select all

before Win10 VM start:
cr0 = 0xFFFFFB5B80050033 AM
Win10 VM running:
cr0 = 0xFFFFFB5B80050033 AM
I can run this code on a Linux guest VM on both hosts to manually read the cr0 value if useful.

I can code in C and move around Linux quite easily but for any specific Windows tests I need guidance as I don't know what to do.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by fth0 »

hottobar wrote:Don't know if of any use tho:
I don't need this information. The STATUS_DATATYPE_MISALIGNMENT is (also?) a software-defined exception, and I think the Windows kernel will raise this exception without the AM bit set in CR0 (e.g. from within ProbeForRead/ProbeForWrite).
Jack.Wang
Posts: 4
Joined: 15. Feb 2021, 13:19

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by Jack.Wang »

I had almost the same problem,My host is Ubuntu 20.04 LTS,kernel 5.8.0-43, virtualbox 6.1.18, CPU i5-1135G7, UEFI secure boot disabled
Guest OS: Windows 10 (64-bit)
Memory size 4096MB
Page Fusion: disabled
VRAM size: 128MB
CPU exec cap: 100%
HPET: disabled
CPUProfile: host
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
PAE: enabled
Long Mode: enabled
Triple Fault Reset: disabled
APIC: enabled
X2APIC: disabled
Nested VT-x/AMD-V: disabled
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode: message and menu
ACPI: enabled
IOAPIC: enabled
BIOS APIC mode: APIC
Time offset: 0ms
RTC: local time
Hardware Virtualization: enabled
Nested Paging: enabled
Large Pages: disabled
VT-x VPID: enabled
VT-x Unrestricted Exec.: enabled
Paravirt. Provider: Default
Effective Paravirt. Prov.: HyperV
Graphics Controller: VBoxSVGA
Monitor count: 1
3D Acceleration: disabled
2D Video Acceleration: disabled
Teleporter Enabled: disabled
Tracing Enabled: disabled
Allow Tracing to Access VM: disabled
Tracing Configuration:
Autostart Enabled: disabled

About dozens of minutes,the following log will appear

02:16:31.737989 GIM: HyperV: Guest indicates a fatal condition! P0=0x1e P1=0xffffffff80000002 P2=0xfffff801208e4793 P3=0xffffb203b7d1317e P4=0x7010008004002001
02:16:31.738040 GIMHv: BugCheck 1e {ffffffff80000002, fffff801208e4793, ffffb203b7d1317e, 7010008004002001}
02:16:31.738041 KMODE_EXCEPTION_NOT_HANDLED
02:16:31.738042 P1: ffffffff80000002 - exception code - STATUS_DATATYPE_MISALIGNMENT

vbox.log.zip attached,

I've been bothered for days
Attachments
VBox.log.zip
(33.41 KiB) Downloaded 14 times
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by fth0 »

Can you provide one or multiple Minidump files? Depending on the Windows guest's configuration, you'll either find several minidump files in C:\Windows\Minidump\, or one file named C:\Windows\MEMORY.DMP, or both. The files may be too large (even zipped) to add to a forum's post, though.
Jack.Wang
Posts: 4
Joined: 15. Feb 2021, 13:19

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by Jack.Wang »

Here is one C:\windows\Minidump file
Attachments
021521-6078-01.dmp.zip
(72.99 KiB) Downloaded 14 times
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by fth0 »

As far as I could analyze the crash dumps so far, they both exhibit strange backtraces. In the middle, there is the STATUS_DATATYPE_MISALIGNMENT exception. In the mini dump from Jack.Wang, a second exception occurred during the exception handling of the STATUS_DATATYPE_MISALIGNMENT exception. Both crash dumps show different histories of stack frames with several unnamed kernel functions, and some functions with public names are functions which are known to be part of obfuscated Windows security features (e.g. PatchGuard, Page Guard, Application Guard) with deliberately misleading function names. So either one of these Windows security features detected a bad situation, or parts of the content of Windows kernel memory were severely damaged, or both.

@hottobar, @Jack.Wang:
Since the crash dumps are so ambiguous, may I ask you both for at least two more examples for comparison?
Jack.Wang
Posts: 4
Joined: 15. Feb 2021, 13:19

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by Jack.Wang »

Thanks a lot for your analysis and reply, here another C:\Windows/Minidump file
Attachments
021521-6125-01.dmp.zip
(80.29 KiB) Downloaded 12 times
Jack.Wang
Posts: 4
Joined: 15. Feb 2021, 13:19

Re: Ubuntu 20.04 host, Win 10 guest constant reboot (STATUS_DATATYPE_MISALIGNMENT)

Post by Jack.Wang »

And another C:\Windows\Minidump file, Thanks
Attachments
021521-6000-01.dmp.zip
(62.32 KiB) Downloaded 14 times
Post Reply