[vbox-dev] How to use GNU debugger on VBoxSVC ?

Frank Mehnert frank.mehnert at oracle.com
Mon May 11 12:17:46 GMT 2015


Hi,

On Monday 11 May 2015 15:00:10 Alexey Eromenko wrote:
> *Thanks for answer, Frank.*
> *Still doesn't work.*
> 
> Compiler options: (hardened build + debug symbols)
> './configure --disable-libvpx --build-debug'
> 
> Then I built a package & installed it:
> $ source $(pwd)/env.sh && kmk && kmk packing
> 
> Started debugger with user:
> $ gdb /opt/VirtualBox/VirtualBox
> ...
> (gdb) run
> Starting program: /opt/VirtualBox/VirtualBox
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> VirtualBox: Error -10 in SUPR3HardenedMain!
> VirtualBox: Effective UID is not root (euid=1000 egid=1000 uid=1000
> gid=1000)

you didn't mention that you are trying to use a hardened build.
For debugging please use a non-hardened build.

> VirtualBox: Tip! It may help to reinstall VirtualBox.
> [Inferior 1 (process 9763) exited with code 01]
> (gdb) LOG_GROUP_MM='MM_HEAP' expects 'MM'
> (gdb)

No idea where this comes from. Do you have any VBOX_* environment
variables set?

> *1. Does it mean, that I cannot debug a Hardened VirtualBox with normal
> user (non-root) ?2. I tried to start GDB with "root". It seems
> "VBOX_ASSERT=none" doesn't work.*

Of course you cannot debug a hardened build as normal user. Can you
guess what the hardening is supposed to be for? :-)

> root at debian7vm:~# export VBOX_ASSERT=none
> root at debian7vm:~# gdb /opt/VirtualBox/VBoxSVC
> (gdb) run
> ...
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x00007ffff758674b in RTLogDefaultInit ()
>     at
> /home/user/VirtualBox-5.0.0_BETA2/src/VBox/Runtime/VBox/log-vbox.cpp:261
> 261         ASSERT_LOG_GROUP(MM);
> (gdb)
> 
> Basically "VBOX_ASSERT=none" didn't help.
> I did about 30 times "c".
> So how to skip asserts again ?

See above.

When debugging a non-hardened build, don't install the build but just
run it from the out..../bin directory.

Frank
-- 
Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher




More information about the vbox-dev mailing list