Bug 1464403 - glibc: memcmp-avx2-movbe.S lacks saturating subtraction for between_2_3
glibc: memcmp-avx2-movbe.S lacks saturating subtraction for between_2_3
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Florian Weimer
Fedora Extras Quality Assurance
: Regression, Reopened
Depends On:
Blocks: 1464244
  Show dependency treegraph
Reported: 2017-06-23 07:06 EDT by Petr Pisar
Modified: 2017-06-23 16:36 EDT (History)
17 users (show)

See Also:
Fixed In Version: glibc-2.25.90-15.fc27
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-06-23 16:36:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Reproducer (178 bytes, text/plain)
2017-06-23 08:00 EDT, Petr Pisar
no flags Details

  None (edit)
Description Petr Pisar 2017-06-23 07:06:22 EDT
perl-5.26.0-393.fc27 fails to build on F27 on x86_64 in mock and koji only because two tests fail now:

uni/opcroak.t ...................................................... ok
# Failed test 2 - comp/stash.t test 1 at uni/package.t line 44
#      got "\x{30cb}\x{30e5}\x{30fc}:\x{a46d}\x{291}:\x{c555}\x{187}:bar"
# expected "bar:\x{30cb}\x{30e5}\x{30fc}:\x{a46d}\x{291}:\x{c555}\x{187}"
uni/package.t ...................................................... 
Failed 1/18 subtests 
uni/parser.t ....................................................... ok
../cpan/Unicode-Collate/t/illegalp.t ............................... 
Failed 1/17 subtests 

Koschei reports this change in build root:

        glibc-common 	2.25.90-6.fc27 	> 	2.25.90-7.fc27
	binutils 	2.28-8.fc27 	> 	2.28-9.fc27
	perl-File-Path 	2.13-2.fc27 	> 	2.14-1.fc27
	libcrypt-nss 	2.25.90-6.fc27 	> 	2.25.90-7.fc27
	systemd-libs 	233-2.fc27 	> 	233-4.fc27
	glibc 	2.25.90-6.fc27 	> 	2.25.90-7.fc27
	glibc-devel 	2.25.90-6.fc27 	> 	2.25.90-7.fc27
	openssl-libs 	1:1.1.0f-2.fc27 	> 	1:1.1.0f-3.fc27
	python3-setuptools 	35.0.2-1.fc27 	> 	36.0.1-1.fc27
	pcre 	8.40-7.fc27 	> 	8.41-0.1.RC1.fc27
	libffi 	3.1-10.fc26 	> 	3.1-11.fc27
	glibc-headers 	2.25.90-6.fc27 	> 	2.25.90-7.fc27
	nss-softokn-freebl 	3.30.2-2.fc27 	> 	3.31.0-2.fc27
	glibc-all-langpacks 	2.25.90-6.fc27 	> 	2.25.90-7.fc27
	expat 	2.2.0-2.fc26 	> 	2.2.1-1.fc27
	kernel-headers 	4.12.0-0.rc4.git3.1.... 	> 	4.12.0-0.rc5.git2.1....
	nss-util 	3.30.2-3.fc27 	> 	3.31.0-2.fc27
	nspr 	4.14.0-2.fc27 	> 	4.15.0-1.fc27
	python3-appdirs 	1.4.0-10.fc26 	< 	
	nss-softokn 	3.30.2-2.fc27 	> 	3.31.0-2.fc27
	python3-six 	1.10.0-8.fc26 	< 	
	gdb-headless 	8.0-13.fc27 	> 	8.0-17.fc27
	system-python 	3.6.1-7.fc27 	< 	
	curl 	7.54.0-5.fc27 	> 	7.54.1-2.fc27
	libcurl 	7.54.0-5.fc27 	> 	7.54.1-2.fc27
	python3-packaging 	16.8-5.fc27 	< 	
	audit-libs 	2.7.6-1.fc27 	> 	2.7.7-1.fc27

There is also different kernel (passing: 4.10.14-200.fc25, failing: 4.11.5-200.fc25).

I cannot reproduce in a virtual machine. It can be reproduced in a mock enviroment with F27 build root only:

