Page 1 of 1

ERROR: std::bad_alloc

Posted: 9. Oct 2015, 17:16
by Pallieter
Possible cause "kernel: warning: `VBoxHeadless' uses 32-bit capabilities (legacy support in use)" - looking for a solution.

Situation: an OVA (OVF 2.0 with manifest) exported on a Windows Server with VB 5.0.6 imports successfully on a minimal CentOS 7 with VB 5.0.6 (Linux server1 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux), but when running (VBoxHeadless --startvm ”<vmName>” --vrde=off), it always gives an error when the guest OS is 64 bit:

Oracle VM VirtualBox Headless Interface 5.0.6
(C) 2008-2015 Oracle Corporation
All rights reserved.

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

THERE iS ONE INTERESTING BIT in: /var/log/messages

Oct 9 16:06:55 server1 kernel: vboxdrv: module verification failed: signature and/or required key missing - tainting kernel
Oct 9 16:06:55 server1 kernel: vboxdrv: TSC mode is Invariant, tentative frequency 2393852264 Hz
Oct 9 16:06:55 server1 kernel: VBoxNetFlt: Successfully started.
Oct 9 16:06:55 server1 kernel: VBoxNetAdp: Successfully started.
Oct 9 16:06:55 server1 kernel: VBoxPciLinuxInit
Oct 9 16:06:55 server1 kernel: vboxpci: IOMMU not found (not registered)
Oct 9 16:32:48 server1 kernel: warning: `VBoxHeadless' uses 32-bit capabilities (legacy support in use)
Oct 9 16:32:48 server1 kernel: SUPR0GipMap: fGetGipCpu=0x3

Here is the server install script used:

yum upgrade
yum install gcc kernel-devel kernel-headers dkms wget
cd /etc/yum.repos.d/
wget downloadvirtualboxorg/virtualbox/rpm/el/virtualbox.repo
yum install VirtualBox-5.0
useradd virtualbox
usermod -G vboxusers virtualbox
reboot
systemctl status vboxdrv
/sbin/rcvboxdrv setup
su virtualbox
mkdir /home/virtualbox/ova
VBoxManage setproperty machinefolder /home/virtualbox/vms
VBoxManage import /home/virtualbox/ova/<vmName>.ova --dry-run
if different settings are needed, rerun till happy
VBoxManage import /home/virtualbox/ova/<vmName>.ova
VBoxManage list bridgedifs
VBoxManage modifyvm "<vmName>" --nic1 bridged --bridgeadapter1 em1
VBoxManage list vms
nohup VBoxHeadless --startvm ”<vmName>” --vrde=off &
VBoxManage list runningvms

The /var/log/vbox-install.log looks fine, except for:

echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it.";

Re: ERROR: std::bad_alloc

Posted: 9. Oct 2015, 17:26
by Perryg
Post the guests log file ( as an attachment ). Right click on the guest in the Main Manager then click show log. Save and post as an attachment. Compress if it is too large to post.

Re: ERROR: std::bad_alloc

Posted: 12. Oct 2015, 10:45
by Pallieter
I am not running the VB in a GUI environment, but the log files (after a clean reboot on a clean system with no VMs on auto-start) are attached. The same OVA works perfectly on a 64 bit Windows 10 VB 5.0.6 host.

On the 64 bit CentoS 7 box:

systemctl status vboxdrv

vboxdrv.service - VirtualBox Linux kernel module
Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled)
Active: active (exited) since Mon 2015-10-12 09:59:16 CEST; 3min 53s ago
Process: 852 ExecStart=/usr/lib/virtualbox/vboxdrv.sh start (code=exited, status=0/SUCCESS)

Oct 12 09:59:14 server1.office.***.com systemd[1]: Starting VirtualBox Linux kernel module...
Oct 12 09:59:16 server1.office.***.com vboxdrv.sh[852]: Starting VirtualBox kernel modules [ OK ]
Oct 12 09:59:16 server1.office.***.com systemd[1]: Started VirtualBox Linux kernel module.

But it does give:

00:00:05.246797 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={Medium '/home/virtualbox/vms/SERPTool/SERPTool-disk1.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false aResultDetail=0
00:00:05.745391 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={0169423f-46b4-cde9-91af-1e9d5b6cd945} aComponent={VirtualBoxWrap} aText={The object is not ready}, preserve=false aResultDetail=0
00:00:10.247604 main {00007ff0f401a2f0} HostPowerServiceLinux::~HostPowerServiceLinux: RTThreadWait() for 5000 ms failed with VERR_TIMEOUT

And in /var/log/messages:

Oct 12 10:37:08 server1 kernel: warning: `VBoxHeadless' uses 32-bit capabilities (legacy support in use)

Re: ERROR: std::bad_alloc

Posted: 12. Oct 2015, 12:51
by mpack
Neither of those are VM logs. But, wherever you found the .vbox file you should also have seen a "Logs" directory, inside which you will find several VM logs. Post the VBox.log file, ignore the others. Compress the file if it's larger than 128K.

Re: ERROR: std::bad_alloc

Posted: 12. Oct 2015, 17:45
by Pallieter
No log files are generated in /home/virtualbox/vms/SERPTool/ there are only the 3 files (vmdk, vbox, vbox-prev).

Update: I installed gnome, ran the GUI for VB and started the same VM, it started without showing that error and ran perfectly fine. When I shut the VM and GUI down and again try to start it with the command:

nohup VBoxHeadless --startvm ”SERPTool” --vrde=off &

it again fails. So the hidden warning (it is in /var/log/messages) that headless only supports 32 bit guest OSs seems to indeed be correct and thus this not a software bug, but a missing feature (or a documentation bug: known limitations).

There are several other postings online that mention this issue, including:

https://bugs.launchpad.net/ubuntu/+sour ... bug/970576

http://unix.stackexchange.com/questions ... ernel-mean

Re: ERROR: std::bad_alloc

Posted: 23. Oct 2015, 16:12
by Pallieter
See https://www.virtualbox.org/ticket/14481 for the associated ticket.

Re: ERROR: std::bad_alloc

Posted: 11. Mar 2016, 15:01
by frank
The message about 32-bit capabilities is just a warning and cannot be the sign for a problem which leads to a std::bad_alloc problem.