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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 09 May 2024 10:35:38 +0300

> From: Yang Yingchao <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Mon, 29 Apr 2024 20:27:52 +0800
> 
> On Mon, Apr 29 2024, Po Lu wrote:
> 
> > Yang Yingchao <[email-masked]> writes:
> >
> >> Could this be an issue with gtk+? I made some changes to gtk+-3.24.41,
> >> and it seems like the issue has disappeared...
> >
> > I don't understand.  Aren't you building with GTK 4.x?
> 
> No, I thought I was using GTK 4 initially, but I'm actually using GTK+ 3...
> 
> 
> >
> >> ,----
> >> | diff -urNa gtk+-3.24.41.orig/gdk/wayland/gdkwindow-wayland.c gtk+-3.24.41/gdk/wayland/gdkwindow-wayland.c
> >> | --- gtk+-3.24.41.orig/gdk/wayland/gdkwindow-wayland.c	2024-01-24 09:14:34.000000000 +0800
> >> | +++ gtk+-3.24.41/gdk/wayland/gdkwindow-wayland.c	2024-04-29 16:41:00.691373426 +0800
> >> | @@ -952,6 +952,11 @@
> >> |    /* Release came in, we haven't done any interim updates, so we can just use
> >> |     * the old committed buffer again.
> >> |     */
> >> | +
> >> | +  if (impl->staging_cairo_surface) {
> >> | +    g_clear_pointer (&impl->staging_cairo_surface, cairo_surface_destroy);
> >> | +  }
> >> | +
> >> |    impl->staging_cairo_surface = g_steal_pointer (&impl->committed_cairo_surface);
> >> |  }
> >> `----
> >>
> >> Actually, I do not understand the logic of the function
> >> `buffer_release_callback()', but when debugging this issue with gdb, I
> >> noticed that the `impl->staging_cairo_surface' which was created via
> >> `_gdk_wayland_display_create_shm_surface' was replaced by
> >> `impl->committed_cairo_surface' without being released first.
> >
> > I'm afraid the GDK Wayland backend is outside my line of country.
> > Perhaps you ought to take this up with their developers, but be prepared
> > for weeks of frustration as they presume to tell you how your program
> > should bend over backwards to accommodate their misdesigns.
> 
> Sure, I'll file a bug report there.
> 
> As a Gentoo user, I can patch the source code on my machine locally,
> therefore, it would not be a real issue for me even if they don't fix it.
> 
> 
> Thanks for your time.

Should we now close this bug report, or is there anything else left to
do here?