Fix a performance regression while using large number of environment variables

This commit is contained in:
Siteshwar Vashisht 2024-02-13 15:06:56 +01:00 committed by root
parent 3c98f4d9b3
commit 07e00666b7
3 changed files with 24 additions and 1 deletions

1
.bash.metadata Normal file
View File

@ -0,0 +1 @@
063019501ef1f30fad99d2b735a7ae2ce1d11423 bash-5.1.tar.gz

View File

@ -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 ();

View File

@ -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 <svashisht@redhat.com> - 5.1.8-9
- Fix a performance regression while using large number of environment variables
Resolves: RHEL-20020
* Mon Feb 12 2024 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-8
- Fix an issue with adding newline in bracketed paste mode
Resolves: #2168963