VirtualBox

Opened 4 years ago

#19672 new defect

Single step emulation bug

Reported by: B-O Owned by:
Component: other Version: VirtualBox 6.1.10
Keywords: Cc:
Guest type: all Host type: Mac OS X

Description

Single stepping code in a guest VM doesn't work correctly with I/O instructions.

I first noticed the problem in the built in kernel debugger in my OS. By further examination I also noted that the problem could be reproduced in Windows XP with both the 16-bit command line debugger and an a free 32-bit version of the same. Thus the problem is general.

The problem was detected with single stepping the out instruction. The instruction following the out instruction will also be single stepped, causing the guest VMs exception #1 to point to the wrong instruction.

out 80,al call Foo

will point to first instruction in Foo instead of the call Foo line.

As RDTSC instruction has been fixed in a similar situation, I assume you have not applied the fix on all privileged instructions like IN, OUT, INT nn etc. The VM emulator should check the TF flag in the instruction emulator and emulate exception #1 in addition if it's set.

I have included the VBOXBUG.COM file that reproduce the problem in Windows XP debug command.

debug VBOXBUG.COM will load the program.

Write U for disassembling and you see what it does. For every out instruction we trace into the subroutine that is called after the OUT instruction instead of stopping at the CALL instruction following it.

You use the T (TRACE INTO)command for single stepping. Perhaps P (TRACE OVER) generates the same problem.

Best regards,

B-O Bergman PQURE Technology

Attachments (2)

VBOXBUG.COM (32 bytes ) - added by B-O 4 years ago.
application for reproducing bug
VBOXBUG.2.COM (32 bytes ) - added by B-O 4 years ago.
application for reproducing bug

Download all attachments as: .zip

Change History (2)

by B-O, 4 years ago

Attachment: VBOXBUG.COM added

application for reproducing bug

by B-O, 4 years ago

Attachment: VBOXBUG.2.COM added

application for reproducing bug

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use