Cinnamon segfault in `_cogl_pipeline_free` from `_cogl_journal_discard` during `cogl_onscreen_swap_buffers_with_damage`
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 18/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c, linux
调研方向
The crash is in _cogl_pipeline_free in cogl/cogl/cogl-pipeline.c (around lines 375 and 390), reached through _cogl_journal_discard in cogl-journal.c during cogl_flush from cogl_onscreen_swap_buffers_with_damage. Start by finding where a pipeline's last reference is dropped while it is still held by a journal entry, and by reviewing the journal ref counting. Done means the double free or use-after-free is identified and fixed, and a reproducer or test covers it. Coordinate with maintainers first, since the reproduction is unknown.
由索引模型根据 Issue 内容生成。
描述
Distribution: Linux Mint 22.3 (zena), kernel 7.0.0-38-generic, X11 session
Package version: Cinnamon 6.6.9, Muffin 6.6.3+zena
Graphics hardware in use: NVIDIA GeForce RTX 4090 (single GPU), driver 580.178.04 (open kernel module); 3 monitors over DisplayPort (3072x1728 + 2560x1440 + 3072x1728)
Frequency: Only occasionally (twice in ~20 hours: 2026-11-11 12:46 and 2026-11-12 09:05)
Bug description
Cinnamon segfaults while redrawing the stage, and cinnamon-launcher falls back to metacity. Both crashes have the same stack trace. Nothing is logged in the minutes before either crash.
Kernel line from the latest crash:
cinnamon[6328]: segfault at 187 ip 000074f2bdc73b83 sp 00007ffcf04d8110 error 4 in libmuffin-cogl-0.so.0.0.0[2eb83,74f2bdc57000+4d000]
Backtrace with muffin-dbg installed (2026-11-12 crash):
#0 _cogl_pipeline_free (pipeline=0x59eaba0b6820) at ../cogl/cogl/cogl-pipeline.c:375
#1 _cogl_object_pipeline_indirect_free (obj=0x59eaba0b6820) at ../cogl/cogl/cogl-pipeline.c:69
#2 _cogl_pipeline_journal_unref (pipeline=<optimized out>) at ../cogl/cogl/cogl-pipeline.c:2329
#3 _cogl_journal_discard (journal=<optimized out>) at ../cogl/cogl/cogl-journal.c:1261
#4 _cogl_journal_discard (journal=0x59eab8bd2220) at ../cogl/cogl/cogl-journal.c:1250
#5 _cogl_journal_flush (journal=0x59eab8bd2220) at ../cogl/cogl/cogl-journal.c:1477
#6 _cogl_journal_flush (journal=0x59eab8bd2220) at ../cogl/cogl/cogl.c:154
#7 _cogl_framebuffer_flush_journal (framebuffer=<optimized out>) at ../cogl/cogl/cogl-framebuffer.c:577
#8 cogl_flush () at ../cogl/cogl/cogl.c:155
#9 cogl_onscreen_swap_buffers_with_damage (n_rectangles=6, ...) at ../cogl/cogl/cogl-onscreen.c:309
#10 cogl_onscreen_swap_buffers_with_damage (...) at ../cogl/cogl/cogl-onscreen.c:294
#11 swap_framebuffer.isra.0 (..., swap_with_damage=1, ...) at ../clutter/clutter/cogl/clutter-stage-cogl.c:445
#12 clutter_stage_cogl_redraw_view (...) at ../clutter/clutter/cogl/clutter-stage-cogl.c:976
#13 clutter_stage_cogl_redraw (...) at ../clutter/clutter/cogl/clutter-stage-cogl.c:1023
#14 _clutter_stage_window_redraw (...) at ../clutter/clutter/clutter-stage-window.c:219
#15 clutter_stage_do_redraw (...) at ../clutter/clutter/clutter-stage.c:1450
... g_main_loop_run -> meta_run -> main
The 2026-11-11 crash has the same frames #1–#15. Frame #0 is in the same function, at cogl-pipeline.c:390 instead of 375.
What the pipeline looks like at the crash
Line 375 is the _cogl_bitmask_popcount (&uniforms_state->override_mask) read in the COGL_PIPELINE_STATE_UNIFORMS branch. big_state is 0xff, so uniforms_state resolves to 0x187, which is the faulting address. *pipeline at frame #0:
ref_count = 0, journal_ref_count = 0, parent = 0x0, has_parent_reference = 1,
differences = 2, has_big_state = 0, big_state = 0xff, n_layers = 1,
destroy_callback = 0x4100000000000000, destroy_data = 0x3f80000000000000,
color = {red = 234, green = 89, blue = 0, alpha = 0,
padding0 = 3142241680, padding1 = 23018, padding2 = 3139531408}
In the 11-11 crash, big_state = 0xeded0b4261786000 and destroy_callback = 0x40a00000. destroy_callback and destroy_data hold float-like bit patterns (8.0f/5.0f and 1.0f), big_state is garbage while has_big_state = 0, and color holds heap-pointer fragments. This looks like the pipeline's memory was freed and reused while a journal entry still referred to it. Something seems to drop the last reference to a pipeline that is still queued in the framebuffer journal, or frees it outside the refcount, and _cogl_journal_discard then frees it again.
Steps to reproduce
I don't have a reliable reproducer. The crashes happen during normal desktop use (browser, terminals, IDE) on a 3-monitor NVIDIA setup. There's no clear trigger, and nothing is logged by Cinnamon, applets or Xorg beforehand.
Expected behavior
Cinnamon shouldn't crash while flushing the journal during a buffer swap.
Additional information
- Core dumps for both crashes are available and I can run more gdb commands on request.
- A different Muffin crash on 2026-11-03 (in
window_may_be_covered_by_above) is probably unrelated.
- 主要语言
- C
- 星标
- 249
- 派生
- 133
- 平均合并
- 17 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxmint/muffin 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 4/5 3-5 天 新手友好度 43/100
-
X11: every keyboard layout switch freezes the compositor for up to ~1 s (reload_keybindings regrabs per-window keybindings on every window)可能已有人在做 @KAMI911 于 7 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 45/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
389ds/389-ds-base#8152 ·
维护者通常 2 天内回复
-
meta:feature-request
难度 2/5 1-3 小时 新手友好度 66/100
mpv-player/mpv#18855 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug help wanted
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
isolation2 lockmodes fails on cassert builds: extra AccessShareLock on partition root可能已有人在做 @tuhaihe 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudberry#2356 ·
维护者通常 2 天内回复