public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/chromium] epel9-next: backport upstream patch to fix memory leak
@ 2026-08-07 16:05 Than Ngo
  0 siblings, 0 replies; only message in thread
From: Than Ngo @ 2026-08-07 16:05 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/chromium
Branch : epel9-next
Commit : daa72a6e931af709f5b617779280f4249c69e1f9
Author : Than Ngo <than@redhat.com>
Date   : 2023-09-23T14:06:06+02:00
Stats  : +72/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/chromium/c/daa72a6e931af709f5b617779280f4249c69e1f9?branch=epel9-next

Log:
backport upstream patch to fix memory leak

---
diff --git a/chromium-117-memory_leak_in_xserver.patch b/chromium-117-memory_leak_in_xserver.patch
new file mode 100644
index 0000000..35cc564
--- /dev/null
+++ b/chromium-117-memory_leak_in_xserver.patch
@@ -0,0 +1,63 @@
+commit 42d57d016f5fb6d2a1a354743b9be911c1be87e8
+Author: Jianhui Dai <jianhui.j.dai@intel.com>
+Date:   Fri Sep 22 21:30:04 2023 +0000
+
+    [GL] Free the X11 pixmap in the NativePixmapEGLX11Binding destructor
+    
+    This CL frees the X11 pixmap in the NativePixmapEGLX11Binding destructor
+    to prevent a memory leak in the X server.
+    
+    Bug: 1467689
+    Change-Id: Id4cba30825417db52176f9165db34d7234a05a05
+    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4886249
+    Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
+    Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
+    Reviewed-by: Maksim Sisov <msisov@igalia.com>
+    Cr-Commit-Position: refs/heads/main@{#1200486}
+
+diff --git a/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.cc b/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.cc
+index 46a2d3274b924..b46eb67b9de60 100644
+--- a/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.cc
++++ b/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.cc
+@@ -147,9 +147,17 @@ NativePixmapEGLX11Binding::~NativePixmapEGLX11Binding() {
+   if (surface_) {
+     eglDestroySurface(display_, surface_);
+   }
++
++  if (pixmap_ != x11::Pixmap::None) {
++    auto* connection = x11::Connection::Get();
++    connection->FreePixmap({pixmap_});
++  }
+ }
+ 
+ bool NativePixmapEGLX11Binding::Initialize(x11::Pixmap pixmap) {
++  CHECK_NE(pixmap, x11::Pixmap::None);
++  pixmap_ = pixmap;
++
+   if (eglInitialize(display_, nullptr, nullptr) != EGL_TRUE) {
+     return false;
+   }
+@@ -223,9 +231,7 @@ std::unique_ptr<NativePixmapGLBinding> NativePixmapEGLX11Binding::Create(
+     return nullptr;
+   }
+ 
+-  // TODO(https://crbug.com/1411749): if we early out below, should we call
+-  // FreePixmap()?
+-
++  // Transfer the ownership of `pixmap` to `NativePixmapEGLX11Binding`.
+   if (!binding->Initialize(std::move(pixmap))) {
+     VLOG(1) << "Unable to initialize binding from pixmap";
+     return nullptr;
+diff --git a/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.h b/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.h
+index 013df3f776acc..99b262b82ce9d 100644
+--- a/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.h
++++ b/ui/ozone/platform/x11/native_pixmap_egl_x11_binding.h
+@@ -47,6 +47,8 @@ class NativePixmapEGLX11Binding : public NativePixmapGLBinding {
+   EGLSurface surface_ = nullptr;
+   EGLDisplay display_;
+   gfx::BufferFormat format_;
++
++  x11::Pixmap pixmap_ = x11::Pixmap::None;
+ };
+ 
+ }  // namespace ui

diff --git a/chromium.spec b/chromium.spec
index 2f0cf12..d62c435 100644
--- a/chromium.spec
+++ b/chromium.spec
@@ -239,7 +239,7 @@
 
 Name:	chromium%{chromium_channel}
 Version: 117.0.5938.92
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
 Url: http://www.chromium.org/Home
 License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
@@ -377,6 +377,9 @@ Patch350: chromium-116-tweak_about_gpu.patch
 # build error
 Patch351: chromium-117-mnemonic-error.patch
 
+# upstream patches
+Patch400: chromium-117-memory_leak_in_xserver.patch
+
 # Use chromium-latest.py to generate clean tarball from released build tarballs, found here:
 # http://build.chromium.org/buildbot/official/
 # For Chromium Fedora use chromium-latest.py --stable --ffmpegclean --ffmpegarm
@@ -989,6 +992,8 @@ udev.
 %patch -P350 -p1 -b .tweak_about_gpu
 %patch -P351 -p1 -b .mnemonic-error
 
+%patch -P400 -p1 -b .memory_leak_in_xserver
+
 # Change shebang in all relevant files in this directory and all subdirectories
 # See `man find` for how the `-exec command {} +` syntax works
 find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +
@@ -1682,6 +1687,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
 %{chromium_path}/chromedriver
 
 %changelog
+* Sat Sep 23 2023 Than Ngo <than@redhat.com> - 117.0.5938.92-2
+- backport upstream patch to fix memory leak
+
 * Fri Sep 22 2023 Than Ngo <than@redhat.com> - 117.0.5938.92-1
 - update to 117.0.5938.92
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-07 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-07 16:05 [rpms/chromium] epel9-next: backport upstream patch to fix memory leak Than Ngo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox