[Bug 1988481] [NEW] txt2regex autopkgtest regression with bash 5.2

Launchpad Bug Tracker 1988481 at bugs.launchpad.net
Fri Sep 2 18:14:57 UTC 2022


You have been subscribed to a public bug by Nick Rosbrook (enr0n):

Here is a link to a failed autopkgtest log:
https://autopkgtest.ubuntu.com/results/autopkgtest-
kinetic/kinetic/amd64/t/txt2regex/20220827_144122_eb850@/log.gz. The
relevant snippet is this:

[FAILED #53, line 77] txt2regex --all --history '241ยค\'
@@ -1,23 +1,23 @@
- Regex awk       : [\\]
- Regex chicken   : [\\\\]
+ Regex awk       : [\]
+ Regex chicken   : [\\]
  Regex ed        : [\]
  Regex egrep     : [\]
- Regex emacs     : [\\\\]
- Regex expect    : [\\]
+ Regex emacs     : [\\]
+ Regex expect    : [\]
  Regex find      : [\]
- Regex gawk      : [\\]
+ Regex gawk      : [\]
  Regex grep      : [\]
- Regex javascript: [\\]
- Regex lex       : [\\]
- Regex mawk      : [\\]
- Regex mysql     : [\\\\]
- Regex perl      : [\\]
- Regex php       : [\\\\]
- Regex postgres  : [\\]
+ Regex javascript: [\]
+ Regex lex       : [\]
+ Regex mawk      : [\]
+ Regex mysql     : [\\]
+ Regex perl      : [\]
+ Regex php       : [\\]
+ Regex postgres  : [\]
  Regex procmail  : [\]
- Regex python    : [\\]
+ Regex python    : [\]
  Regex sed       : [\]
- Regex tcl       : [\\]
+ Regex tcl       : [\]
  Regex vi        : [\]
- Regex vim       : [\\]
+ Regex vim       : [\]
 

The issue comes down to how the following expression -- which is
simulating a section of txt2regex.sh -- is evaluated in bash 5.2 vs
prior versions:

$ uin='[\]'; escape_metachar='\\'; echo
${uin/\\/$escape_metachar$escape_metachar}

Namely, we have:

  $ bash --version | head -1
  GNU bash, version 5.2.0(1)-rc2 (x86_64-pc-linux-gnu)
  $ uin='[\]'; escape_metachar='\\'; echo ${uin/\\/$escape_metachar$escape_metachar}
  [\\]

  vs.

  $ bash --version | head -1
  GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
  $ uin='[\]'; escape_metachar='\\'; echo ${uin/\\/$escape_metachar$escape_metachar}
  [\\\\]

** Affects: txt2regex (Ubuntu)
     Importance: Undecided
     Assignee: Nick Rosbrook (enr0n)
         Status: In Progress


** Tags: update-excuse
-- 
txt2regex autopkgtest regression with bash 5.2
https://bugs.launchpad.net/bugs/1988481
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list