Bug 248333

Summary: emulators/virtualbox-ose: Crashes when VM access physical CD/DVD
Product: Ports & Packages Reporter: mfv
Component: Individual Port(s)Assignee: Ganael LAPLANCHE <martymac>
Status: Closed FIXED    
Severity: Affects Some People CC: martymac, mfv, vbox
Priority: --- Flags: bugzilla: maintainer-feedback? (vbox)
koobs: merge-quarterly?
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Patch to drvHostBaseScsiCmdOs() koobs: maintainer-approval+

Description mfv 2020-07-28 16:21:09 UTC

    
Comment 1 mfv 2020-07-28 16:25:21 UTC
I have been using WindowsXP with SP3 as a guest within VirtualBox on a FreeBSD host for many years.  However, after not using VB for some time I discovered that it no longer had audio nor did it have access to the CD/DVD. Audio and CD/DVD access works on FreeBSD (RELEASE 12.1p6) in native mode.  The current version of VB is 5.2.44.

It is possible to attach the DVD to the VM but when starting the VM it
crashes and gives the following Result Code: NS_ERROR_FAILURE (0x80004005)

I have doubled checked the permissions as specified in the installation
message as well as the FreeBSD Handbook.

I have also searched the web for a solution but have not found anything that
works.  The very same issue was recorded on Nov 2018 against ticket
number18211 on the VirtualBox website.  Their response was to state that
"FreeBSD in not an officially supported host.  Please report this to the
FreeBSD port maintainers".  That user's version of VirtualBox was v5.2.22.

Any help would be greatly appreciated.

Marek
Comment 2 Ganael LAPLANCHE freebsd_committer freebsd_triage 2020-09-18 10:33:58 UTC
Created attachment 218049 [details]
Patch to drvHostBaseScsiCmdOs()

Hello Marek,

Thanks for submitting this PR.

I could reproduce the problem.

It seems that VirtualBox randomly crashes when returning from src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp:drvHostBaseScsiCmdOs().

The attached patch fixed the problem for me. Can you try it and tell me if it works for you (just copy it to the files/ directory of the port and rebuild it) ?

This bug has probably been introduced after upstream SVN rev 64316.

Best regards,

Ganael.
Comment 3 mfv 2020-09-18 20:54:17 UTC
Hello Ganael,

Bingo! The patch works.

However, after attaching the drive to the VM, the 'passthrough' feature must be disabled.  After that the CD/DVD works as it should.

Many thanks for the patch.  Will it be added to the ports tree?  I update my ports by using pkg and I had to suck in a large number of ports, even gcc, as part of the tool chain, and would like to remove them from my system if possible.

Many thanks for identifying this bug.

Marek
Comment 4 Ganael LAPLANCHE freebsd_committer freebsd_triage 2020-09-19 08:28:36 UTC
Hello Marek,

Good news! Thanks for your feedback.

I can commit the patch but I would like a maintainer approval to do so (from Vbox team: vbox@FreeBSD.org).

Stay tuned :)

Best regards,

Ganael.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2020-09-20 13:26:54 UTC
Comment on attachment 218049 [details]
Patch to drvHostBaseScsiCmdOs()

Approved by: koobs (vbox)

If it passes QA (poudriere)
Comment 6 commit-hook freebsd_committer freebsd_triage 2020-09-21 10:33:09 UTC
A commit references this bug:

Author: martymac
Date: Mon Sep 21 10:32:30 UTC 2020
New revision: 549433
URL: https://svnweb.freebsd.org/changeset/ports/549433

Log:
  Fix crash when accessing physical CD/DVD

  PR:		248333
  Reported by:	mfv@bway.net
  Approved by:	koobs (vbox)
  MFH:		2020Q3

Changes:
  head/emulators/virtualbox-ose/Makefile
  head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostBase-freebsd.cpp
Comment 7 Ganael LAPLANCHE freebsd_committer freebsd_triage 2020-09-21 10:33:54 UTC
Patch committed, thanks!

Ganael.
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-09-21 15:51:08 UTC
A commit references this bug:

Author: martymac
Date: Mon Sep 21 15:50:30 UTC 2020
New revision: 549453
URL: https://svnweb.freebsd.org/changeset/ports/549453

Log:
  MFH: r549433

  Fix crash when accessing physical CD/DVD

  PR:		248333
  Reported by:	mfv@bway.net
  Approved by:	koobs (vbox)

  Approved by:	ports-secteam (fluffy)

Changes:
_U  branches/2020Q3/
  branches/2020Q3/emulators/virtualbox-ose/Makefile
  branches/2020Q3/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostBase-freebsd.cpp