public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdb] gdb-17.2-rebase-f44: Remove patch gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
Date: Sun, 28 Jun 2026 00:01:51 GMT	[thread overview]
Message-ID: <178260491162.1.6023472587702552074.rpms-gdb-391403edfe05@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gdb
            Branch : gdb-17.2-rebase-f44
            Commit : 391403edfe05d8e5cf064039a98a07fce0734b79
            Author : Andrew Burgess <aburgess@redhat.com>
            Date   : 2024-09-26T11:30:16+01:00
            Stats  : +13/-189 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/gdb/c/391403edfe05d8e5cf064039a98a07fce0734b79?branch=gdb-17.2-rebase-f44

            Log:
            Remove patch gdb-rhbz1007614-memleak-infpy_read_memory-test.patch

Remove gdb-rhbz1007614-memleak-infpy_read_memory-test.patch.  I
pushed an equivalent test upstream in commit:

  commit f4b29c2f6109a3d83facd50fe6b7c2faf1962f39
  Date:   Wed Sep 25 15:44:56 2024 +0100

      gdb/testsuite: test for memory leaks in gdb.Inferior.read_memory()

Given this is only a test, and for a bug which has been fixed upstream
for many years now, I don't see any point in back-porting this
upstream patch.  We can pick up the new test the next time we rebase.

---
diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include
index a7302af..ee30eb7 100644
--- a/_gdb.spec.Patch.include
+++ b/_gdb.spec.Patch.include
@@ -64,33 +64,29 @@ Patch015: gdb-test-dw2-aranges.patch
 #=fedoratest
 Patch016: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
 
-# Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
-#=fedoratest
-Patch017: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
-
 # Fix 'gdb gives highly misleading error when debuginfo pkg is present,
 # but not corresponding binary pkg' (RH BZ 981154).
 #=push+jan
-Patch018: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
+Patch017: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
 
 # Testcase for '[SAP] Recursive dlopen causes SAP HANA installer to
 # crash.' (RH BZ 1156192).
 #=fedoratest
-Patch019: gdb-rhbz1156192-recursive-dlopen-test.patch
+Patch018: gdb-rhbz1156192-recursive-dlopen-test.patch
 
 # Fix '`catch syscall' doesn't work for parent after `fork' is called'
 # (Philippe Waroquiers, RH BZ 1149205).
 #=fedoratest
-Patch020: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
+Patch019: gdb-rhbz1149205-catch-syscall-after-fork-test.patch
 
 # Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
 # Kratochvil, RH BZ 1084404).
 #=fedoratest
-Patch021: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
+Patch020: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
 
 # [aarch64] Fix hardware watchpoints (RH BZ 1261564).
 #=fedoratest
-Patch022: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
+Patch021: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
 
 # Update gdb-add-index.sh such that, when the GDB environment
 # variable is not set, the script is smarter than just looking for
@@ -104,15 +100,15 @@ Patch022: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch
 #   https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
 #
 #=fedora
-Patch023: gdb-add-index.patch
+Patch022: gdb-add-index.patch
 
 # Backport upstream commit 7db795bc67a.
-Patch024: gdb-remove-use-of-py-isascii
+Patch023: gdb-remove-use-of-py-isascii
 
 # Not a backport.  Add a new script which hooks into GDB and suggests
 # RPMs to install when GDB finds an objfile with no debug info.
-Patch025: gdb-add-rpm-suggestion-script.patch
+Patch024: gdb-add-rpm-suggestion-script.patch
 
 
-Patch026: gdb-catchpoint-re-set.patch
+Patch025: gdb-catchpoint-re-set.patch
 

diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include
index 5d59f3c..8c29eae 100644
--- a/_gdb.spec.patch.include
+++ b/_gdb.spec.patch.include
@@ -23,4 +23,3 @@
 %patch -p1 -P023
 %patch -p1 -P024
 %patch -p1 -P025
-%patch -p1 -P026

diff --git a/_patch_order b/_patch_order
index 3ce220c..6979f4c 100644
--- a/_patch_order
+++ b/_patch_order
@@ -14,7 +14,6 @@ gdb-archer-next-over-throw-cxx-exec.patch
 gdb-test-bt-cfi-without-die.patch
 gdb-test-dw2-aranges.patch
 gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
-gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
 gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
 gdb-rhbz1156192-recursive-dlopen-test.patch
 gdb-rhbz1149205-catch-syscall-after-fork-test.patch

diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
deleted file mode 100644
index 555eefb..0000000
--- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
-From: Fedora GDB patches <invalid@email.com>
-Date: Fri, 27 Oct 2017 21:07:50 +0200
-Subject: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
-
-;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614)
-;;=fedoratest
-
-Original message by Tom Tromey:
-
-  <https://sourceware.org/ml/gdb-patches/2012-03/msg00955.html>
-  Message-ID: <871uoc1va3.fsf@fleche.redhat.com>
-
-Comment from Sergio Durigan Junior:
-
-  In order to correctly test this patch, I wrote a testcase based on Jan
-  Kratochvil's <gdb/testsuite/gdb.base/gcore-excessive-memory.exp>.  The
-  testcase, which can be seen below, tests GDB in order to see if the
-  amount of memory being leaked is minimal, as requested in the bugzilla.
-  It is hard to define what "minimum" is, so I ran the testcase on all
-  supported RHEL architectures and came up with an average.
-
-commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c
-Author: Tom Tromey <tromey@redhat.com>
-Date:   Wed Mar 28 17:38:08 2012 +0000
-
-    	* python/py-inferior.c (infpy_read_memory): Remove cleanups and
-    	explicitly free 'buffer' on exit paths.  Decref 'membuf_object'
-    	before returning.
-
-diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
-@@ -0,0 +1,27 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+   Copyright 2014 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+static struct x
-+  {
-+    char unsigned u[4096];
-+  } x, *px = &x;
-+
-+int
-+main (int argc, char *argv[])
-+{
-+  return 0;
-+}
-diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
-@@ -0,0 +1,72 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+load_lib gdb-python.exp
-+
-+require allow_python_tests
-+
-+set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
-+    return -1
-+}
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+proc memory_v_pages_get {} {
-+    global pid_of_gdb
-+    set fd [open "/proc/$pid_of_gdb/statm"]
-+    gets $fd line
-+    close $fd
-+    # number of pages of virtual memory
-+    scan $line "%d" drs
-+    return $drs
-+}
-+
-+if { ![runto_main] } {
-+    untested $testfile.exp
-+    return -1
-+}
-+
-+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
-+
-+gdb_test "source ${remote_python_file}" ""
-+
-+gdb_test "hello-world" "" \
-+    "first hello-world test"
-+
-+set kbytes_before [memory_v_pages_get]
-+verbose -log "kbytes_before = $kbytes_before"
-+
-+gdb_test "hello-world" "" \
-+    "second hello-world test"
-+
-+set kbytes_after [memory_v_pages_get]
-+verbose -log "kbytes_after = $kbytes_after"
-+
-+set kbytes_diff [expr $kbytes_after - $kbytes_before]
-+verbose -log "kbytes_diff = $kbytes_diff"
-+
-+# The value "1000" was calculated by running a few GDB sessions with this
-+# testcase, and seeing how much (in average) the memory consumption
-+# increased after the "hello-world" command issued above.  The average
-+# was around 500 bytes, so I chose 1000 as a high estimate.
-+if { $kbytes_diff > 1000 } {
-+    fail "there is a memory leak on GDB (RHBZ 1007614)"
-+} else {
-+    pass "there is not a memory leak on GDB (RHBZ 1007614)"
-+}
-diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
-new file mode 100644
---- /dev/null
-+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
-@@ -0,0 +1,30 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+class HelloWorld (gdb.Command):
-+    """Greet the whole world."""
-+
-+    def __init__ (self):
-+        super (HelloWorld, self).__init__ ("hello-world",
-+                                           gdb.COMMAND_OBSCURE)
-+
-+    def invoke (self, arg, from_tty):
-+        px = gdb.parse_and_eval("px")
-+        core = gdb.inferiors()[0]
-+        for i in range(256 * 1024):
-+            chunk = core.read_memory(px, 4096)
-+        print "Hello, World!"
-+
-+HelloWorld ()

diff --git a/gdb.spec b/gdb.spec
index 5847f41..bb37ccb 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -926,6 +926,10 @@ fi
 # endif scl
 
 %changelog
+* Thu Sep 26 2024 Andrew Burgess <aburgess@redhat.com>
+- Remove gdb-rhbz1007614-memleak-infpy_read_memory-test.patch.  An
+  equivalent test was pushed upstream in commit f4b29c2f610.
+
 * Wed Sep 11 2024 Kevin Buettner <kevinb@redhat.com>
 - Remove local patch gdb-6.5-section-num-fixup-test.patch.  This
   patch contained a test case which should be covered by upstream

                 reply	other threads:[~2026-06-28  0:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178260491162.1.6023472587702552074.rpms-gdb-391403edfe05@fedoraproject.org \
    --to=aburgess@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox