VirtualBox

Ticket #12994 (closed defect: fixed)

Opened 15 months ago

Last modified 14 months ago

VBoxService segfault on guest control -- strcmp()

Reported by: vekt Owned by:
Priority: major Component: guest additions
Version: VirtualBox 4.3.10 Keywords: VBoxService, segfault
Cc: Guest type: Linux
Host type: Linux

Description

VBoxService segfaults when the host attempts any form of guest control (execute, copyto, etc).

On the host

  $ vboxmanage guestcontrol kvm32 exec "/bin/echo" --username "tc" --password "" --verbose --args "srp"
  Opening guest session as user 'tc' ...
  Waiting for guest session to start ...
  VBoxManage: error: Error starting guest session (current status is: starting)
  Closing guest session ...

See attached vboxservice.log for the guest's VBoxService's pre-segfault log.

VBoxService gdb backtrace

...
00:00:00.006717 control  Waiting for host msg ...
00:00:13.396728 control  Msg=20 (6 parms) retrieved
00:00:13.396969 control  Client ID=101 now is using protocol 2
00:00:13.397102 control  Forking new guest session ID=10, szUser=tc, szPassword=XXX, szDomain=, uFlags=0, using protocol 2
00:00:13.397183 control  Forking parameters:
00:00:13.397247 control         /opt/VBoxGuestAdditions-4.3.10/sbin/VBoxService
00:00:13.397357 control         guestsession
00:00:13.397461 control         --session-id=10
00:00:13.397668 control         --session-proto=2
00:00:13.397713 control         --user=tc
00:00:13.397772 control         -vvvv
[New LWP 21396]

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 21396]
0xb7e9eb84 in strcmp () from /lib/libc.so.6
(gdb) bt
#0  0xb7e9eb84 in strcmp () from /lib/libc.so.6
#1  0x0805b41a in ?? ()
#2  0x0805b6b5 in ?? ()
#3  0x0805581c in ?? ()
#4  0x08050995 in ?? ()
#5  0x0805088c in ?? ()
#6  0x0804be8c in ?? ()
#7  0x08071a42 in ?? ()
#8  0x0805ae40 in ?? ()
#9  0xb7f9a6a4 in ?? () from /lib/libpthread.so.0
#10 0xb7ee649e in clone () from /lib/libc.so.6
(gdb) 

Ubuntu x64 host, TinyCore x86 guest, VirtualBox v4.3.10. Guest additions were installed via the iso's VBoxLinuxAdditions.run.

How can I be of further help?

Attachments

vboxservice.log Download (13.1 KB) - added by vekt 15 months ago.
VBoxService pre-segfault log
VBoxService.log Download (19.6 KB) - added by vekt 14 months ago.
VBoxService-coredump.gz Download (87.8 KB) - added by vekt 14 months ago.
VBoxService core dump.
VBoxLinuxAdditions.log Download (5.5 KB) - added by vekt 14 months ago.
vboxservce-termination-bug.log Download (2.4 KB) - added by vekt 14 months ago.
VBoxService log -- guest process termination bug.

Change History

Changed 15 months ago by vekt

VBoxService pre-segfault log

comment:1 Changed 14 months ago by pentagonik

Could you please run VBoxService on the guest in verbose logging mode and attach the new log here?

To start VBoxService in debug mode with verbose logging on a Linux guest (Debian-based, like Ubuntu etc):

Login as root, open a terminal window and do: # /etc/init.d/vboxadd-service stop Edit the file "/etc/init.d/vboxadd-service" by changing the line "daemon $binary > /dev/null" to "daemon $binary "-vvvv --logfile /var/log/VBoxService.log" > /dev/null" and save the file afterwards.

Then either the system needs to rebooted or VBoxService needs to be started again by doing a # /etc/init.d/vboxadd-service start

This will start VBoxService in background, logging to /var/log/VBoxService.log. After the issue appeared again, please provide the logfile located in /var/log/VBoxService.log on the guest. Thanks!

Changed 14 months ago by vekt

comment:2 Changed 14 months ago by vekt

@pentagonik Full log with -vvvv attached as VBoxService.log.

The old, original log is 'vboxservice.log' (all lowercase).

How else can I help?

Last edited 14 months ago by vekt (previous) (diff)

comment:3 Changed 14 months ago by frank

Actually can you provide a core dump for VBoxService? To achieve this, make sure to stop VBoxService, then start the service manually in a terminal like this

ulimit -c unlimited
/usr/sbin/VBoxService -fvvvv

After VBoxService crashed, there should be a core dump in the current directory. If so, please compress and attach it to this ticket or write me an email at frank _dot_ mehnert _at_ oracle _dot_ com.

Changed 14 months ago by vekt

VBoxService core dump.

comment:4 Changed 14 months ago by vekt

@frank VBoxService-coredump.gz attached to this ticket and emailed.

What else can I help with?

comment:5 Changed 14 months ago by frank

I wonder how you managed to install the VBox Guest Additions to TinyCore Linux. I tried but I was not successful when compiling the kernel modules (some strange Makefile problems with the kernel headers). Can you provide instructions which "apps" you installed in the guest to successfully execute VBoxLinuxAdditions.run?

I was able to analyze your core dump and it turns out the reason for the VBoxService crash is that the guest user does not have a password set.

I think we fixed the problem. Please could you install the Additions from this image and confirm that the problem is fixed? Thank you!

comment:6 Changed 14 months ago by vekt

I tried but I was not successful when compiling the kernel modules (some strange Makefile problems with the kernel headers).

