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

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, linux

Direzione di ricerca

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.

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

Descrizione

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.

Lingua principale
C
Stelle
173
Fork
52
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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

Tutte le issue di linuxmint/xapp

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.