Subject: Re: bug#45277: SELECTION_CLEAR_EVENT crashes

From: Juri Linkov <[email-masked]>
Date: Tue, 13 Jul 2021 23:49:19 +0300

>> I have exactly the same crashes on completely different computers.
>> What surprises me is that no one else has these crashes.
>
> OK, then it can hardly be a hardware issue.  I can't recall seeing any
> other bug reports (from others) in this area, though, so it does seem
> like nobody else experiences these problems.

It seems these crashes are GC-related.  They started to appear after Sep 2020.
And after recent GC-related changes there are no more crashes, but after
every screen lock/unlock, a produced DBUS event causes random errors.
Here are some examples:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p ("\\.makepp\\'" . makefile-makepp-mode))
  dbus-handle-event((dbus-event ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode) ...))
  funcall-interactively(dbus-handle-event (dbus-event ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode) ...))
  call-interactively(dbus-handle-event nil [(dbus-event ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode) ...)])
  command-execute(dbus-handle-event nil [(dbus-event ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode) ...)] t)

Debugger entered--Lisp error: (wrong-type-argument listp "Monospace 10")
  dbus-check-event((dbus-event :user-spec . "Monospace 10"))
  dbus-handle-event((dbus-event :user-spec . "Monospace 10"))
  funcall-interactively(dbus-handle-event (dbus-event :user-spec . "Monospace 10"))
  call-interactively(dbus-handle-event nil [(dbus-event :user-spec . "Monospace 10")])
  command-execute(dbus-handle-event nil [(dbus-event :user-spec . "Monospace 10")] t)

Debugger entered--Lisp error: (wrong-type-argument listp "#ffffffffffff")
  dbus-handle-event((dbus-event background-color . "#ffffffffffff"))
  funcall-interactively(dbus-handle-event (dbus-event background-color . "#ffffffffffff"))
  call-interactively(dbus-handle-event nil [(dbus-event background-color . "#ffffffffffff")])
  command-execute(dbus-handle-event nil [(dbus-event background-color . "#ffffffffffff")] t)

The last error contains part of (frame-parameter nil 'background-color) => "#ffffffffffff"

And after doing 'M-x garbage-collect' there are no more errors on screen lock/unlock.

Maybe GC-related changes didn't cause these errors, but just changed the behavior
of some memory leak in DBUS-related code?