It's a two step process that took me a bit to figure out, too. TinyCore's patched kernel headers are hosted separately and installed by a script called 'linux-kernel-sources-env.sh', which is itself in the package 'linux-kernel-sources-env'. This one-two punch is required

$ tce-load -iw linux-kernel-sources-env
$ linux-kernel-sources-env.sh

Can you provide instructions which "apps" you installed in the guest to successfully execute VBoxLinuxAdditions.run?

From a freshly booted Core (not TinyCore, which has Xvesa)

$ tce-load -iw mirrors
$ tcemirror.sh # Choose the best mirror.
$ tce-load -iw Xorg-7.7 Xprogs Xlibs compiletc graphics-3.8.13-tinycore linux-kernel-sources-env dbus
$ linux-kernel-sources-env.sh
$ /usr/local/etc/init.d/dbus start
$ mount /mnt/sr0
$ sudo /mnt/src0/VBoxLinuxAdditions.run

VBoxLinuxAdditions.run fails at 'Installing graphics libraries and desktop services components...', but VBoxService can be started without problem and the VBoxClient variants can be run once a window manager has been installed and X started (tce-load -iw flwm aterm; startx; VBoxClient-all).

I was able to analyze your core dump and it turns out the reason for the VBoxService crash is that the guest user does not have a password set.

Interesting. Indeed, VBoxService doesn't segfault if the guest user has a password. Great to know.

I think we fixed the problem. Please could you install the Additions from this image and confirm that the problem is fixed?

VBoxService from VBoxGuestAdditions_4.3.11-93549.iso no longer segfaults if the guest user doesn't have a password, but exec fails on the host with 'Invalid user/password credentials'.

$ vboxmanage guestcontrol kvm32 exec "/bin/echo" --username "tc" --password "" --verbose --wait-stdout -- "srp"
Opening guest session as user 'tc' ...
Waiting for guest session to start ...
VBoxManage: error: Invalid user/password credentials
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestSession, interface IGuestSession, callee nsISupports
VBoxManage: error: Context: "WaitForArray(ComSafeArrayAsInParam(aSessionWaitFlags), 30 * 1000, &sessionWaitResult)" at line 998 of file VBoxManageGuestCtrl.cpp
Closing guest session ...

VBoxService from VBoxGuestAdditions_4.3.11-93549.iso also works if the guest user has a password -- no segfault and the command executes properly.

Progress. Now the last piece is for VBoxService to handle empty passwords without an authentication error.

Thank you for your continued, expeditious help. How else can I help?

Last edited 14 months ago by vekt (previous) (diff)

comment:7 Changed 14 months ago by frank

Thank you for these instructions but I'm still unable to compile the VBox kernel modules on TinyCore. I've booted and installed the bigger CorePlus .iso image and followed your instructions but when I try to compile vboxguest etc I get

grep: /lib/modules/3.8.13-tinycore/build/include/linux/version.h: No such file or directory
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/3.8.13-tinycore/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
Makefile:578: /usr/src/linux-3.8.13/arch/x86/Makefile: No such file or directory
make[1]: *** No rule to make target `/usr/src/linux-3.8.13/arch/x86/Makefile'.  Stop.
make: *** [vboxguest] Error 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.

The missing version.h is not fatal but the missing arch/x86/Makefile is and this looks like some missing files in the tinycore Linux kernel package.

Any idea what's the difference between our setups?

comment:8 Changed 14 months ago by vekt

Any idea what's the difference between our setups?

I'm afraid not.

From a freshly booted Core 5.3 (not CorePlus, but  http://distro.ibiblio.org/tinycorelinux/5.x/x86/release/Core-5.3.iso), when I run the aforementioned

$ tce-load -iw mirrors
$ tcemirror.sh # Choose the best mirror.
$ tce-load -iw Xorg-7.7 Xprogs Xlibs compiletc graphics-3.8.13-tinycore linux-kernel-sources-env dbus
$ linux-kernel-sources-env.sh
$ /usr/local/etc/init.d/dbus start
$ mount /mnt/sr0
$ sudo /mnt/src0/VBoxLinuxAdditions.run

the output of VBoxLinuxAdditions.run is the newly attached VBoxLinuxAdditions.log. Can you reproduce this behavior if you boot Core 5.3 and follow the above instructions?

As mentioned previously, VBoxLinuxAdditions.run fails at

Installing graphics libraries and desktop services components ...fail!

but the kernel modules are loaded, devices created in /dev/, and VBoxService can be started without issue.

If helpful, I'm happy to upload VM snapshots taken before and after VBoxLinuxAdditions.run is run.

Changed 14 months ago by vekt

comment:9 Changed 14 months ago by vekt

I just noticed that the attached VBoxLinuxAdditions.log

has VBoxLinuxAdditions.run's output pasted twice. Ignore the second duplication, lines 57+.

comment:10 Changed 14 months ago by frank

Thanks. I found the reason for my problem. I installed TinyCore Linux to the hard disk and was assuming that after a reboot, the hard disk is mounted as rootfs but actually that's not the case. After increasing the VM memory from 512MB to 832MB I was able to install the kernel sources and to compile the kernel modules. I think I found the final problem with empty password. Could you test if this image works for you?

comment:11 Changed 14 months ago by frank

I think we finally also fixed the VERR_INTERRUPTED problem you saw. The fix is included in this build (fix in VBoxService).

Changed 14 months ago by vekt

VBoxService log -- guest process termination bug.

comment:12 Changed 14 months ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Fix is part of VBox 4.3.12. Please upgrade the Guest Additions to 4.3.12. For different problems, please open a separate ticket.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use