Subject: Re: bug#70760: 29.3.50; core dumps when copy in other apps

From: Michael Albinus <[email-masked]>
Date: Wed, 15 May 2024 12:35:19 +0200

Eli Zaretskii <[email-masked]> writes:

Hi,

> We have already established that some invalid D-Bus events cause these
> problems.  What we need now is to find out what kind of D-Bus events
> are those, and what does VirtualBox mean to happen when it emits these
> D-Bus events?
>
> Looking at dbus-check-event, I see that event of the form
>
>   (dbus-event 10 14)
>
> is invalid because the first member of the list after 'dbus-event'
> should be either a keyword (a symbol, AFAIU) or a string, but here we
> have a number.
>
> The event
>
>   (dbus-event "[ \11]*$")
>
> from your previous message is also invalid, since it has only one
> member after 'dbus-event'.
>
> IOW, VirtualBox is emitting invalid D-Bus events, at least as far as
> our support for D-Bus is concerned.
>
> Michael, are these events invalid according to the D-Bus spec, or we
> just lack support for them in Emacs?  If the former, I don't see how
> this can be an Emacs problem; you should ask the VirtualBox folks what
> to do to avoid this.

These aren't valid D-Bus events according to the spec, and I doubt that
they come from D-Bus itself. But let's instrument Emacs in order to see
which D-Bus events flow around. The following recipe:

--8<---------------cut here---------------start------------->8---
# rm src/dbusbind.o
# make MYCPPFLAGS='-DDBUS_DEBUG'
# src/emacs --eval '(setq dbus-debug t message-log-max t)'
--8<---------------cut here---------------end--------------->8---

Then trigger the problem, and send us the *Messages* buffer afterwards.
Recompile Emacs w/o the MYCPPFLAGS arg.

> Maybe we can make Emacs more tolerant to these issues, e.g., make the
> error a warning or a message?

Maybe. But my gut feeling tells me there is an error in Emacs handling
incoming event. And this isn't related to D-Bus, necessarily.

> All in all, I feel like this is not an Emacs issue at all, and should
> not be brought to us.

Maybe. But I'd like to see the D-Bus events first.

Best regards, Michael.