[Bug 1797335] Re: strstr() on ubuntu18.04 8 times slower than on ubuntu16

Launchpad Bug Tracker 1797335 at bugs.launchpad.net
Mon Nov 2 18:40:35 UTC 2020


This bug was fixed in the package glibc - 2.27-3ubuntu1.3

---------------
glibc (2.27-3ubuntu1.3) bionic; urgency=medium

  [ Balint Reczey ]
  * debian/gbp.conf: Add initial configuration
  * debian/control.in/main: Add Vcs-* pointing to Ubuntu packaging repository
  * arm64: Enable searching shared libraries in atomics/ on LSE HW
  * Ship arm64 variant with LSE support in libc6-lse (LP: #1885012)
  * Run tests of libc6-lse on HW supporting LSE
  * debian/patches/git-updates.diff: update from upstream stable branch
    - pthread_cond_broadcast: Fix waiters-after-spinning case
    - Fix SSe2-based memmove corrupting memory (CVE-2017-18269)
    - Fix strstr() performance regression on Haswell processors
    - Support Japanese new era "令和 (Reiwa)"
    - io: Remove copy_file_range emulation
    (LP: #1851263, #1858203, #1838327, #1797335, #1756209, #1853193)
  * XFAIL stdlib/tst-getrandom (LP: #1891403)
  * debian/testsuite-xfail-debian.mk: XFAIL new tst-support_descriptors

  [ Thadeu Lima de Souza Cascardo ]
  * tests: Make preadwritev2 invalid flags tests unsupported (LP: #1770480)

  [ Andreas Hasenack ]
  * branch-pthread_rwlock_trywrlock-hang-23844.patch:
    nptl: Fix pthread_rwlock_try*lock stalls (Bug 23844) (LP: #1864864)

 -- Balint Reczey <rbalint at ubuntu.com>  Wed, 02 Sep 2020 11:18:37 +0200

** Changed in: glibc (Ubuntu Bionic)
       Status: Fix Committed => Fix Released

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-18269

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1797335

Title:
  strstr() on ubuntu18.04 8 times slower than on ubuntu16

Status in GLibC:
  Unknown
Status in glibc package in Ubuntu:
  Fix Released
Status in glibc source package in Bionic:
  Fix Released
Status in glibc source package in Cosmic:
  Won't Fix

Bug description:
  [Impact]
  * Strstr() from glibc is up to 8 times slower than it was on ubuntu16. 

  [Test Case]
  * Compile and run the attached strstr.c test on an affected Haswell CPU. For the exact Haswell model see the upstream bug report, Qemu can be used to emulate the right model.
  * Observe much faster execution times with the fixed glibc package.

  [Regression Potential]

  * The fix changes the per-model CPU feautures handling in a very
  specific way fixing a previous change in the same area. Regressions
  here are unlikely, but could in theory cause slowdowns, crashes and
  miscalculations if the wrong CPU features are becoming used.

  [Original Bug Text]
  strstr() from glibc is up to 8 times slower than it was on ubuntu16. Looks like the sse2 optimized code is not used. To reproduce compile attached file (strstr.c) :

  $ gcc -o strstr strstr.c

  and then run on the 2 platforms :

  $ vagrant init ubuntu/bionic64
  $ vagrant up
  $ vagrant ssh
  Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-36-generic x86_64)

   * Documentation:  https://help.ubuntu.com
   * Management:     https://landscape.canonical.com
   * Support:        https://ubuntu.com/advantage

    System information as of Thu Oct 11 09:02:46 UTC 2018

    System load:  0.0              Processes:             97
    Usage of /:   9.8% of 9.63GB   Users logged in:       0
    Memory usage: 12%              IP address for enp0s3: 10.0.2.15
    Swap usage:   0%

   * Security certifications for Ubuntu!
     We now have FIPS, STIG, CC and a CIS Benchmark.

     - http://bit.ly/Security_Certification

   * Want to make a highly secure kiosk, smart display or touchscreen?
     Here's a step-by-step tutorial for a rainy weekend, or a startup.

     - https://bit.ly/secure-kiosk

    Get cloud support with Ubuntu Advantage Cloud Guest:
      http://www.ubuntu.com/business/services/cloud

  0 packages can be updated.
  0 updates are security updates.

  Last login: Thu Oct 11 09:02:17 2018 from 10.0.2.2
  vagrant at ubuntu-bionic:~$ cd /vagrant
  vagrant at ubuntu-bionic:/vagrant$ time ./strstr aa
  matches = 3000000

  real	0m4.877s
  user	0m4.852s
  sys	0m0.012s
  vagrant at ubuntu-bionic:/vagrant$

  Same machine :

  $ vagrant init ubuntu/xenial64
  $ vagrant up
  $ vagrant ssh
  Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-135-generic x86_64)

   * Documentation:  https://help.ubuntu.com
   * Management:     https://landscape.canonical.com
   * Support:        https://ubuntu.com/advantage

    Get cloud support with Ubuntu Advantage Cloud Guest:
      http://www.ubuntu.com/business/services/cloud

  0 packages can be updated.
  0 updates are security updates.

  New release '18.04.1 LTS' available.
  Run 'do-release-upgrade' to upgrade to it.

  Last login: Thu Oct 11 08:22:26 2018 from 10.0.2.2
  vagrant at ubuntu-xenial:~$ cd /vagrant
  vagrant at ubuntu-xenial:/vagrant$ time ./strstr aa
  matches = 3000000

  real	0m0.525s
  user	0m0.508s
  sys	0m0.000s
  vagrant at ubuntu-xenial:/vagrant$
  vagrant at ubuntu-xenial:/vagrant$ time ./strstr aa
  matches = 3000000

  real	0m0.525s
  user	0m0.508s
  sys	0m0.000s
  vagrant at ubuntu-xenial:/vagrant$

To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/1797335/+subscriptions



More information about the foundations-bugs mailing list