﻿id	summary	reporter	owner	description	type	status	component	version	resolution	keywords	cc	guest	host
13105	VirtualBox crash on bad sectors with rawvmdk	Mr_KrzYch00		"VirtualBox crashes when using rawdisk with bad sectors.

How to reproduce:

1. Take some Hard Disk with unrecoverable bad sectors (in my case it was connected with USB->ATA adapter),
2. Go to compmgmt.msc and make it offline (or diskpart) so windows won't try to access it while it's being mapped in VirtualBox. Also note down disk number,
3. Run CMD as Admin and then run this command: VBoxManage internalcommands createrawvmdk -filename c:\rawdisk.vmdk -rawdisk \ \.\PhysicalDrive2 ,
4. Run VirtualBox as Admin and add raw vmdk file as SATA 1 port,
5. Run Virtual Machine (in my case it was CentOS 6.5 x86 and x64 minimal with Desktop group installed),
6. Run terminal and then run this command: dd if=/dev/sdb conv=notrunc,noerror,sync | pv -cN RAW_HDD | lz4 -1 | pv -cN LZ4_IMAGE_FILE >image.img.lz4 ,
7. VirtualBox Manager will display Windows' crash window when trying to read bad, unrecoverable sector. After closing it, running VirtualMachine(s?) window closes as well. Before closing it VirtualMachine(s?) is hanged.

What settings were used for my VM:[[br]]
512MB and 3,5GB RAM (doesn't matter)[[br]]
Enable I/O APIC turned ON[[br]]
2 Threads shared[[br]]
Both Virtualization accelerations ON[[br]]
64MB display memory (no ACC)[[br]]
IDE for CD and SATA for HDD storage with Cache turned OFF (Centos Image and rawdisk access VMDK there)[[br]]
Extensions removed and USB controller turned OFF (did it just in case but still crashed)[[br]][[br]]

Host running Windows 8.1 x64 standard edition for notebooks.

Expected results:
- VirtualBox SHOULD NOT crash, it should pass bad sectors 1:1 to DD running in Linux Guest - if possible.
- In worst case senario it should display some error message and let You safely close Virtual Machine (some exception in the code?).

Additional information:
- This didn't happen when CentOS 6.5 32bit was running from pendrive (moved VM to pendrive) and HDD was connected to IDE/ATA port on desktop computer,
- The disk was shared with similar command from /dev/sdb,
- Hiren Boot CD was run in virualbox to access it and it performed defragmentation on whole HDD (22GB first partition, bad sectors are around ~7.38GB so it most likely damaged some data)
- VirtualBox didn't crash on Linux (CentOS) Host and no errors were reported, though I'M NOT SURE if bad sectors were not actually marked as bad and skipped since it operated on File System, not RAW LBA layer.

HDD Raw Copy Tool 1.10 Disk Read Log to confirm damaged HDD (it didn't crash, nor did adapter, it could read correctly till the end sector just with 3 offset error messages):[[br]]
2014-06-07 16:41:39   Locking device...[[br]] 
2014-06-07 16:41:39   Copying... [[br]]
2014-06-07 16:45:54   Read Error occurred at offset 7,922,974,720;  LBA 15,474,560   (Uncorrectable error)[[br]]
2014-06-07 16:46:05   Read Error occurred at offset 7,927,169,024;  LBA 15,482,752   (Uncorrectable error)[[br]]
2014-06-07 16:46:16   Read Error occurred at offset 7,956,529,152;  LBA 15,540,096   (Uncorrectable error)[[br]]
2014-06-07 18:03:44   Average speed: 32,5 MB/s[[br]]
2014-06-07 18:03:44   Task complete.[[br]]


Error details:[[br]][[br]]
Problem signature:
  Problem Event Name:	APPCRASH[[br]]
  Application Name:	VirtualBox.exe[[br]]
  Application Version:	4.3.12.0[[br]]
  Application Timestamp:	5375fea0[[br]]
  Fault Module Name:	VBoxDD.DLL[[br]]
  Fault Module Version:	0.0.0.0[[br]]
  Fault Module Timestamp:	5375fedb[[br]]
  Exception Code:	80000003[[br]]
  Exception Offset:	00000000000ba126[[br]]
  OS Version:	6.3.9600.2.0.0.768.101[[br]]
  Locale ID:	1045[[br]]
  Additional Information 1:	d751[[br]]
  Additional Information 2:	d751c23540855ee8a6f140c0aac1ee43[[br]]
  Additional Information 3:	b74a[[br]]
  Additional Information 4:	b74a7ae81f0afc902387134e3279c8f1[[br]]"	defect	closed	other	VirtualBox 4.3.12	fixed			Linux	Windows
