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

Aperta
#891 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, linux

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C
Stelle
249
Fork
133
Merge medio
17m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxmint/muffin

Tutte le issue di linuxmint/muffin

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.