#17 Backported 2 bugfixes from upstream to rawhide
Closed 3 months ago by blarsen. Opened 3 months ago by blarsen.
rpms/ blarsen/gdb rawhide  into  rawhide

file added
+1
@@ -0,0 +1,1 @@ 

+ 1

file modified
+8
@@ -403,3 +403,11 @@ 

  # Backport patch adjusting test gdb.mi/mi-sym-info.exp (RH BZ 1971096).

  Patch098: gdb-rhbz1971096-glibc2.34-5.patch

  

+ #[gdb/cli] Don't assert on empty string for core-file

+ #(Tom de Vries)

+ Patch099: gdb-rhbz1916516-pathstuffs132-internal-error.patch

+ 

+ #[gdb] Improve early exits for env var in debuginfod-support.c

+ #(Tom de Vries)

+ Patch100: gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch

+ 

file modified
+2
@@ -96,3 +96,5 @@ 

  %patch096 -p1

  %patch097 -p1

  %patch098 -p1

+ %patch099 -p1

+ %patch100 -p1

file modified
+2
@@ -96,3 +96,5 @@ 

  gdb-rhbz1971096-glibc2.34-3.patch

  gdb-rhbz1971096-glibc2.34-4.patch

  gdb-rhbz1971096-glibc2.34-5.patch

+ gdb-rhbz1916516-pathstuffs132-internal-error.patch

+ gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch

file added
+19
@@ -0,0 +1,19 @@ 

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_stable

+ subject_type: koji_build

+ rules:

+   - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

+ --- !Policy

+ product_versions:

+   - rhel-8

+ decision_context: osci_compose_gate

+ rules:

+   - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

+ --- !Policy

+ product_versions:

+   - rhel-9

+ decision_context: osci_compose_gate

+ rules:

+   - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

@@ -0,0 +1,67 @@ 

+ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001

+ From: Bruno Larsen <blarsen@redhat.com>

+ Date: Wed, 22 Sep 2021 12:22:44 -0300

+ Subject: gdb-rhbz1916516-pathstuffs132-internal-error.patch

+ 

+ ;;[gdb/cli] Don't assert on empty string for core-file

+ ;;(Tom de Vries)

+ 

+ With current gdb we run into:

+ ...

+ $ gdb -batch '' ''

+ : No such file or directory.

+ pathstuff.cc:132: internal-error: \

+   gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \

+   Assertion `path != NULL && path[0] != '\0'' failed.

+ ...

+ 

+ Fix this by skipping the call to gdb_abspath in core_target_open in the

+ empty-string case, such that we have instead:

+ ...

+ $ gdb -batch '' ''

+ : No such file or directory.

+ : No such file or directory.

+ $

+ ...

+ 

+ Tested on x86_64-linux.

+ 

+ gdb/ChangeLog:

+ 

+ 2021-08-30  Tom de Vries  <tdevries@suse.de>

+ 

+ 	PR cli/28290

+ 	* gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the

+ 	empty-string case.

+ 

+ gdb/testsuite/ChangeLog:

+ 

+ 2021-08-30  Tom de Vries  <tdevries@suse.de>

+ 

+ 	PR cli/28290

+ 	* gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.

+ 

+ diff --git a/gdb/corelow.c b/gdb/corelow.c

+ --- a/gdb/corelow.c

+ +++ b/gdb/corelow.c

+ @@ -446,7 +446,8 @@ core_target_open (const char *arg, int from_tty)

+      }

+  

+    gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));

+ -  if (!IS_ABSOLUTE_PATH (filename.get ()))

+ +  if (strlen (filename.get ()) != 0

+ +      && !IS_ABSOLUTE_PATH (filename.get ()))

+      filename = gdb_abspath (filename.get ());

+  

+    flags = O_BINARY | O_LARGEFILE;

+ diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp

+ --- a/gdb/testsuite/gdb.base/batch-exit-status.exp

+ +++ b/gdb/testsuite/gdb.base/batch-exit-status.exp

+ @@ -76,3 +76,7 @@ test_exit_status 1 "-batch -x $good_commands -x $bad_commands" \

+      "-batch -x good-commands -x bad-commands"

+  test_exit_status 1 "-batch -x $good_commands -ex \"set not-a-thing 4\"" \

+      "-batch -x good-commands -ex \"set not-a-thing 4\""

+ +

+ +set no_such_re ": No such file or directory\\."

+ +test_exit_status 1 "-batch \"\"" $no_such_re

+ +test_exit_status 1 "-batch \"\" \"\"" [multi_line $no_such_re $no_such_re]

@@ -0,0 +1,51 @@ 

+ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001

+ From: Bruno Larsen <blarsen@redhat.com>

+ Date: Wed, 22 Sep 2021 12:29:11 -0300

+ Subject: gdb-rhbz1970741-early-exit-for-empty-debuginfod-url.patch

+ 

+ ;;[gdb] Improve early exits for env var in debuginfod-support.c

+ ;;(Tom de Vries)

+ 

+ There's an early exit in libdebuginfod's debuginfod_query_server, which checks

+ both for:

+ - getenv (DEBUGINFOD_URLS_ENV_VAR) == NULL, and

+ - (getenv (DEBUGINFOD_URLS_ENV_VAR))[0] == '\0'.

+ 

+ In debuginfod_source_query and debuginfod_debuginfo_query (which both

+ end up calling debuginfod_query_server) there are also early exits checking

+ the same env var, but those just check for NULL.

+ 

+ Make the early exit tests in debuginfod-support.c match those in

+ libdebuginfod.

+ 

+ gdb/ChangeLog:

+ 

+ 2020-11-18  Tom de Vries  <tdevries@suse.de>

+ 

+ 	* debuginfod-support.c (debuginfod_source_query)

+ 	(debuginfod_debuginfo_query): Also do early exit if

+ 	"(getenv (DEBUGINFOD_URLS_ENV_VAR))[0] == '\0'".

+ 

+ diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c

+ --- a/gdb/debuginfod-support.c

+ +++ b/gdb/debuginfod-support.c

+ @@ -98,7 +98,8 @@ debuginfod_source_query (const unsigned char *build_id,

+  			 const char *srcpath,

+  			 gdb::unique_xmalloc_ptr<char> *destname)

+  {

+ -  if (getenv (DEBUGINFOD_URLS_ENV_VAR) == NULL)

+ +  const char *urls_env_var = getenv (DEBUGINFOD_URLS_ENV_VAR);

+ +  if (urls_env_var == NULL || urls_env_var[0] == '\0')

+      return scoped_fd (-ENOSYS);

+  

+    debuginfod_client *c = debuginfod_init ();

+ @@ -135,7 +136,8 @@ debuginfod_debuginfo_query (const unsigned char *build_id,

+  			    const char *filename,

+  			    gdb::unique_xmalloc_ptr<char> *destname)

+  {

+ -  if (getenv (DEBUGINFOD_URLS_ENV_VAR) == NULL)

+ +  const char *urls_env_var = getenv (DEBUGINFOD_URLS_ENV_VAR);

+ +  if (urls_env_var == NULL || urls_env_var[0] == '\0')

+      return scoped_fd (-ENOSYS);

+  

+    debuginfod_client *c = debuginfod_init ();

file modified
+9 -1
@@ -37,7 +37,7 @@ 

  

  # The release always contains a leading reserved number, start it at 1.

  # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.

- Release: 6%{?dist}

+ Release: 7%{?dist}

  

  License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL

  # Do not provide URL for snapshots as the file lasts there only for 2 days.
@@ -1143,6 +1143,14 @@ 

  %endif

  

  %changelog

+ * Wed Sep 22 2021 Bruno Larsen <blarsen@redhat.com> - 10.2-7

+ - Backport "[gdb] Improve early exits for env var in debuginfod-support.c"

+   (Tom de Vries)

+ 

+ * Wed Sep 22 2021 Bruno Larsen <blarsen@redhat.com> - 10.2-7

+ - Backport "[gdb/cli] Don't assert on empty string for core-file"

+   (Tom de Vries)

+ 

  * Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org>

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

file added
+6
@@ -0,0 +1,6 @@ 

+ summary: CI Gating Plan

+ discover:

+     how: fmf

+     directory: tests

+ execute:

+     how: beakerlib

file removed
-31
@@ -1,31 +0,0 @@ 

- Justification

- 

- Adds tests according to the CI wiki specifically the standard test

- interface in the spec.

- 

- The playbook includes Tier1 level test cases that have been tested in

- the following contexts and is passing reliably: Classic and

- Container. Test logs are stored in the artifacts directory.

- 

- The following steps are used to execute the tests using the standard

- test interface: Test environment

- 

- Make sure you have installed packages from the spec

- 

-     # rpm -q ansible python2-dnf libselinux-python standard-test-roles

-     ansible-2.3.2.0-1.fc26.noarch

-     python2-dnf-2.6.3-11.fc26.noarch

-     libselinux-python-2.6-7.fc26.x86_64

-     standard-test-roles-2.4-1.fc26.noarch

- 

- Run tests for Classic (must be run as root)

- 

-     # export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)

-         # ansible-playbook --tags=classic tests.yml

- 

- Run tests for Container (must be run as root)

- 

-     # export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)

-     # export TEST_SUBJECTS=docker:docker.io/library/fedora:26

-         # ansible-playbook --tags=container tests.yml

- 

@@ -1,4 +1,4 @@ 

- sta

+ start

  si 30

  n 10

  up

@@ -0,0 +1,17 @@ 

+ summary: Debug a system binary.

+ description: ''

+ contact:

+ - Marek Polacek <mpolacek@redhat.com>

+ component:

+ - gdb

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - gdb

+ - coreutils

+ - coreutils-debuginfo

+ - glibc

+ - glibc-debuginfo

+ duration: 5m

+ extra-summary: /tools/gdb/Sanity/debug-system-binary

+ extra-task: /tools/gdb/Sanity/debug-system-binary

@@ -27,8 +27,7 @@ 

  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  

  # Include Beaker environment

- . /usr/bin/rhts-environment.sh || exit 1

- . /usr/lib/beakerlib/beakerlib.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

  

  CMD="gdb"

  BIN="$(which $CMD)"

@@ -14,5 +14,4 @@ 

  b xexit

  c

  c

- c

  q

@@ -0,0 +1,22 @@ 

+ summary: We debug a binary that is delivered via the Toolset.

+ description: ''

+ contact:

+ - Marek Polacek <mpolacek@redhat.com>

+ component:

+ - gdb

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - gdb

+ - coreutils

+ - binutils

+ - binutils-debuginfo

+ - glibc

+ - glibc-debuginfo

+ - gcc

+ - gcc-debuginfo

+ - zlib

+ - zlib-debuginfo

+ duration: 5m

+ extra-summary: /tools/gdb/Sanity/debug-toolset-binary

+ extra-task: /tools/gdb/Sanity/debug-toolset-binary

@@ -32,8 +32,7 @@ 

  # but in fact, it doesn't have to.  It should not fail either way.

  

  # Include Beaker environment

- . /usr/bin/rhts-environment.sh || exit 1

- . /usr/lib/beakerlib/beakerlib.sh || exit 1

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

  

  CMD="gdb"

  BIN="$(which $CMD)"

file removed
-3
@@ -1,3 +0,0 @@ 

- #!/bin/bash

- export TEST_DOCKER_EXTRA_ARGS="--privileged"

- exec merge-standard-inventory "$@"

file removed
-24
@@ -1,24 +0,0 @@ 

- ---

- # This first play always runs on the local staging system

- - hosts: localhost

-   roles:

-   - role: standard-test-beakerlib

-     tags:

-     - classic

-     - container

-     tests:

-     - debug-toolset-binary

-     - debug-system-binary

-     required_packages:

-     - gdb

-     - coreutils

-     - binutils

-     - binutils-debuginfo

-     - glibc

-     - glibc-debuginfo

-     - gcc

-     - gcc-debuginfo

-     - zlib

-     - zlib-debuginfo

-     - coreutils-debuginfo

-     - which