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

Đang mở
#891 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, linux

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
C
Star
249
Fork
133
Merge trung bình
17 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của linuxmint/muffin

Tất cả issue của linuxmint/muffin

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.