$ mock --no-clean --no-cleanup-after -r fedora-rawhide-x86_64  --chroot 'cd /builddir/build/BUILD/perl-5.26.0/; POSIXLY_CORRECT=y TERM=vt100 LANG=en_US.UTF-8 LD_PRELOAD=$PWD/libperl.so ./perl -I$PWD/lib t/uni/package.t'
INFO: mock.py version 1.4.2 starting (python version = 3.5.3)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: chroot init
WARNING: For multilib systems, both architectures of nosync library need to be installed
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled dnf cache
Start: cleaning dnf metadata
Finish: cleaning dnf metadata
INFO: enabled HW Info plugin
Mock Version: 1.4.2
INFO: Mock Version: 1.4.2
Finish: chroot init
INFO: Running in chroot: ['cd /builddir/build/BUILD/perl-5.26.0/; POSIXLY_CORRECT=y TERM=vt100 LANG=en_US.UTF-8 LD_PRELOAD=$PWD/libperl.so ./perl -I$PWD/lib t/uni/package.t']
Start: chroot ['cd /builddir/build/BUILD/perl-5.26.0/; POSIXLY_CORRECT=y TERM=vt100 LANG=en_US.UTF-8 LD_PRELOAD=$PWD/libperl.so ./perl -I$PWD/lib t/uni/package.t']
# Failed test 2 - comp/stash.t test 1 at t/uni/package.t line 44
#      got "\x{30cb}\x{30e5}\x{30fc}:\x{a46d}\x{291}:\x{c555}\x{187}:bar"
# expected "bar:\x{30cb}\x{30e5}\x{30fc}:\x{a46d}\x{291}:\x{c555}\x{187}"
ok 1 - sanity check. If we got this far, UTF-8 in package names is legal.
not ok 2 - comp/stash.t test 1
ok 3 - comp/stash.t test 2
ok 4 - comp/stash.t test 3
ok 5 - comp/stash.t test 4
ok 6 - comp/stash.t test 5
ok 7 - comp/stash.t test 6
ok 8 - comp/stash.t test 7
ok 9 - comp/stash.t test 8
ok 10 - comp/stash.t test 9
ok 11 - comp/stash.t test 10
ok 12 - comp/stash.t test 11
ok 13 - comp/stash.t test 12
ok 14 - comp/stash.t test 13
ok 15 - comp/stash.t test 14
ok 16 - comp/package_block.t test
ok 17 - latin1->meth works
ok 18 - utf8->meth works
Finish: chroot ['cd /builddir/build/BUILD/perl-5.26.0/; POSIXLY_CORRECT=y TERM=vt100 LANG=en_US.UTF-8 LD_PRELOAD=$PWD/libperl.so ./perl -I$PWD/lib t/uni/package.t']
Finish: run

The test fails even when run against previous /usr/bin/perl.

I suspected POSIXLY_CORRECT=y environment variable that really somehow influences lexicographical sorting performed by the test. But it's value does not have any effect on the test.
Comment 1 Petr Pisar 2017-06-23 07:19:13 EDT
I found the trigger.

It's triggered by updating glibc from 2.25.90-6.fc27 to 2.25.90-7.fc27. After the update, the tests fail in mock.
Comment 2 Petr Pisar 2017-06-23 08:00 EDT
Created attachment 1290996 [details]

Install F27 build root, install perl package and execute attached Perl script in mock (or chroot) environment. Since glibc-2.25.90-7.fc27.x86_64 it prints this:

# perl test
got      = <ꑭʑ:bar>
expected = <bar:ꑭʑ>

Locale does not matter.
Comment 3 Petr Pisar 2017-06-23 08:05:06 EDT
glibc maintainer, could you please bisect glibc changes and pinpoint the cause?
Comment 4 Florian Weimer 2017-06-23 08:09:46 EDT
perl needs rebuilding.

*** This bug has been marked as a duplicate of bug 1464244 ***
Comment 5 Florian Weimer 2017-06-23 08:11:14 EDT
Sorry, disregard that.
Comment 6 Petr Pisar 2017-06-23 08:17:04 EDT
This happened before the xlocale.h removal. Please note it exhibits on x86_64 only.
Comment 7 Florian Weimer 2017-06-23 08:22:55 EDT
(In reply to Petr Pisar from comment #6)
> This happened before the xlocale.h removal. Please note it exhibits on
> x86_64 only.

Agreed, I'm working on it.
Comment 8 Florian Weimer 2017-06-23 09:00:31 EDT
The bug is a non-saturating subtract in the new memcmp.
Comment 9 Petr Pisar 2017-06-23 09:05:12 EDT
Great. There is a coreutils-only reproducer:


# printf 'bar\nꑭʑ\n' | LC_ALL=C sort
# printf 'bar\nꑭʑ\n' | LC_ALL=C.UTF-8 sort


# printf 'bar\nꑭʑ\n' | LC_ALL=C sort
# printf 'bar\nꑭʑ\n' | LC_ALL=C.UTF-8 sort
Comment 10 Florian Weimer 2017-06-23 09:22:05 EDT
Patch posted upstream:

Comment 11 Florian Weimer 2017-06-23 09:54:43 EDT
I hope the patch will be reviewed upstream soon enough.  If not, I'll put the fix into rawhide as a Fedora-specific patch later today, so that perl can be built again.
Comment 12 Jason Tibbitts 2017-06-23 16:33:06 EDT
The problematic Perl test appears to be passing now.

Note You need to log in before you can comment on or make changes to this bug.