pip install coverage uses slower PyTracer on some Ubuntu platforms

Issue #382 closed
Tobias McNulty created an issue

Running Ubuntu 15.04 with any version of Python (2.6, 2.7, 3.4 from deadsnakes or 3.3 from Ubuntu proper), pip install coverage ends up with the slower PyTracer:

(coverage-test)tobias@tobias-MS-7924:~$ pip install coverage
Collecting coverage
Installing collected packages: coverage
Successfully installed coverage-3.7.1
(coverage-test)tobias@tobias-MS-7924:~$ coverage debug sys
-- sys ----------------------------------------
        version: 3.7.1
       coverage: /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages/coverage/__init__.py
      cover_dir: /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages/coverage
     pylib_dirs: /usr/lib/python3.3
         tracer: PyTracer
   config_files: .coveragerc
   configs_read: -none-
      data_path: /home/tobias/.coverage
         python: 3.3.6 (default, Apr 17 2015, 00:15:49) [GCC 4.9.2]
       platform: Linux-3.19.0-21-generic-x86_64-with-Ubuntu-15.04-vivid
 implementation: CPython
     executable: /home/tobias/.virtualenvs/coverage-test/bin/python3.3
            cwd: /home/tobias
           path: /home/tobias/.virtualenvs/coverage-test/bin
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3/plat-x86_64-linux-gnu
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3/lib-dynload
                 /usr/lib/python3.3
                 /usr/lib/python3.3/plat-x86_64-linux-gnu
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages
    environment: -none-
   command_line: /home/tobias/.virtualenvs/coverage-test/bin/coverage debug sys

Disabling binaries or installing directly via setup.py (less ideal given everyone uses pip and requirements files these days) seems to fix it:

(coverage-test)tobias@tobias-MS-7924:~$ pip install --no-binary :all: coverage
Collecting coverage
  Using cached coverage-3.7.1.tar.gz
Skipping bdist_wheel for coverage, due to binaries being disabled for it.
Installing collected packages: coverage
  Running setup.py install for coverage
Successfully installed coverage-3.7.1
(coverage-test)tobias@tobias-MS-7924:~$ coverage debug sys
-- sys ----------------------------------------
        version: 3.7.1
       coverage: /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages/coverage/__init__.py
      cover_dir: /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages/coverage
     pylib_dirs: /usr/lib/python3.3
         tracer: CTracer
   config_files: .coveragerc
   configs_read: -none-
      data_path: /home/tobias/.coverage
         python: 3.3.6 (default, Apr 17 2015, 00:15:49) [GCC 4.9.2]
       platform: Linux-3.19.0-21-generic-x86_64-with-Ubuntu-15.04-vivid
 implementation: CPython
     executable: /home/tobias/.virtualenvs/coverage-test/bin/python3.3
            cwd: /home/tobias
           path: /home/tobias/.virtualenvs/coverage-test/bin
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3/plat-x86_64-linux-gnu
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3/lib-dynload
                 /usr/lib/python3.3
                 /usr/lib/python3.3/plat-x86_64-linux-gnu
                 /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages
    environment: -none-
   command_line: /home/tobias/.virtualenvs/coverage-test/bin/coverage debug sys

This is not a problem on Ubuntu 12.04 using system Python (2.7), but for all the Python versions I installed via the deadsnakes PPA (on 12.04), the same behavior above was exhibited.

