Bug 684293

Summary: ISO-8859-2 string with LC_ALL=*.utf-8 makes bash loop forever
Product: [Fedora] Fedora Reporter: Michal Hlavinka <mhlavink>
Component: bashAssignee: Roman Rakus <rrakus>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: maxamillion, rrakus, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-31 14:02:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Hlavinka 2011-03-11 17:45:38 UTC
Description of problem:
I was working on script for fixing broken non-utf8 file names (qt/kde can't handle them well), but found out that bash have some problems with iso-8859-2 strings when locale is set to utf-8

Version-Release number of selected component (if applicable):
bash-4.2.7-1.fc15.x86_64

How reproducible:
always

Steps to Reproduce:
1. echo foo | tr [$'\xFD'$'\xBA'] [$'\xFD'$'\xBE']
  
Actual results:
bash loops with 100 % CPU

Expected results:
foo


Additional info:
Tested with ksh and mksh shells and it works there. When you set LC_ALL=en_US.iso-8859-1 then it works in bash too:

LC_ALL=en_US.iso-8859-1; echo foo | tr [$'\xFD'$'\xBA'] [$'\xFD'$'\xBE']

prints "foo" as expected.

Comment 1 Roman Rakus 2011-03-14 09:00:31 UTC
Thanks for the report. The bug is in the bash globbing.
Easy reproducer:
[$'\xFD'$'\xBA']

Reported upstream.

Comment 2 Fedora Update System 2011-03-15 10:09:15 UTC
bash-4.2.7-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/bash-4.2.7-2.fc15

Comment 3 Fedora Update System 2011-03-31 13:58:03 UTC
bash-4.2.8-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/bash-4.2.8-2.fc15

Comment 4 Roman Rakus 2011-03-31 14:02:19 UTC
bash-4.2.8-2.fc15 reverts the previous change. It introduced another bugs (bug #689868). This bug will be fixed in future version, as announced upstream.