Subject: bug#45277: D-Bus crashes and DND errors

From: Juri Linkov <[email-masked]>
Date: Sat, 19 Dec 2020 22:23:10 +0200

>> Meanwhile, here is today's error (not crash):
>>
>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>>   dbus-handle-event((dbus-event (- arg)))
>>   funcall-interactively(dbus-handle-event (dbus-event (- arg)))
>>   call-interactively(dbus-handle-event nil [(dbus-event (- arg))])
>>   command-execute(dbus-handle-event nil [(dbus-event (- arg))] t)
>
> I'm completely lost. Where does this interactive call of
> dbus-handle-event comes from? And where those strange arguments? Well,
> there's a wannabe D-Bus event "(dbus-event (- arg))", but I have no
> idea how it is composed.

I don't know, it seems xd_retrieve_arg tries to decode received data,
but when it receives garbage, then "Garbage In - Garbage Out".

> Do you have a recipe how to provoke this error? Or could you bisect
> Emacs git in order to find the change which has introduced the problem?

These errors appear at the rate of one error per day,
so no bisecting is possible in a reasonable time.
Today dbus-handle-event signaled the error with
a string of 6 random bytes, and not crashed, but
I forgot to look at traces, so no luck this time.