lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Apr 2021 15:33:29 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Frederic Weisbecker <frederic@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all
 native language

On Thu, Apr 01, 2021 at 11:08:02PM +0200, Frederic Weisbecker wrote:
> On Thu, Apr 01, 2021 at 02:02:53PM -0700, Paul E. McKenney wrote:
> > On Thu, Apr 01, 2021 at 10:41:13PM +0200, Frederic Weisbecker wrote:
> > > On Thu, Apr 01, 2021 at 01:40:22PM -0700, Paul E. McKenney wrote:
> > > > On Thu, Apr 01, 2021 at 10:31:12PM +0200, Frederic Weisbecker wrote:
> > > > > On Thu, Apr 01, 2021 at 11:51:16AM -0700, Paul E. McKenney wrote:
> > > > > > On Thu, Apr 01, 2021 at 03:26:02PM +0200, Frederic Weisbecker wrote:
> > > > > > > Grepping for "CPU" on lscpu output isn't always successful, depending
> > > > > > > on the local language setting. As a result, the build can be aborted
> > > > > > > early with:
> > > > > > > 
> > > > > > > 	"make: the '-j' option requires a positive integer argument"
> > > > > > > 
> > > > > > > Prefer a more generic solution.
> > > > > > > 
> > > > > > > Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> > > > > > 
> > > > > > Good catch, applied, thank you!
> > > > > > 
> > > > > > There is a similar construct in kvm-remote.sh, so I added a similar
> > > > > > fix to your patch.
> > > > > > 
> > > > > > But what about this in functions.sh?
> > > > > > 
> > > > > > nt="`lscpu | grep '^NUMA node0' | sed -e 's/^[^,]*,\([0-9]*\),.*$/\1/'`"
> > > > > > 
> > > > > > I am guessing that "node0" is human-language-independent, but is "NUMA"?
> > > > > 
> > > > > I thought they wouldn't bother translating that, but they did...
> > > > > 
> > > > >     NUMA node0 CPU(s):               0-7
> > > > > 
> > > > > becomes:
> > > > > 
> > > > >     Nœud NUMA 0 de processeur(s) : 0-7
> > > > > 
> > > > > Not sure about the best way to fix it.
> > > > 
> > > > The rude and crude fix is for the scripts to force the local language
> > > > to English.  ;-)
> > > 
> > > I don't have a better answer :o)
> > 
> > If you set the environment variable LANG to en_US.UTF-8, does that
> > make things work for you?  Huh.  Setting it to fr_FR.UTF-8 does not
> > shift lscpu out of English for me, so I am guessing "no".
> 
> Maybe that language isn't installed in your system. I would expect
> en_US.UTF-8 to be supported pretty much everywhere though. At least it
> works for me with: "LANG=en_US.UTF-8 lscpu".
> 
> Thanks.

How about like this?  I put this only in kvm.sh for the moment, but
if these keep cropping up I will just hit all the scripts.  ;-)

							Thanx, Paul

------------------------------------------------------------------------

commit 4ca332016ed81c15ebb3b744dbfc462281c544b8
Author: Paul E. McKenney <paulmck@...nel.org>
Date:   Thu Apr 1 15:26:56 2021 -0700

    torture:  Set kvm.sh language to English
    
    Some of the code invoked directly and indirectly from kvm.sh parses
    the output of commands.  This parsing assumes English, which can cause
    failures if the user has set some other language.  In a few cases,
    there are language-independent commands available, but this is not
    always the case.  Therefore, as an alternative to polyglot parsing,
    this commit sets the LANG environment variable to en_US.UTF-8.
    
    Reported-by: Frederic Weisbecker <frederic@...nel.org>
    Signed-off-by: Paul E. McKenney <paulmck@...nel.org>

diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index fab3bd9..390bb97 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -20,6 +20,9 @@ mkdir $T
 
 cd `dirname $scriptname`/../../../../../
 
+# This script knows only English.
+LANG=en_US.UTF-8; export LANG
+
 dur=$((30*60))
 dryrun=""
 KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