Comments (13)

  1. Alexander Walters

    Did you install python?-dev from deadsnakes? I cannot reproduce this, but I have -dev installed for all my ubuntu versions of python.

  2. Tobias McNulty reporter

    Yes, I also have the dev packages installed (it does work when I install manually with setup.py or disable binaries w/pip).

  3. Alexander Walters

    What version of pip are you using? if it is not at least 7.1.0, upgrade. Also, are you getting this same behavior in fresh virtualenvs?

    I am unable to replicate this in 2.6-3.4 in 12.04 or 14.04

  4. Alexander Walters

    I ran this on 12.04 and 14.04, 12.04 is 32bit, 14.04 is 64bit. The output of grep was identical; the CTracer is built when installing with pip into a virtualenv for both 3.7.1 and 4.0a6. More information will be needed before anything can be diagnosed.

    Note that tox uses pip to install packages.

    tritium@gesa:~$ tox | tee output1204 | grep "tracer:\|version:\|python:"
            version: 3.7.1
             tracer: CTracer
             python: 2.6.9 (default, Oct 22 2014, 19:46:59) [GCC 4.6.3]
                  version: 4.0a6
                   tracer: CTracer
                   python: 2.6.9 (default, Oct 22 2014, 19:46:59) [GCC 4.6.3]
            version: 3.7.1
             tracer: CTracer
             python: 2.7.10 (default, Jun 29 2015, 22:37:57) [GCC 4.6.3]
                  version: 4.0a6
                   tracer: CTracer
                   python: 2.7.10 (default, Jun 29 2015, 22:37:57) [GCC 4.6.3]
            version: 3.7.1
             tracer: CTracer
             python: 3.3.6 (default, Jan 28 2015, 16:32:06) [GCC 4.6.3]
                  version: 4.0a6
                   tracer: CTracer
                   python: 3.3.6 (default, Jan 28 2015, 16:32:06) [GCC 4.6.3]
            version: 3.7.1
             tracer: CTracer
             python: 3.4.3 (default, Apr 13 2015, 22:33:01) [GCC 4.6.3]
                  version: 4.0a6
                   tracer: CTracer
                   python: 3.4.3 (default, Apr 13 2015, 22:33:01) [GCC 4.6.3]
    tritium@gesa:~$ uname -a
    Linux gesa 3.2.0-86-generic-pae #123-Ubuntu SMP Sun Jun 14 18:30:54 UTC 2015 i686 i686 i386 GNU/Linux
    tritium@gesa:~$ cat tox.ini
    [tox]
    skipsdist=True
    envlist=py{26,27,33,34}-coverage{37,40}
    
    [testenv]
    deps=
        coverage37: coverage>=3.7,<4.0
        coverage40: coverage>=4.0a1
    commands=coverage debug sys
    tritium@gesa:~$
    
  5. Tobias McNulty reporter

    @sdamon I tried your test, and it looks like coverage 3.7.1 reliably uses PyTracer, but 4.0 (which I had not tested before) seems to pick up CTracer:

    (coverage-test)tobias@tobias-MS-7924:~$ tox | tee output1204 | grep "tracer:\|version:\|python:"
            version: 3.7.1
             tracer: PyTracer
             python: 2.6.9 (default, Apr 16 2015, 18:31:03) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 2.6.9 (default, Apr 16 2015, 18:31:03) [GCC 4.9.2]
            version: 3.7.1
             tracer: PyTracer
             python: 2.7.9 (default, Apr  2 2015, 15:33:21) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 2.7.9 (default, Apr  2 2015, 15:33:21) [GCC 4.9.2]
            version: 3.7.1
             tracer: PyTracer
             python: 3.3.6 (default, Apr 17 2015, 00:15:49) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 3.3.6 (default, Apr 17 2015, 00:15:49) [GCC 4.9.2]
            version: 3.7.1
             tracer: PyTracer
             python: 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2]
    (coverage-test)tobias@tobias-MS-7924:~$ uname -a
    Linux tobias-MS-7924 3.19.0-26-generic #28-Ubuntu SMP Tue Aug 11 14:16:32 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    (coverage-test)tobias@tobias-MS-7924:~$ pip --version
    pip 7.1.2 from /home/tobias/.virtualenvs/coverage-test/lib/python3.3/site-packages (python 3.3)
    (coverage-test)tobias@tobias-MS-7924:~$ cat tox.ini 
    [tox]
    skipsdist=True
    envlist=py{26,27,33,34}-coverage{37,40}
    
    [testenv]
    deps=
        coverage37: coverage>=3.7,<4.0
        coverage40: coverage>=4.0a1
    commands=coverage debug sys
    

    Note I am using 15.04 64-bit, not one of the distros you listed.

  6. Tobias McNulty reporter

    And it works okay if I disable binary packages in the pip install command in tox.ini:

    (coverage-test)tobias@tobias-MS-7924:~/coverage-test$ tox | tee output1204 | grep "tracer:\|version:\|python:"
            version: 3.7.1
             tracer: CTracer
             python: 2.6.9 (default, Apr 16 2015, 18:31:03) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 2.6.9 (default, Apr 16 2015, 18:31:03) [GCC 4.9.2]
            version: 3.7.1
             tracer: CTracer
             python: 2.7.9 (default, Apr  2 2015, 15:33:21) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 2.7.9 (default, Apr  2 2015, 15:33:21) [GCC 4.9.2]
            version: 3.7.1
             tracer: CTracer
             python: 3.3.6 (default, Apr 17 2015, 00:15:49) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 3.3.6 (default, Apr 17 2015, 00:15:49) [GCC 4.9.2]
            version: 3.7.1
             tracer: CTracer
             python: 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2]
                  version: 4.0
                   tracer: CTracer
                   python: 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2]
    (coverage-test)tobias@tobias-MS-7924:~/coverage-test$ cat tox.ini 
    [tox]
    skipsdist=True
    envlist=py{26,27,33,34}-coverage{37,40}
    
    [testenv]
    deps=
        coverage37: coverage>=3.7,<4.0
        coverage40: coverage>=4.0a1
    commands=coverage debug sys
    install_command=pip install --no-binary :all: {opts} {packages}
    
  7. Loic Dachary

    Is it still an issue ? I'm unable to reproduce on Ubuntu 16.04 with python 2.7.12, 3.4, 3.5 with pip 9.0.1 and coverage 4.2. By that I mean they all have tracer: CTracer

  8. Log in to comment