segfault in strncmp for avx2 at page boundaries

Bug #2001932 reported by Simon Chopin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GLibC
Fix Released
Medium
glibc (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Medium
Unassigned

Bug Description

[Impact]

Depending on size and location of the compared buffers in memory, particularly at the end of their respective pages, the AVX-2 specialized code for strncmp has an off-by-one bug that can cause a segfault.

See https://sourceware.org/bugzilla/show_bug.cgi?id=25933

[Test case]

> test_strncmp.c cat <<EOF
#include <sys/mman.h>
#include <string.h>
#include <stdio.h>

#define PAGE_SIZE 4096
#define VEC_SIZE 32

int main()
{
 int ret;
 char *s1 = (char *)mmap(0, PAGE_SIZE*2, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
 char *s2 = (char *)mmap(0, PAGE_SIZE*2, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
 mprotect(s1+PAGE_SIZE, PAGE_SIZE, PROT_NONE);
 mprotect(s2+PAGE_SIZE, PAGE_SIZE, PROT_NONE);
 memset(s1, 'a', PAGE_SIZE);
 memset(s2, 'a', PAGE_SIZE);
 s1[PAGE_SIZE-1] = 0;
 ret = strncmp(
            s1+PAGE_SIZE-VEC_SIZE*4-1,
            s2+PAGE_SIZE-VEC_SIZE*4,
            VEC_SIZE*4);
 printf("strncmp returned %d\n", ret);
 return ret;
}
EOF
gcc -o test_strncmp test_strncmp.c
./test_strncmp
# On buggy systems (e.g. mine), that last call segfaults

[Regression potential]

The fix could introduce another bug in the routine, and/or a performance regression.

Revision history for this message
In , Dpmendenhall (dpmendenhall) wrote :

Created attachment 12507
report

When the two strings being compared are at the end of their pages, __strncmp_avx2 will fall back to a one-byte-at-a-time loop named "cross_page_loop". This loop is incorrect if the length of the comparison exactly matches VEC_SIZE*4, which is 128 on my machine.

Full report in attached pdf.

Revision history for this message
In , Dpmendenhall (dpmendenhall) wrote :

Created attachment 12508
test case

I reduced the bug to a stand-alone test case, now attached.

Revision history for this message
In , Adhemerval Zanella (adhemerval-zanella) wrote :

By extending your testing to check for more alignments and sizes:

  for (size_t s = 99; s <= 4 * VEC_SIZE; s++)
    for (size_t s1a = 31; s1a < 32; s1a++)
      for (size_t s2a = 30; s2a < 32; s2a++)
        {
          ret = strncmp (s1 + PAGE_SIZE - s - s1a,
                         s1 + PAGE_SIZE - s - s2a,
                         s);
          assert (ret == 0);
        }

It seems that another page cross also requires fixing:

580 xorl %r8d, %r8d
581 /* If ECX > VEC_SIZE * 2, skip ECX - (VEC_SIZE * 2) bytes. */
582 subl $(VEC_SIZE * 2), %ecx
583 jle 1f
584 /* Skip ECX bytes. */
585 shrq %cl, %rdi
586 /* R8 has number of bytes skipped. */
587 movl %ecx, %r8d
588 1:
589 /* Before jumping back to the loop, set ESI to the number of
590 VEC_SIZE * 4 blocks before page crossing. */
591 movl $(PAGE_SIZE / (VEC_SIZE * 4) - 1), %esi
592
593 testq %rdi, %rdi
594 je L(back_to_loop)
595 tzcntq %rdi, %rcx
596 addq %r10, %rcx
597 /* Adjust for number of bytes skipped. */

It should not jump back to loop if the ecx is negative (as some cases).

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :
Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

Created attachment 12601
strncmp_avx2 patch for pr25933

Tested attached patch on

https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/pr25933/master

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

(In reply to Sunil Pandey from comment #4)
> Created attachment 12601 [details]
> strncmp_avx2 patch for pr25933
>
> Tested attached patch on
>
> https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/pr25933/master

Looks good. Please try this

diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
index 48d03a9f46..dabc3e7590 100644
--- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
@@ -256,6 +256,11 @@ L(next_3_vectors):
   vpmovmskb %ymm0, %ecx
   testl %ecx, %ecx
   jne L(return_3_vec_size)
+# ifdef USE_AS_STRNCMP
+ /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */
+ cmpq $(VEC_SIZE * 4), %r11
+ jbe L(zero)
+# endif
 L(main_loop_header):
   leaq (VEC_SIZE * 4)(%rdi), %rdx
   movl $PAGE_SIZE, %ecx

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

(In reply to H.J. Lu from comment #5)
> (In reply to Sunil Pandey from comment #4)
> > Created attachment 12601 [details]
> > strncmp_avx2 patch for pr25933
> >
> > Tested attached patch on
> >
> > https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/pr25933/master
>
> Looks good. Please try this
>
> diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S
> b/sysdeps/x86_64/multiarch/strcmp-avx2.S
> index 48d03a9f46..dabc3e7590 100644
> --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
> +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
> @@ -256,6 +256,11 @@ L(next_3_vectors):
> vpmovmskb %ymm0, %ecx
> testl %ecx, %ecx
> jne L(return_3_vec_size)
> +# ifdef USE_AS_STRNCMP
> + /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */
> + cmpq $(VEC_SIZE * 4), %r11
> + jbe L(zero)
> +# endif
> L(main_loop_header):
> leaq (VEC_SIZE * 4)(%rdi), %rdx
> movl $PAGE_SIZE, %ecx

It fixes the issue on my setup as expected.

$ ./test-strncmp
                        simple_strncmp stupid_strncmp __strncmp_avx2 __strncmp_sse42 __strncmp_ssse3 __strncmp_sse2
$ echo $?
0

$ git diff
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
index 48d03a9f46..84ffe2cd5c 100644
--- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
@@ -256,6 +256,11 @@ L(next_3_vectors):
        vpmovmskb %ymm0, %ecx
        testl %ecx, %ecx
        jne L(return_3_vec_size)
+# ifdef USE_AS_STRNCMP
+ /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */
+ cmpq $(VEC_SIZE * 4), %r11
+ jbe L(zero)
+# endif
 L(main_loop_header):
        leaq (VEC_SIZE * 4)(%rdi), %rdx
        movl $PAGE_SIZE, %ecx

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

(In reply to Sunil Pandey from comment #6)
> (In reply to H.J. Lu from comment #5)
> > (In reply to Sunil Pandey from comment #4)
> > > Created attachment 12601 [details]
> > > strncmp_avx2 patch for pr25933
> > >
> > > Tested attached patch on
> > >
> > > https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/pr25933/master
> >
> > Looks good. Please try this
> >
> > diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > b/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > index 48d03a9f46..dabc3e7590 100644
> > --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > @@ -256,6 +256,11 @@ L(next_3_vectors):
> > vpmovmskb %ymm0, %ecx
> > testl %ecx, %ecx
> > jne L(return_3_vec_size)
> > +# ifdef USE_AS_STRNCMP
> > + /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */
> > + cmpq $(VEC_SIZE * 4), %r11
> > + jbe L(zero)
> > +# endif
> > L(main_loop_header):
> > leaq (VEC_SIZE * 4)(%rdi), %rdx
> > movl $PAGE_SIZE, %ecx
>
> It fixes the issue on my setup as expected.
>
> $ ./test-strncmp
> simple_strncmp stupid_strncmp __strncmp_avx2
> __strncmp_sse42 __strncmp_ssse3 __strncmp_sse2
> $ echo $?
> 0
>

Did you run "make check"?

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

(In reply to H.J. Lu from comment #7)
> (In reply to Sunil Pandey from comment #6)
> > (In reply to H.J. Lu from comment #5)
> > > (In reply to Sunil Pandey from comment #4)
> > > > Created attachment 12601 [details]
> > > > strncmp_avx2 patch for pr25933
> > > >
> > > > Tested attached patch on
> > > >
> > > > https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/pr25933/master
> > >
> > > Looks good. Please try this
> > >
> > > diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > > b/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > > index 48d03a9f46..dabc3e7590 100644
> > > --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > > +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
> > > @@ -256,6 +256,11 @@ L(next_3_vectors):
> > > vpmovmskb %ymm0, %ecx
> > > testl %ecx, %ecx
> > > jne L(return_3_vec_size)
> > > +# ifdef USE_AS_STRNCMP
> > > + /* Check if VEC_SIZE * 4 already exceeded max compare count %r11 */
> > > + cmpq $(VEC_SIZE * 4), %r11
> > > + jbe L(zero)
> > > +# endif
> > > L(main_loop_header):
> > > leaq (VEC_SIZE * 4)(%rdi), %rdx
> > > movl $PAGE_SIZE, %ecx
> >
> > It fixes the issue on my setup as expected.
> >
> > $ ./test-strncmp
> > simple_strncmp stupid_strncmp __strncmp_avx2
> > __strncmp_sse42 __strncmp_ssse3 __strncmp_sse2
> > $ echo $?
> > 0
> >
>
> Did you run "make check"?

yes. it fixes strncmp and no new failure.

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

(In reply to Sunil Pandey from comment #8)
>
> yes. it fixes strncmp and no new failure.

I got

FAIL: wcsmbs/test-wcsncmp

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

(In reply to H.J. Lu from comment #9)
> (In reply to Sunil Pandey from comment #8)
> >
> > yes. it fixes strncmp and no new failure.
>
> I got
>
> FAIL: wcsmbs/test-wcsncmp

Please rebase users/hjl/pr25933/master branch.

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

I think L(loop_cross_page) block is incorrect. Please compare it against
L(loop_cross_page) block in strcmp-sse2-unaligned.S.

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

The bug is around

593 testq %rdi, %rdi
594 je L(back_to_loop)

At this point, there may be less than 4 vector length remaining:

Breakpoint 1, __strncmp_avx2 ()
    at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:594
594 je L(back_to_loop)
(gdb) p $r11
$2 = 97
(gdb) next
303 vmovdqa (%rax), %ymm0
(gdb)
304 vmovdqa VEC_SIZE(%rax), %ymm3
(gdb)
305 VPCMPEQ (%rdx), %ymm0, %ymm4
(gdb)
306 VPCMPEQ VEC_SIZE(%rdx), %ymm3, %ymm1
(gdb)
307 VPMINU %ymm0, %ymm4, %ymm4
(gdb)
308 VPMINU %ymm3, %ymm1, %ymm1
(gdb)
309 vmovdqa (VEC_SIZE * 2)(%rax), %ymm2
(gdb)
310 VPMINU %ymm1, %ymm4, %ymm0
(gdb)
311 vmovdqa (VEC_SIZE * 3)(%rax), %ymm3
(gdb)
312 VPCMPEQ (VEC_SIZE * 2)(%rdx), %ymm2, %ymm5
(gdb)
313 VPCMPEQ (VEC_SIZE * 3)(%rdx), %ymm3, %ymm6
(gdb)

Program received signal SIGSEGV, Segmentation fault.
__strncmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:313
313 VPCMPEQ (VEC_SIZE * 3)(%rdx), %ymm3, %ymm6
(gdb)

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

There are

L(loop_cross_page_2_vec):
        /* The first VEC_SIZE * 2 bytes match or are ignored. */
        vmovdqu (VEC_SIZE * 2)(%rax, %r10), %ymm2
        vmovdqu (VEC_SIZE * 3)(%rax, %r10), %ymm3
        VPCMPEQ (VEC_SIZE * 2)(%rdx, %r10), %ymm2, %ymm5
        VPMINU %ymm2, %ymm5, %ymm5
        VPCMPEQ (VEC_SIZE * 3)(%rdx, %r10), %ymm3, %ymm6
        VPCMPEQ %ymm7, %ymm5, %ymm5
        VPMINU %ymm3, %ymm6, %ymm6
        VPCMPEQ %ymm7, %ymm6, %ymm6

        vpmovmskb %ymm5, %edi
        vpmovmskb %ymm6, %esi

        salq $32, %rsi
        xorq %rsi, %rdi

        xorl %r8d, %r8d
        /* If ECX > VEC_SIZE * 2, skip ECX - (VEC_SIZE * 2) bytes. */
        subl $(VEC_SIZE * 2), %ecx
        jle 1f
        /* Skip ECX bytes. */
        shrq %cl, %rdi
        /* R8 has number of bytes skipped. */
        movl %ecx, %r8d
1:
        /* Before jumping back to the loop, set ESI to the number of
           VEC_SIZE * 4 blocks before page crossing. */
        movl $(PAGE_SIZE / (VEC_SIZE * 4) - 1), %esi

        testq %rdi, %rdi
        je L(back_to_loop)

When this branch is taken, there are (VEC_SIZE * 4) + %r10 matching bytes
starting at %rax, which may be >= the maximum offset.

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

Created attachment 12610
strncmp_avx2 patch.1 for pr25933

I ran glibc make check and all test pass with this patch.

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

(In reply to Sunil Pandey from comment #14)
> Created attachment 12610 [details]
> strncmp_avx2 patch.1 for pr25933
>
> I ran glibc make check and all test pass with this patch.

You removed loop unrolling. Please provide all relevant glibc micro
benchmarks data before and after your change.

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

Created attachment 12612
strcmp_avx2 micro benchmark comparison.

strcmp_avx2 micro benchmark before and after test with RDTSCP and CLOCK time.

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

Created attachment 12613
strncmp_avx2 micro benchmark comparison.

strncmp_avx2 micro benchmark before and after test with RDTSCP and CLOCK time.

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

Created attachment 12614
wcscmp_avx2 micro benchmark comparison.

wcscmp_avx2 micro benchmark before and after test with RDTSCP and CLOCK time.

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

Created attachment 12615
wcsncmp_avx2 micro benchmark comparison.

wcsncmp_avx2 micro benchmark before and after test with RDTSCP and CLOCK time.

Revision history for this message
In , Skpgkp2 (skpgkp2) wrote :

(In reply to H.J. Lu from comment #15)
> (In reply to Sunil Pandey from comment #14)
> > Created attachment 12610 [details]
> > strncmp_avx2 patch.1 for pr25933
> >
> > I ran glibc make check and all test pass with this patch.
>
> You removed loop unrolling. Please provide all relevant glibc micro
> benchmarks data before and after your change.

I beleive strncmp_avx2 changes affects

strcmp
strncmp
wcscmp
wcsncmp

Let me know if I miss any other relevant micro benchmark corresponding to this change.

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

(In reply to Sunil Pandey from comment #20)
> (In reply to H.J. Lu from comment #15)
> > (In reply to Sunil Pandey from comment #14)
> > > Created attachment 12610 [details]
> > > strncmp_avx2 patch.1 for pr25933
> > >
> > > I ran glibc make check and all test pass with this patch.
> >
> > You removed loop unrolling. Please provide all relevant glibc micro
> > benchmarks data before and after your change.
>
> I beleive strncmp_avx2 changes affects
>
> strcmp
> strncmp
> wcscmp
> wcsncmp
>
> Let me know if I miss any other relevant micro benchmark corresponding to
> this change.

I added more bench tests to users/hjl/pr25933/master branch. Please re-collect
numbers.

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :
Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

The release/2.31/master branch has been updated by H.J. Lu <email address hidden>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4e8a33a9590edc5c3a2cc5e726a3f2a73b66cdc0

commit 4e8a33a9590edc5c3a2cc5e726a3f2a73b66cdc0
Author: H.J. Lu <email address hidden>
Date: Sat Jul 4 09:45:21 2020 -0700

    NEWS: Mention BZ 25933 fix

Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

The release/2.30/master branch has been updated by H.J. Lu <email address hidden>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=94abcef26ebbe89861128a9a62741e410104a342

commit 94abcef26ebbe89861128a9a62741e410104a342
Author: H.J. Lu <email address hidden>
Date: Sat Jul 4 09:45:21 2020 -0700

    NEWS: Mention BZ 25933 fix

Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

The release/2.29/master branch has been updated by H.J. Lu <email address hidden>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83aaa1714428ba3b29315c8c5d14b1766b2ca3aa

commit 83aaa1714428ba3b29315c8c5d14b1766b2ca3aa
Author: H.J. Lu <email address hidden>
Date: Sat Jul 4 09:45:21 2020 -0700

    NEWS: Mention BZ 25933 fix

Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

The release/2.28/master branch has been updated by H.J. Lu <email address hidden>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f82072183ad5b328f6a7cb91868cb1709e85d96c

commit f82072183ad5b328f6a7cb91868cb1709e85d96c
Author: H.J. Lu <email address hidden>
Date: Sat Jul 4 09:45:21 2020 -0700

    NEWS: Mention BZ 25933 fix

Revision history for this message
In , Hjl-tools (hjl-tools) wrote :

Fixed for 2.32 and on 2.31/2.30/2.29/2.28 branches.

Simon Chopin (schopin)
Changed in glibc (Ubuntu):
status: New → Fix Released
Changed in glibc (Ubuntu Focal):
importance: Undecided → Medium
status: New → In Progress
Changed in glibc:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

You mention the potential for a performance regression in this bug and bug 2001975. Will there be any performance testing as a part of this SRU process?

It looks like there is a performance testing version of glibc at https://launchpad.net/~schopin/+archive/ubuntu/glibc-benchmark but that isn't explicitly called out in bug 1999551 (or the other two I mentioned) and I don't want to accept this based on my assumptions. Thanks!

Revision history for this message
Simon Chopin (schopin) wrote :

The performance part was just my attempt at imagining what could possibly go wrong. As it turns out, I hadn't seen that upstream had the exact same concern and so did microbenchmarks on the patch before accepting it. Sadly, those benchmarks aren't designed to run against installed libraries, they expect the full build tree to be available.

I looked at the bug and patch history of the affected routines, and haven't seen any report of performance regression.

The benchmarks in bug 1999551 were explicitly designed for the arm64 architecture, and so don't apply here.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Simon, or anyone else affected,

Accepted glibc into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/glibc/2.31-0ubuntu9.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in glibc (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (glibc/2.31-0ubuntu9.10)

All autopkgtests for the newly accepted glibc (2.31-0ubuntu9.10) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

4ti2/1.6.9+ds-2build1 (armhf)
android-platform-external-libunwind/8.1.0+r23-2 (armhf)
android-platform-frameworks-native/1:8.1.0+r23-2build1 (armhf)
apparmor/unknown (armhf)
apport/2.20.11-0ubuntu27.27 (armhf)
at-spi2-core/2.36.0-2 (armhf)
atk1.0/2.35.1-1ubuntu2 (armhf)
augustus/unknown (armhf)
autodock-vina/unknown (armhf)
autopilot-gtk/1.6.0 (armhf)
bgw-replstatus/1.0.4 (armhf)
biosquid/1.9g+cvs20050121-11 (armhf)
blackbox/0.70.1-38 (armhf)
bomstrip/9-13 (armhf)
borgbackup/1.1.15-1~ubuntu1.20.04.1 (armhf)
bosh/0.6-10 (armhf)
botch/0.22-3 (armhf)
brlaser/6-1build1 (armhf)
burp/2.2.18-2 (armhf)
butt/unknown (armhf)
cargo/0.66.0+ds0ubuntu0.libgit2-0ubuntu0.20.04 (armhf)
ceph/15.2.17-0ubuntu0.20.04.4 (armhf)
chafa/1.2.1-1 (armhf)
clearcut/1.0.9-5 (armhf)
consulfs/0.2.1-1 (armhf)
coturn/4.5.1.1-1.1ubuntu0.20.04.2 (armhf)
dune-common/2.6.0-4build1 (armhf)
fpc/3.0.4+dfsg-23 (arm64)
frameworkintegration/5.68.0-0ubuntu1 (armhf)
heaptrack/1.1.0+20180922.gitf752536-4build1 (armhf)
jsonnet/unknown (armhf)
kbibtex/0.8.1-1ubuntu5 (armhf)
kholidays/1:5.68.0-0ubuntu1 (armhf)
kiconthemes/5.68.0-0ubuntu1 (armhf)
kitemmodels/5.68.0-0ubuntu1 (armhf)
kpty/5.68.0-0ubuntu1 (armhf)
libdbd-pg-perl/3.10.4-1 (amd64)
libgdata/0.17.12-1 (armhf)
libtk-tablematrix-perl/1.23-7 (armhf)
linux-gcp-5.15/5.15.0-1036.44~20.04.1 (arm64)
linux-gke-5.15/5.15.0-1036.41~20.04.1 (arm64)
linux-lowlatency-hwe-5.15/5.15.0-75.82~20.04.1 (arm64)
linux-oracle-5.15/5.15.0-1037.43~20.04.1 (arm64)
magicrescue/1.1.10-3 (armhf)
mercurial/5.3.1-1ubuntu1 (amd64, armhf, ppc64el)
modemmanager-qt/5.68.0-0ubuntu1 (armhf)
node-ws/7.2.1-3 (armhf)
octave-image/2.12.0-2 (armhf)
osmo-mgw/1.4.0-1 (armhf)
php-excimer/1.0.0~git20190913.d82eaf7-1build1 (arm64)
polkit-qt-1/0.113.0-0ubuntu2 (armhf)
qcustomplot/2.0.1+dfsg1-1build1 (armhf)
qutip/4.4.1-6build1 (amd64)
r-cran-ps/1.3.2-2 (armhf)
ruby-bootsnap/1.4.6-1 (amd64)
ruby-standalone/2.7~2 (armhf)
ruby2.7/2.7.0-5ubuntu1.11 (armhf, s390x)
sks/1.1.6-14 (s390x)
systemd/245.4-4ubuntu3.22 (armhf)
threadweaver/5.68.0-0ubuntu1 (armhf)
tomb/2.7+dfsg2-1 (amd64)
umockdev/0.14.1-1ubuntu0.1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#glibc

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Simon Chopin (schopin) wrote :

Disregard the now-removed comment, it was for bug 2001975

This one was (also) verified in a fresh LXD container:

root@focal-glibc:~# gcc -o test_strncmp test_strncmp.c
root@focal-glibc:~# ./test_strncmp && echo OK
strncmp returned 0
OK

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote :

All autopkgtests for the newly accepted glibc (2.31-0ubuntu9.10) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

cargo/0.66.0+ds0ubuntu0.libgit2-0ubuntu0.20.04 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#glibc

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (glibc/2.31-0ubuntu9.11)

All autopkgtests for the newly accepted glibc (2.31-0ubuntu9.11) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

dune-common/2.6.0-4build1 (armhf)
khtml/5.68.0-0ubuntu1 (armhf)
kitemmodels/5.68.0-0ubuntu1 (armhf)
kpeople/5.68.0-0ubuntu1 (armhf)
kplotting/5.68.0-0ubuntu1 (armhf)
kpty/5.68.0-0ubuntu1 (armhf)
kxmlgui/5.68.0-0ubuntu2 (armhf)
linux-nvidia-tegra-5.15/5.15.0-1015.15~20.04.1 (arm64)
netplan.io/0.104-0ubuntu2~20.04.2 (s390x)
nfs-utils/1:1.3.4-2.5ubuntu3.4 (amd64)
ruby-stackprof/0.2.15-2 (arm64)
sbd/1.4.1-3 (s390x)
threadweaver/5.68.0-0ubuntu1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#glibc

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Simon, or anyone else affected,

Accepted glibc into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/glibc/2.31-0ubuntu9.12 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-focal
removed: verification-done verification-done-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (glibc/2.31-0ubuntu9.12)

All autopkgtests for the newly accepted glibc (2.31-0ubuntu9.12) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

aevol/5.0+ds-1build1 (arm64)
c-icap/1:0.5.3-3 (armhf)
cysignals/1.10.2+ds-4 (s390x)
dbus/1.12.16-2ubuntu2.3 (armhf)
docker.io/20.10.21-0ubuntu1~20.04.2 (amd64, arm64, ppc64el, s390x)
flatpak/1.6.5-0ubuntu0.4 (ppc64el)
kholidays/1:5.68.0-0ubuntu1 (armhf)
kplotting/5.68.0-0ubuntu1 (armhf)
libimage-sane-perl/5-1 (arm64)
libreoffice/1:6.4.7-0ubuntu0.20.04.8 (armhf)
libxml-libxslt-perl/1.99-1 (s390x)
libxml-quote-perl/1.02-4build2 (s390x)
linux-aws-5.15/5.15.0-1041.46~20.04.1 (arm64)
linux-gcp-5.15/5.15.0-1039.47~20.04.1 (arm64)
linux-lowlatency-hwe-5.15/5.15.0-79.88~20.04.1 (arm64)
mariadb-10.3/1:10.3.38-0ubuntu0.20.04.1 (armhf)
postgresql-12/12.15-0ubuntu0.20.04.1 (amd64)
r-bioc-delayedarray/0.12.2+dfsg-1 (armhf)
r-cran-curl/4.3+dfsg-1 (armhf)
systemd/245.4-4ubuntu3.22 (arm64)
threadweaver/5.68.0-0ubuntu1 (amd64)
utox/0.17.1-1 (arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#glibc

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Simon Chopin (schopin) wrote :

Verified in a fresh container:

root@focal-glibc:~# ./test_strncmp
strncmp returned 0
root@focal-glibc:~# dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-================-============-=================================
ii libc6:amd64 2.31-0ubuntu9.12 amd64 GNU C Library: Shared libraries

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for glibc has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glibc - 2.31-0ubuntu9.12

---------------
glibc (2.31-0ubuntu9.12) focal; urgency=medium

  * Drop SVE memcpy implementation due to kernel-related performance
    regression

glibc (2.31-0ubuntu9.11) focal; urgency=medium

  * Drop memcmp arm64 SIMD optimization patch due to performance regression
    on Raspberry Pi 3+ and 4

glibc (2.31-0ubuntu9.10) focal; urgency=medium

  [ Andrei Gherzan ]
  * d/p/lp1910312: Backport upstream fix for SEM_STAT_ANY (LP: #1910312)

  [ Simon Chopin ]
  * d/p/lp1999551/*: backport mem{cmp,cpy} optimizations for arm64 (LP: #1999551)
  * d/p/lp2001932/*: fix segfault in AVX2 strncmp (LP: #2001932)
  * d/p/lp2001975/*: fix overflow in AVX2 wcsncmp (LP: #2001975)

 -- Simon Chopin <email address hidden> Wed, 26 Jul 2023 09:44:39 +0200

Changed in glibc (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.