From 07e00666b7d7a95b24098e8b72a24de559fc80dc Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Tue, 13 Feb 2024 15:06:56 +0100 Subject: [PATCH] Fix a performance regression while using large number of environment variables --- .bash.metadata | 1 + bash-5.2-pipeline-exec.patch | 15 +++++++++++++++ bash.spec | 9 ++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .bash.metadata create mode 100644 bash-5.2-pipeline-exec.patch diff --git a/.bash.metadata b/.bash.metadata new file mode 100644 index 0000000..e5657e7 --- /dev/null +++ b/.bash.metadata @@ -0,0 +1 @@ +063019501ef1f30fad99d2b735a7ae2ce1d11423 bash-5.1.tar.gz diff --git a/bash-5.2-pipeline-exec.patch b/bash-5.2-pipeline-exec.patch new file mode 100644 index 0000000..ba14696 --- /dev/null +++ b/bash-5.2-pipeline-exec.patch @@ -0,0 +1,15 @@ +diff --git a/execute_cmd.c b/execute_cmd.c +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -5496,11 +5496,7 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out, + { + /* If we're optimizing out the fork (implicit `exec'), decrement the + shell level like `exec' would do. */ +-#if 0 /* TAG: bash-5.2 psmith 10/11/2020 */ + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && (subshell_environment & SUBSHELL_PIPE) == 0) +-#else +- if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE) +-#endif + adjust_shell_level (-1); + + maybe_make_export_env (); diff --git a/bash.spec b/bash.spec index 1b991d8..b3ab1c3 100644 --- a/bash.spec +++ b/bash.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3+ Url: https://www.gnu.org/software/bash Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -97,6 +97,9 @@ Patch131: bash-4.3-audit.patch # Fix an issue with adding newline in bracketed paste mode Patch132: bash-5.2-add-newline.patch +# RHEL-20020 - Fix a performance regression while using large number of environment variables +Patch133: bash-5.2-pipeline-exec.patch + BuildRequires: gcc BuildRequires: texinfo bison BuildRequires: ncurses-devel @@ -329,6 +332,10 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog +* Tue Feb 13 2024 Siteshwar Vashisht - 5.1.8-9 +- Fix a performance regression while using large number of environment variables + Resolves: RHEL-20020 + * Mon Feb 12 2024 Siteshwar Vashisht - 5.1.8-8 - Fix an issue with adding newline in bracketed paste mode Resolves: #2168963