Subject: bug#70352: Fwd: Re: bug#70352: 29.3.50; emacs-pgtk: possible leak of virtual memory

From: Yang Yingchao <[email-masked]>
Date: Wed, 17 Apr 2024 15:30:11 +0800

On Mon, Apr 15 2024, Yang Yingchao wrote:

>
> FYI:
> I tested this in two window managers (Hyprland & Sway), and found that the same issue exists.

I'm not familiar with the GTK toolkit, but it seems that the creation
and destruction of surfaces are not properly paired.

I added breakpoints to `_gdk_wayland_display_create_shm_surface()` and
`gdk_wayland_cairo_surface_destroy()`, then executed steps 2 and 3. I
found that `_gdk_wayland_display_create_shm_surface()` is called 3
times, but `gdk_wayland_cairo_surface_destroy()` is only called 2 times.

I'm not sure if this is related...

```
70:Thread 1 "emacs" hit Breakpoint 6, _gdk_wayland_display_create_shm_surface (display=<optimized out>,
125:Thread 1 "emacs" hit Breakpoint 5, gdk_wayland_cairo_surface_destroy (p=0x555b2d87c2a0)
137:Thread 1 "emacs" hit Breakpoint 6, _gdk_wayland_display_create_shm_surface (display=<optimized out>,
153:Thread 1 "emacs" hit Breakpoint 6, _gdk_wayland_display_create_shm_surface (display=<optimized out>,
181:Thread 1 "emacs" hit Breakpoint 5, gdk_wayland_cairo_surface_destroy (p=0x555b2e33fc40)
```