On Tue, May 9, 2023 at 11:14?PM Tony Cook <tony@develop-help.com> wrote:
>
> On Wed, May 10, 2023 at 02:01:29PM +1000, Tony Cook wrote:
> > Darwin ARM: threaded locale issue, we may need to switch away from
> > uselocale etc, but Karl's the expert here. I don't have either kind
> > of Mac so I can't test this myself.
> > eg. https://perl5.test-smoke.org/report/5034120
>
> Karl doesn't have access either.
I can reproduce it. Without threads all tests pass but with -Dusethreads I get:
Failed 3 tests out of 2618, 99.89% okay.
../ext/XS-APItest/t/locale.t
../lib/locale.t
run/locale.t
ext/XS-APITest/locale.t has just this one failure:
not ok 7 - dot recognized in perl-controlled comma locale for SvNV
# Failed test 7 - dot recognized in perl-controlled comma locale for
SvNV at t/locale.t line 62
# got ""
# expected "1"
lib/locale.t has voluminous output but the following snip may indicate
what's going on:
ok 682 verify that isn't tainted
#
# The locale definitions
#
# af_ZA.ISO8859-1 af_ZA.ISO8859-15 af_ZA.UTF-8 be_BY.CP1131
# be_BY.CP1251 be_BY.ISO8859-5 be_BY.UTF-8 bg_BG.CP1251
# bg_BG.UTF-8 ca_ES.ISO8859-1 ca_ES.ISO8859-15 ca_ES.UTF-8
# cs_CZ.ISO8859-2 cs_CZ.UTF-8 da_DK.ISO8859-1 da_DK.ISO8859-15
# da_DK.UTF-8 de_AT.ISO8859-1 de_AT.ISO8859-15 de_AT.UTF-8
# de_CH.ISO8859-1 de_CH.ISO8859-15 de_CH.UTF-8 de_DE.ISO8859-1
# de_DE.ISO8859-15 de_DE.UTF-8 el_GR.ISO8859-7 el_GR.UTF-8
# es_ES.ISO8859-1 es_ES.ISO8859-15 es_ES.UTF-8 et_EE.ISO8859-15
# et_EE.UTF-8 eu_ES.ISO8859-1 eu_ES.ISO8859-15 eu_ES.UTF-8
# fi_FI.ISO8859-1 fi_FI.ISO8859-15 fi_FI.UTF-8 fr_BE.ISO8859-1
# fr_BE.ISO8859-15 fr_BE.UTF-8 fr_CA.ISO8859-1 fr_CA.ISO8859-15
# fr_CA.UTF-8 fr_CH.ISO8859-1 fr_CH.ISO8859-15 fr_CH.UTF-8
# fr_FR.ISO8859-1 fr_FR.ISO8859-15 fr_FR.UTF-8 hr_HR.ISO8859-2
# hr_HR.UTF-8 hu_HU.ISO8859-2 hu_HU.UTF-8 hy_AM.ARMSCII-8
# hy_AM.UTF-8 is_IS.ISO8859-1 is_IS.ISO8859-15 is_IS.UTF-8
# it_CH.ISO8859-1 it_CH.ISO8859-15 it_CH.UTF-8 it_IT.ISO8859-1
# it_IT.ISO8859-15 it_IT.UTF-8 kk_KZ.PT154 kk_KZ.UTF-8
# lt_LT.UTF-8 nl_BE.ISO8859-1 nl_BE.ISO8859-15 nl_BE.UTF-8
# nl_NL.ISO8859-1 nl_NL.ISO8859-15 nl_NL.UTF-8 no_NO.ISO8859-1
# no_NO.ISO8859-15 no_NO.UTF-8 pl_PL.ISO8859-2 pl_PL.UTF-8
# pt_BR.ISO8859-1 pt_BR.UTF-8 pt_PT.ISO8859-1 pt_PT.ISO8859-15
# pt_PT.UTF-8 ro_RO.ISO8859-2 ro_RO.UTF-8 ru_RU.CP1251
# ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R ru_RU.UTF-8
# sk_SK.ISO8859-2 sk_SK.UTF-8 sl_SI.ISO8859-2 sl_SI.UTF-8
# sr_YU.ISO8859-2 sr_YU.ISO8859-5 sr_YU.UTF-8 sv_SE.ISO8859-1
# sv_SE.ISO8859-15 sv_SE.UTF-8 tr_TR.ISO8859-9 tr_TR.UTF-8
# uk_UA.ISO8859-5 uk_UA.KOI8-U uk_UA.UTF-8
#
# on your system may have errors because the locale test 427
# "Verify that a different locale radix works when doing "==" with a constant"
# failed in those locales.
#
# If your users are not using these locales you are safe for the moment,
# but please report this failure first to perlbug@perl.org using the
# perlbug script (as described in the INSTALL file) so that the exact
# details of the failures can be sorted out first and then your operating
# system supplier can be alerted about these anomalies.
#
#
Here's the detail on the last one:
% ./perl -I../lib harness run/locale.t
run/locale.t .. 1/? # Failed test 8 - format() does not look at
LC_NUMERIC without 'use locale' at run/locale.t line 178
# got "4.0"
# expected "4.2"
# PROG:
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 9 - format() looks at LC_NUMERIC with 'use locale' at
run/locale.t line 188
# got "4,0"
# expected "4,2"
# PROG:
# use POSIX;
# use locale;
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 11 - format() does not look at LC_NUMERIC with 'use
locale qw(:collate :characters :collate :ctype :monetary :time)' at
run/locale.t line 218
# got "4.0"
# expected "4.2"
# PROG:
# use locale qw(:collate :characters :collate :ctype :monetary :time);
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 12 - format() looks at LC_NUMERIC with 'use locale' at
run/locale.t line 230
# got "4,0"
# expected "4,2"
# PROG:
# use locale;
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 13 - format() looks at LC_NUMERIC with 'use locale
":!collate"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":!collate";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 14 - format() looks at LC_NUMERIC with 'use locale
":not_collate"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":not_collate";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 15 - format() looks at LC_NUMERIC with 'use locale
":!characters"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":!characters";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 16 - format() looks at LC_NUMERIC with 'use locale
":not_characters"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":not_characters";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 17 - format() looks at LC_NUMERIC with 'use locale
":!collate"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":!collate";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 18 - format() looks at LC_NUMERIC with 'use locale
":not_collate"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":not_collate";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 19 - format() looks at LC_NUMERIC with 'use locale
":!ctype"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":!ctype";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 20 - format() looks at LC_NUMERIC with 'use locale
":not_ctype"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":not_ctype";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 21 - format() looks at LC_NUMERIC with 'use locale
":!monetary"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":!monetary";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 22 - format() looks at LC_NUMERIC with 'use locale
":not_monetary"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":not_monetary";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 23 - format() looks at LC_NUMERIC with 'use locale
":!time"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":!time";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 24 - format() looks at LC_NUMERIC with 'use locale
":not_time"' at run/locale.t line 243
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":not_time";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 25 - format() looks at LC_NUMERIC with 'use locale
":numeric"' at run/locale.t line 257
# got "4,0"
# expected "4,2"
# PROG:
# use locale ":numeric";
# format STDOUT =
# @.#
# 4.179
# .
# write;
# STATUS: 0
# Failed test 26 - too late to look at the locale at write() time at
run/locale.t line 269
# got "4.0"
# expected "4.2"
# PROG:
# format STDOUT =
# @.#
# 4.179
# .
# { use locale; write; }
# STATUS: 0
# Failed test 27 - too late to ignore the locale at write() time at
run/locale.t line 280
# got "4,0"
# expected "4,2"
# PROG:
# use locale;
# format STDOUT =
# @.#
# 4.179
# .
# { no locale; write; }
# STATUS: 0
# Failed test 30 - sprintf() and printf() look at LC_NUMERIC
regardless of constant folding at run/locale.t line 324
# got "4 4 4 4 "
# expected "4,2 4,2 4,2 4,2 "
# PROG:
# use locale;
# use POSIX qw(locale_h);
# my $in = 4.2;
# printf("%g %g %s %s ", $in, 4.2, sprintf("%g", $in),
sprintf("%g", 4.2));
# STATUS: 0
# Failed test 31 - Uses the above test to verify that on Windows the
system default locale has lower priority than LC_NUMERIC at
run/locale.t line 335
# got "4 4 4 4 "
# expected "4,2 4,2 4,2 4,2 "
# PROG:
# use locale;
# use POSIX qw(locale_h);
# my $in = 4.2;
# printf("%g %g %s %s ", $in, 4.2, sprintf("%g", $in),
sprintf("%g", 4.2));
# STATUS: 0
run/locale.t .. 32/? # Failed test 37 - Thread join doesn't disrupt
calling thread at run/locale.t line 457
# got "1\n1\n1\n1"
# expected "1.25\n1.25\n1.25\n1"
# PROG:
# use threads;
#
# my $x = eval "1.25";
# print "$x", "
# "; # number is ok before thread
# my $str_x = "$x";
#
# my $thr = threads->create(sub {});
# $thr->join();
#
# print "$x
# "; # number stringifies the same after thread
#
# my $y = eval "1.25";
# print "$y
# "; # number is ok after threads
# print "$y" eq "$str_x" || 0; # new number
stringifies the same as old number
# STATUS: 0
# Failed test 38 - POSIX::strtod() uses underlying locale at
run/locale.t line 482
# got "1"
# expected "1.5"
# PROG:
# use POSIX;
# POSIX::setlocale(POSIX::LC_NUMERIC(),"af_ZA.ISO8859-1");
# my $one_point_5 = POSIX::strtod("1,5");
# $one_point_5 =~ s/0+$//; # Remove any trailing zeros
# print $one_point_5, "
# ";
# STATUS: 0
run/locale.t .. Failed 24/43 subtests
(less 2 skipped subtests: 17 okay)
Test Summary Report
-------------------
run/locale.t (Wstat: 0 Tests: 43 Failed: 24)
Failed tests: 8-9, 11-27, 30-32, 37-38
Files=1, Tests=43, 1 wallclock secs ( 0.00 usr 0.00 sys + 0.36 cusr
0.28 csys = 0.64 CPU)
Result: FAIL
Finished test run at Wed May 10 14:33:42 2023.
This was with:
% ./perl -I../lib -V
Summary of my perl5 (revision 5 version 37 subversion 12) configuration:
Commit id: a12bd18fcb7a0a71c07c21e4028d7ee45474a8f9
Platform:
osname=darwin
osvers=22.4.0
archname=darwin-thread-multi-2level
uname='darwin priamond.local 22.4.0 darwin kernel version 22.4.0:
mon mar 6 21:00:41 pst 2023; root:xnu-8796.101.5~3release_arm64_t8103
arm64 '
config_args='-Dusedevel -Dusethreads -des'
hint=recommended
useposix=true
d_sigaction=define
useithreads=define
usemultiplicity=define
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='cc'
ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.3
-fno-strict-aliasing -pipe -fstack-protector-strong
-I/usr/local/include'
optimize='-O3'
cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.3
-fno-strict-aliasing -pipe -fstack-protector-strong
-I/usr/local/include'
ccversion=''
gccversion='Apple LLVM 12.0.0 (clang-1200.0.32.28)'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=8
longdblkind=0
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -mmacosx-version-min=13.3 -fstack-protector-strong
-L/usr/local/lib'
libpth=/usr/local/lib
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/lib
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib
/Library/Developer/CommandLineTools/usr/lib /usr/lib
libs=
perllibs=
libc=
so=dylib
useshrplib=false
libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=bundle
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' -mmacosx-version-min=13.3 -bundle -undefined
dynamic_lookup -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_LONG_DOUBLE
HAS_STRTOLD
HAS_TIMES
MULTIPLICITY
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_SIPHASH13
PERL_HASH_USE_SBOX32
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_DEVEL
PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_ITHREADS
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
USE_REENTRANT_API
USE_THREAD_SAFE_LOCALE
Built under darwin
Compiled at May 10 2023 14:17:00
@INC:
../lib
/usr/local/lib/perl5/site_perl/5.37.12/darwin-thread-multi-2level
/usr/local/lib/perl5/site_perl/5.37.12
/usr/local/lib/perl5/5.37.12/darwin-thread-multi-2level
/usr/local/lib/perl5/5.37.12
/usr/local/lib/perl5/site_perl
Let me know if there is something else I can do on this.