Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0
On 1/18/19 1:44 PM, Chet Ramey wrote:
On 1/17/19 6:21 PM, Drab Martin wrote:
Hi,
I have a problem with bash 5.0:
-----
machine1 ~ # bash --version
GNU bash, version 5.0.0(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
machine1 ~ # case "a-b" in *-*-*) echo "This is a BUG" ;; *) echo "This is
not a BUG" ;; esac
This is a BUG
I tried this on Gentoo.
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ cat x1
case "a-b" in *-*-*) echo "This is a BUG" ;; *) echo "This is not a BUG" ;;
esac
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ ./bash ./x1
This is not a BUG
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ uname -a
Linux ip-172-31-8-83.ec2.internal 4.9.76-gentoo-r1 #1 SMP Mon Mar 5
06:42:49 UTC 2018 x86_64 Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
GenuineIntel GNU/Linux
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ ./bash --version
GNU bash, version 5.0.0(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ ./bash
bash-5.0$ case "a-b" in *-*-*) echo "This is a BUG" ;; *) echo "This is not
a BUG" ;; esac
This is not a BUG
bash-5.0$ exit
exit
So you installed bash-5.0 as /bin/bash? And kept the /bin/sh symlink?
And still got these results?
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ sed 2q
/usr/share/gnuconfig/config.sub
#! /bin/sh
# Configuration validation subroutine script.
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Mar 1 2018 /bin/sh -> bash
Because when I run bash-5.0 against that configure script, I get:
ec2-user@ip-172-31-8-83 ~/build/bash-5.0 $ ./bash
/usr/share/gnuconfig/config.sub x86_64-pc-linux-gnu
x86_64-pc-linux-gnu
Hi Chet,
well, this is odd, because I tried again (manually patched the config.sub, so that it worked even if the bug is there)
and tried re-compiling bash-5.0 the standard way in Gentoo and the bug is still there.
Linux xenomorph 4.19.9-gentoo #1 SMP PREEMPT Sun Dec 16 00:43:14 CET 2018 x86_64 Intel(R) Core(TM) i7-3820QM CPU @
2.70GHz GenuineIntel GNU/Linux
machine1 ~ # ls -l /bin/bash
-rwxr-xr-x 1 root root 1364664 Jan 18 19:20 /bin/bash
machine1 ~ # ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jan 18 19:20 /bin/sh -> bash
machine1 ~ # /bin/bash --version
GNU bash, version 5.0.0(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
machine1 ~ # /bin/bash -c 'case "a-b" in *-*-*) echo "This is a BUG" ;; *) echo
"This is not a BUG" ;; esac'
This is a BUG
machine1 ~ # /usr/share/gnuconfig/config.sub.orig x86_64-pc-linux-gnu
Invalid configuration `x86_64-pc-linux-gnu': machine `x86_64-pc' not recognized
--------
The config.sub.orig is the renamed original, which I had to temporarily replace
with the patched variant.
--------
machine1 ~ # diff -Nau /usr/share/gnuconfig/config.sub.orig
/usr/share/gnuconfig/config.sub
--- /usr/share/gnuconfig/config.sub.orig 2019-01-18 04:42:40.962952315
+0100
+++ /usr/share/gnuconfig/config.sub 2019-01-18 19:17:18.879097624 +0100
@@ -361,10 +361,10 @@
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not
recognized 1>&2
- exit 1
- ;;
+# *-*-*)
+# echo Invalid configuration \`$1\': machine \`$basic_machine\' not
recognized 1>&2
+# exit 1
+# ;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
--------
Could it perhaps be a problem of some library, bash is using to work with the text or something? Or a problem of
miscompiling GCC perhaps?
Allright, I got it. It is a problem of faulty GCC 8.2 compiler. Just recompiled bash-5.0 with CFLAGS="-O2 -march=native
-pipe" and it works fine, now. Sorry to bother you with this. Will try to report bug to the GCC, when I have a bit more
time. Thanks anyway.