Repository navigation
Crash in _clutter_input_device_reset_scroll_info #678
Description
Distribution
Arch
Package version
5.8.4
Graphics hardware in use
Nvidia 1070 Ti
Frequency
Only occasionally
Bug description
I built a new system. Twice (so far), Cinnamon has crashed shortly after login. It's not reliable, but both times were shortly after login, as I was moving the mouse towards the panel.
System log:
Nov 13 15:49:44 dejarik kernel: cinnamon[850]: segfault at e0 ip 00007f8f74aaa3e4 sp 00007fff45020808 error 4 in libmuffin-clutter-0.so.0.0.0[7f8f74a68000+9b000] likely on CPU 7 (core 7, socket 0)
Nov 13 15:49:44 dejarik kernel: Code: 4c 89 70 10 eb ac 48 8d 15 49 a8 06 00 48 8d 35 f2 be 06 00 48 8d 3d 40 8c 05 00 ff 15 75 b4 0a 00 eb be 0f 1f 00 f3 0f 1e fa <48> 8b 87 e0 00 00 00 48 85 c0 74 25 8b 50 08 85 d2 74 1e 48 8b 00
Possibly related comment: #640 (comment)
Can't tell if related top level: #640
Backtrace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 _clutter_input_device_reset_scroll_info (device=device@entry=0x0) at ../muffin-5.8.1/clutter/clutter/clutter-input-device.c:1914
Downloading source file /usr/src/debug/muffin/build/../muffin-5.8.1/clutter/clutter/clutter-input-device.c
1914 if (device->scroll_info == NULL)
[Current thread is 1 (Thread 0x7f8f6fc9efc0 (LWP 850))]
(gdb) bt
#0 _clutter_input_device_reset_scroll_info (device=device@entry=0x0) at ../muffin-5.8.1/clutter/clutter/clutter-input-device.c:1914
#1 0x00007f8f747f7c4c in meta_seat_x11_translate_event (event=0x55ff3dfcbb50, xevent=<optimized out>, seat=<optimized out>)
at ../muffin-5.8.1/src/backends/x11/meta-seat-x11.c:2310
#2 meta_clutter_backend_x11_translate_event (backend=<optimized out>, native=<optimized out>, event=0x55ff3dfcbb50)
at ../muffin-5.8.1/src/backends/x11/meta-clutter-backend-x11.c:98
#3 0x00007f8f7487564b in meta_x11_handle_event.isra.0 (xevent=xevent@entry=0x7fff450209e0) at ../muffin-5.8.1/src/backends/x11/meta-event-x11.c:106
#4 0x00007f8f747f62f2 in handle_host_xevent (event=0x7fff450209e0, backend=0x55ff3d5b2410) at ../muffin-5.8.1/src/backends/x11/meta-backend-x11.c:426
#5 x_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at ../muffin-5.8.1/src/backends/x11/meta-backend-x11.c:479
#6 0x00007f8f74bb2f69 in g_main_dispatch (context=0x55ff3d5af940) at ../glib/glib/gmain.c:3476
#7 0x00007f8f74c11327 in g_main_context_dispatch_unlocked (context=0x55ff3d5af940) at ../glib/glib/gmain.c:4284
#8 g_main_context_iterate_unlocked.isra.0 (context=0x55ff3d5af940, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
#9 0x00007f8f74bb3b97 in g_main_loop_run (loop=0x55ff3dcb0990) at ../glib/glib/gmain.c:4551
#10 0x00007f8f74830579 in meta_run () at ../muffin-5.8.1/src/core/main.c:663
#11 0x000055ff3bfc0566 in main (argc=<optimized out>, argv=<optimized out>) at ../cinnamon-5.8.4/src/main.c:404Core (taken by systemd):
core.cinnamon.1000.9304e690fe9047289fccc8681b4c927d.850.1699908584000000.gz
Steps to reproduce
Log in and move the mouse to the panel?
Expected behavior
Additional information
Arch Linux fully updated 2023-11-23
Intel 9700K
Nvidia 1070 Ti
Gigabyte AORUS FV43U Monitor. Plugged in to the monitor:
- Logitech G502 wireless mouse
- Logitech K295 wireless keyboard
Other devices: LG G535 headset (was not turned on - receiver still plugged in). Supersonic SC-1420SB soundbar (not turned on).
Apps set to start on login: Steam, Discord, Solaar
Cinnamon 5.8.4
Muffin 5.8.1
Activity
chennin commentedon Jan 16, 2024
Still getting the crash in muffin 6.0.1-1. I can semi-regularly reproduce it by rebooting and touching nothing until auto-login completes and Steam/Discord finish starting.
core.cinnamon.1000.e7294ebb2a37412e9ced8c5eb6303994.963.1705436100000000.gz
github-actions commentedon Mar 2, 2026
This issue has been automatically marked as stale because it has not had
any activity in over 2 years.
If this issue is still relevant:
If no activity occurs in the next 30 days, this issue will be
automatically closed. Issues can be reopened if needed.
UweSchneider commentedon Mar 6, 2026
Patch available: NULL guard in _clutter_input_device_reset_scroll_info
This crash is a NULL pointer dereference where
device=0x0is passed to_clutter_input_device_reset_scroll_info. The existing code checksdevice->scroll_info == NULLbut doesn't check ifdeviceitself is NULL.Fix in
clutter/clutter/clutter-input-device.c:void _clutter_input_device_reset_scroll_info (ClutterInputDevice *device) { guint i; + if (device == NULL) + return; + if (device->scroll_info == NULL) return;We've built this as a proper Debian package via
dpkg-buildpackage(muffin 6.6.3) together with fixes for #807 and #769, and it's running stable.giang9910 commentedon Oct 12, 2026
Still happening on Linux Mint 22.3 (Zena), Cinnamon 6.6.9, muffin 6.6.3+zena, Xorg 1.21.1.11 (AMD GPU). Same backtrace (
segfault at e0,meta-seat-x11.c:2310). I dug into the core withmuffin-dbg, and I think I found the root cause. The NULL is a symptom.What the core shows
sourceid = 24is a uinput virtual pointer (/sys/devices/virtual/input/...) that a user service created at login. Muffin'sseat->devices_by_idhas no entry for id 24, even thoughxinput listshows it as an enabled slave pointer attached to the VCP.Timeline (single login)
XINPUT: Adding extended input device ... (type: MOUSE, id 24)cinnamon --replacestarts,meta_seat_x11_constructed()runsXI_Entersourced from id 24 →source_device == NULL→ SEGVRoot cause: race in
meta_seat_x11_constructed()If a device is added or enabled between (1) and (2), muffin never sees it. It isn't in the snapshot, and the
XIDeviceEnabledhierarchy event arrives before muffin has subscribed. The device then stays unknown for the life of the process, and the firstXI_Enter/XI_Leavefrom it crashes at line 2310. That line is the only place in this switch that passessource_devicewithout a NULL check (XI_DeviceChangedjust above guards it).This explains why the crash shows up "shortly after login, while moving the mouse" and only sometimes. Login is exactly when apps that create virtual input devices start, such as Steam (
60-steam-input.rules, Steam Input uinput devices; the original report has Steam autostarting), Solaar, input-remapper, and custom uinput filters. They race Cinnamon's startup.Suggested fix
XI_HierarchyChangedbefore callingXIQueryDevice.translate_hierarchy_event()already ignores devices that are present indevices_by_id(XIDeviceEnabled && !g_hash_table_lookup (...)), so a device that appears in both the snapshot and an event is handled correctly.XI_DeviceChangeddoes:_clutter_input_device_reset_scroll_infoproposed above also stops the crash, but the device remains invisible to muffin, so (1) is the real fix.)Reproduce (from reading the code, not a deterministic repro)
Create a uinput pointer (e.g.
python-evdevUInput) whilecinnamon --replaceis starting, then move the pointer across a window/stage boundary. The window is short, so this only hits sometimes. On this machine the same uinput service has run at every login for ~8 days, and this is the only crash. Per the code, a device created after the seat is constructed goes through the normal hierarchy path, and one that already exists when Cinnamon starts is in the snapshot, so neither case should crash.