I am not sure how VirtualBox deals with Ctrl-C on the Windows side. I will look into it when I have time.

I did more tests. Observations:

1) It *appears* that the problem is there only when I have a shell buffer (M-x shell). I will do more tests and report back.

2) The error messages seem to vary. For example, I saw the following two different ones when copying:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  dbus-handle-event((dbus-event (calendar-cursor-holidays (calendar-current-date))))
  funcall-interactively(dbus-handle-event (dbus-event (calendar-cursor-holidays (calendar-current-date))))
  command-execute(dbus-handle-event nil [(dbus-event (calendar-cursor-holidays (calendar-current-date)))] t)

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  dbus-handle-event((dbus-event (if above 1 2)))
  funcall-interactively(dbus-handle-event (dbus-event (if above 1 2)))
  command-execute(dbus-handle-event nil [(dbus-event (if above 1 2))] t)

On Sun, May 5, 2024 at 9:12 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Kun Liu <kun.liu@gmail.com>
> Date: Sun, 5 May 2024 08:45:34 -0700
> Cc: 70760@debbugs.gnu.org
>
> I did (setq debug-on-error t), went to https://en.wikipedia.org/wiki/Emacs, randomly selected a fragment
> "Emacs has over", then did a ctrll+c.
>
> Emacs in VirtualBox immediately showed the following:
>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>   dbus-handle-event((dbus-event "[ \11]*$"))
>   funcall-interactively(dbus-handle-event (dbus-event "[ \11]*$"))
>   call-interactively(dbus-handle-event nil [(dbus-event "[ \11]*$")])
>   command-execute(dbus-handle-event nil [(dbus-event "[ \11]*$")] t)

Does VirtualBox have anything in its documentation that suggests that
Ctrl-C on the Windows side will cause a D-Bus event on the VM side?

Michael, any idea what is this D-Bus event, and what does it have to
do with copying into the Windows clipboard?

Thanks.