Skip to content

Segmentation faults on Python 3.11.0-alpha.4 with branch coverage enabled #1316

@Nothing4You

Description

@Nothing4You

Describe the bug
coverage segfaults with about 50% probability when branch coverage is enabled.
This does not happen on versions below 3.11.

To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:

  1. What version of Python are you using?
    3.11.0-alpha.4
  2. What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
-- sys -------------------------------------------------------
               coverage_version: 6.3
                coverage_module: /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/lib/python3.11/site-packages/coverage/__init__.py
                         tracer: -none-
                        CTracer: available
           plugins.file_tracers: -none-
            plugins.configurers: -none-
      plugins.context_switchers: -none-
              configs_attempted: .coveragerc
                   configs_read: /home/runner/work/coverage-segfault/coverage-segfault/.coveragerc
                    config_file: /home/runner/work/coverage-segfault/coverage-segfault/.coveragerc
                config_contents: b'[run]\nbranch = True\n'
                      data_file: -none-
                         python: 3.11.0a4 (main, Jan 27 2022, 07:34:27) [GCC 9.3.0]
                       platform: Linux-5.11.0-1027-azure-x86_64-with-glibc2.31
                 implementation: CPython
                     executable: /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/bin/python
                   def_encoding: utf-8
                    fs_encoding: utf-8
                            pid: 1726
                            cwd: /home/runner/work/coverage-segfault/coverage-segfault
                           path: /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/bin
                                 /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/lib/python311.zip
                                 /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/lib/python3.11
                                 /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/lib/python3.11/lib-dynload
                                 /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/lib/python3.11/site-packages
                    environment: HOME = /home/runner
                   command_line: /opt/hostedtoolcache/Python/3.11.0-alpha.4/x64/bin/coverage debug sys
                sqlite3_version: 2.6.0
         sqlite3_sqlite_version: 3.31.1
             sqlite3_temp_store: 0
        sqlite3_compile_options: COMPILER=gcc-9.3.0; ENABLE_COLUMN_METADATA; ENABLE_DBSTAT_VTAB
                                 ENABLE_FTS3; ENABLE_FTS3_PARENTHESIS; ENABLE_FTS3_TOKENIZER
                                 ENABLE_FTS4; ENABLE_FTS5; ENABLE_JSON1
                                 ENABLE_LOAD_EXTENSION; ENABLE_PREUPDATE_HOOK; ENABLE_RTREE
                                 ENABLE_SESSION; ENABLE_STMTVTAB; ENABLE_UNLOCK_NOTIFY
                                 ENABLE_UPDATE_DELETE_LIMIT; HAVE_ISNAN; LIKE_DOESNT_MATCH_BLOBS
                                 MAX_SCHEMA_RETRY=25; MAX_VARIABLE_NUMBER=250000; OMIT_LOOKASIDE
                                 SECURE_DELETE; SOUNDEX; TEMP_STORE=1
                                 THREADSAFE=1; USE_URI
  1. What versions of what packages do you have installed? The output of pip freeze is helpful.
coverage==6.3
  1. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
    https://github.com/Nothing4You/coverage-segfault/tree/f7488a302720dadd7d562f3119e09ed708b2fb44
  2. What commands did you run?
    coverage run test.py

Expected behavior
No segfault.

Additional context
https://github.com/Nothing4You/coverage-segfault/actions/runs/1775511837
https://github.com/Nothing4You/coverage-segfault/blob/f7488a302720dadd7d562f3119e09ed708b2fb44/.github/workflows/ci.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedkit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions