Mint 22.3: xapp-sn-watcher segfaults on the second right-click of a tray icon (c445c22 not on 3.2-maintenance)

Đang mở
#221 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/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
Lĩnh vực
desktop, operating-systems

Hướng nghiên cứu

Start with xapp-status-icon.c, where synthesize_event() creates the dummy rect window and the popup event takes it without a ref (around lines 367 and 383), then compare with the fix in commit c445c22 on master. The backport needs that change applied on the 3.2-maintenance branch, and the crash should no longer appear in a repeated right-click loop on a tray icon. Reproducing it needs an AppIndicator tray icon and a display where the watcher can be run under gdb.

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, Cinnamon 6.6

Package version

libxapp1 3.2.4+mint22.3 (libgtk-3-0t64 3.24.41-4ubuntu1.3)

Graphics hardware in use

No response

Frequency

Only occasionally

Bug description

xapp-sn-watcher crashed when I right-clicked the Whatsie tray icon, and all tray icons reloaded once cinnamon-session restarted it. As far as I can tell this is the use-after-free that c445c22 fixes on master, where it showed up as "GdkWindow unexpectedly destroyed" warnings. The dummy rect window from synthesize_event() goes into the popup event without a ref, so on the second popup of the same menu the old dummy is freed while its XID is still in GDK's table, and the DestroyNotify lookup can hand back freed memory.

Crashing thread:

#0 gdk_event_source_get_filter_window () at gdk/x11/gdkeventsource.c:123
#1 gdk_event_source_translate_event () at gdk/x11/gdkeventsource.c:189
#2 _gdk_x11_display_queue_events () at gdk/x11/gdkeventsource.c:341
#3 gdk_display_get_event () at gdk/gdkdisplay.c:442
#4 gdk_event_source_dispatch () at gdk/x11/gdkeventsource.c:354
#5 g_main_dispatch () at glib/gmain.c:3344
   ...
#8 g_application_run ()
#9 main ()

The event is a DestroyNotify for 0x2c002a5. In the core that XID still maps to a freed 416-byte GdkWindow. It is the dummy from my first right-click on Whatsie, and Whatsie's menu from the second click was still open.

Steps to reproduce

Right-click an AppIndicator tray icon, close the menu, and right-click the same icon again. The second popup frees the first dummy every time, but whether the watcher then segfaults depends on the heap, so it can take many tries.

Expected behavior

The menu opens and xapp-sn-watcher keeps running.

Additional information

A gdb watchpoint on the dummy's ref_count showed 2 at gtk_menu_popup_at_rect, 1 after gdk_event_free (xapp-status-icon.c:383), and 0 inside the second popup's g_object_set_data_full (line 367), before the DestroyNotify arrived. A right-click loop on a separate X display with the packaged 3.2.4 crashed in 3 of 5 runs, same frame #0, and the other 2 survived 200 cycles. With c445c22 applied on top of 3.2.4 the dummy stays alive until GDK has handled its DestroyNotify and dropped the XID.

c445c22 is on master but not on 3.2-maintenance, so Mint 22 still has the bug. Could it go into the next 3.2.x? Happy to test a build, or to send the cherry-pick as a PR if that is easier.

Ngôn ngữ chính
C
Star
173
Fork
52
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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/xapp

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

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.