Cinnamon segfault in `_cogl_pipeline_free` from `_cogl_journal_discard` during `cogl_onscreen_swap_buffers_with_damage`

オープン
#891 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

linuxmint/muffin のほかの issue

linuxmint/muffin の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。