[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash 5.2 regression in optimize_connection_fork

From: Frode Nordahl
Subject: bash 5.2 regression in optimize_connection_fork
Date: Sat, 19 Nov 2022 08:07:14 +0100

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
uname output: Linux kbuild 5.19.0-23-generic #24-Ubuntu SMP PREEMPT_DYNAMIC Fri 
Oct 14 15:39:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.2
Patch Level: 9
Release Status: release

        OVN makes use of GNU autotest for its testsuite. This in turn is a
heavy user of bash.

For some reason, when the 'ovn-controller incremental processing' test is
executed using bash 5.2 on Debian experimental or Ubuntu Kinetic/Lunar, the
`eval` [0] in the `counter_delta_` function misinterprets successful execution
of commands [1], leading to a false negative for the 'ovn-controller
incremental processing' test [2].

Backporting the bash 5.1 package from Jammy, or compiling bash 5.1 from
upstream sources and rerunning the test makes it succeed.

This does come across as a regression in bash.


Reported-At: https://bugs.launchpad.net/bugs/1997093

        I have unfortunately not been able to create a simple reproducer but
the following steps will give you a reproducing environment:

git clone https://github.com/ovn-org/ovn.git
cd ovn
git submodule update --init --recursive
cd ovs
./boot && ./configure && make
cd ..
./boot && ./configure && make
make check TESTSUITEFLAGS="837"

        Applying this patch, reverting a change made to
optimize_connection_fork in bash 5.2, fixes the problem for me:

diff --git a/builtins/evalstring.c b/builtins/evalstring.c
index 264a836b..36ecd310 100644
--- a/builtins/evalstring.c
+++ b/builtins/evalstring.c
@@ -132,8 +132,7 @@ optimize_connection_fork (command)
   if (command->type == cm_connection &&
       (command->value.Connection->connector == AND_AND || 
command->value.Connection->connector == OR_OR || 
command->value.Connection->connector == ';') &&
       (command->value.Connection->second->flags & CMD_TRY_OPTIMIZING) &&
-      ((startup_state == 2 && should_suppress_fork 
(command->value.Connection->second)) ||
-       ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork 
(command->value.Connection->second, 0))))
+      should_suppress_fork (command->value.Connection->second))
       command->value.Connection->second->flags |= CMD_NO_FORK;
       command->value.Connection->second->value.Simple->flags |= CMD_NO_FORK;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]