Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#73178 - [bash] read file as string cause random result

Attached to Project: Arch Linux
Opened by bilabila (bilabila) - Tuesday, 28 December 2021, 14:16 GMT
Last edited by Antonio Rojas (arojas) - Friday, 17 June 2022, 16:24 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Felix Yan (felixonmars)
Levente Polyak (anthraxx)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
use bash script to read file as a string and do some processing, but found random result(e.g. the length of string), and bash 4.4 is fine.

Additional info:
* package version(s): 5.1.12(1)-release
* config and/or log files etc.: no ~/.bashrc or ~/.bash_profile.

Steps to reproduce:
put b beside a and run ./a for multiple times, should get different results.

My result:
~ ./a
6143 5.1.12(1)-release
~ ./a
6144 5.1.12(1)-release
~ ./a
6143 5.1.12(1)-release
~ ./a 6143 5.1.12(1)-release
~ ./a
6143 5.1.12(1)-release
   a (0.1 KiB)
   b (6 KiB)
This task depends upon

Closed by  Antonio Rojas (arojas)
Friday, 17 June 2022, 16:24 GMT
Reason for closing:  Fixed
Comment by Dennis B (swm) - Thursday, 19 May 2022, 14:00 GMT
Fixed upstream with bash 5.1.014, included in package bash 5.1.016-1.

See the patch: https://lists.gnu.org/archive/html/bug-bash/2022-01/msg00009.html
and this mailthread: https://lists.gnu.org/archive/html/bug-bash/2022-02/msg00145.html

I can confirm that the bug is not reproducible with bash 5.1.016-1.

Loading...