Your message dated Fri, 22 Mar 2024 19:46:53 +0100
with message-id <[email protected]>
and subject line Re: bash: fails to handle multibytes UTF-8 chars on 512 bytes
boundaries in some situations
has caused the Debian Bug report #993360,
regarding bash: fails to handle multibytes UTF-8 chars on 512 bytes boundaries
in some situations
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
993360: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993360
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: bash
Version: 5.1-2+b3
Severity: normal
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
Some bash scripts failed.
Here is a script reproducing the bug:
-----
#!/bin/bash
if [ "$FIRST_LEVEL" != "no" ] ; then
export FIRST_LEVEL=no
for i in {1..100} ; do
$BASH $0 $i || exit
done
exit
fi
s="§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§"
s="$s$s$s$s$s$s$s$s$s"
s="${s:0:256}"
prefix=1
for prefix in 1 ; do
str="1$s"
s1=$(echo "$str")
s2=$str
if [ "$s1" != "$s2" ] ; then
echo $LANG $prefix $1
echo ${s1:256} | od -t x1c
echo ${s2:256} | od -t x1c
exit 1
fi
done
----
With LANG=en_US.utf8 it shows the bug.
With LANG=C it produces no error
* What exactly did you do (or not do) that was effective (or
ineffective)?
If i put LANG=C in the script it run as expected.
I have tried with upstream bash and found:
if I use --without-bash-malloc on configure I get the bug.
if I do not use --without-bash-malloc on configure the bug disappears.
My gcc: gcc (Debian 10.2.1-6) 10.2.1 20210110
My libc6: Version: 2.31-13
The bug do show at every run, that why I try 100 times in the script.
*** End of the template - remove these template lines ***
-- System Information:
Debian Release: 11.0
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'proposed-updates'), (500,
'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages bash depends on:
ii base-files 11.1
ii debianutils 4.11.2
ii libc6 2.31-13
ii libtinfo6 6.2+20201114-2
Versions of packages bash recommends:
ii bash-completion 1:2.11-2
Versions of packages bash suggests:
pn bash-doc <none>
--- End Message ---
--- Begin Message ---
Version: 5.2.21-2
On Tue, 31 Aug 2021 13:17:30 +0200 Jens Henrik Leonhard Jensen
<[email protected]> wrote:
Package: bash
Version: 5.1-2+b3
Severity: normal
Here is a script reproducing the bug:
-----
#!/bin/bash
if [ "$FIRST_LEVEL" != "no" ] ; then
export FIRST_LEVEL=no
for i in {1..100} ; do
$BASH $0 $i || exit
done
exit
fi
s="§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§"
s="$s$s$s$s$s$s$s$s$s"
s="${s:0:256}"
prefix=1
for prefix in 1 ; do
str="1$s"
s1=$(echo "$str")
s2=$str
if [ "$s1" != "$s2" ] ; then
echo $LANG $prefix $1
echo ${s1:256} | od -t x1c
echo ${s2:256} | od -t x1c
exit 1
fi
done
----
With LANG=en_US.utf8 it shows the bug.
With LANG=C it produces no error
This issue does not seem to affect version 5.2.21-2 of bash.
Upstream commit
https://git.savannah.gnu.org/cgit/bash.git/commit/?id=72912fb8209105af961c851260a173115efe60be
has probably fixed the root cause of this problem.
Please reopen this bug if you can still reproduce this issue.
Regards,
--
Gioele Barabucc
--- End Message ---