Skip to content

test.test_tools.test_c_analyzer fails in refleak mode #82368

Closed

Description

@pablogsal
BPO 38187
Nosy @vstinner, @ericsnowcurrently, @pablogsal, @nanjekyejoannah
PRs
  • bpo-38187: Fix reference leak in test_tools #16233
  • bpo-38187: Fix a refleak in Tools/c-analyzer. #16304
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ericsnowcurrently'
    closed_at = <Date 2019-10-02.00:09:47.220>
    created_at = <Date 2019-09-16.15:07:46.811>
    labels = ['tests', '3.9']
    title = 'test.test_tools.test_c_analyzer fails in refleak mode'
    updated_at = <Date 2019-10-02.00:09:47.219>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2019-10-02.00:09:47.219>
    actor = 'eric.snow'
    assignee = 'eric.snow'
    closed = True
    closed_date = <Date 2019-10-02.00:09:47.220>
    closer = 'eric.snow'
    components = ['Tests']
    creation = <Date 2019-09-16.15:07:46.811>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38187
    keywords = ['patch']
    message_count = 6.0
    messages = ['352552', '352553', '352583', '352644', '352646', '353372']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'eric.snow', 'pablogsal', 'nanjekyejoannah']
    pr_nums = ['16233', '16304']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38187'
    versions = ['Python 3.9']

    Activity

    1. pablogsal commented on Sep 16, 2019

      @pablogsal
      MemberAuthor

      Running the test suite to check refleaks over test.test_tools.test_c_analyzer will always fail, make it impossible for the refleak buildbots to run correctly.

      Steps to reproduce:

      ./python -m test test_tools -v -R 3:3

      ======================================================================
      FAIL: test_typical (test.test_tools.test_c_analyzer.test_c_globals.test_find.StaticsTest)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/home/pablogsal/github/cpython/Lib/test/test_tools/test_c_analyzer/test_c_globals/test_find.py", line 319, in test_typical
          self.assertEqual(found, [
      AssertionError: Lists differ: [Vari[413 chars]rc1/sub/ham.c', funcname=None, name='var1'), v[318 chars]nt')] != [Vari[413 chars]rc1/spam.c', funcname=None, name='freelist'), [431 chars]nt')]

      First differing element 4:
      Varia[21 chars]rc1/sub/ham.c', funcname=None, name='var1'), v[30 chars]t *')
      Varia[21 chars]rc1/spam.c', funcname=None, name='freelist'), [34 chars]10]')

      Second list contains 1 additional elements.
      First extra element 8:
      Variable(id=ID(filename='Include/spam.h', funcname=None, name='data'), vartype='static const int')

      [Variable(id=ID(filename='src1/spam.c', funcname=None, name='var1'), vartype='static const char *'),
      Variable(id=ID(filename='src1/spam.c', funcname='ham', name='initialized'), vartype='static int'),
      Variable(id=ID(filename='src1/spam.c', funcname=None, name='var2'), vartype='static PyObject *'),
      Variable(id=ID(filename='src1/eggs.c', funcname='tofu', name='ready'), vartype='static int'),
      + Variable(id=ID(filename='src1/spam.c', funcname=None, name='freelist'), vartype='static (PyTupleObject *)[10]'),
      Variable(id=ID(filename='src1/sub/ham.c', funcname=None, name='var1'), vartype='static const char const *'),
      Variable(id=ID(filename='src2/jam.c', funcname=None, name='var1'), vartype='static int'),
      Variable(id=ID(filename='src2/jam.c', funcname=None, name='var2'), vartype='static MyObject *'),
      Variable(id=ID(filename='Include/spam.h', funcname=None, name='data'), vartype='static const int')]

      ----------------------------------------------------------------------

      Ran 219 tests in 3.769s

      FAILED (failures=1, skipped=2, expected failures=14)
      test test_tools failed
      test_tools failed

      == Tests result: FAILURE ==

      1 test failed:
      test_tools

      Total duration: 19 sec 101 ms
      Tests result: FAILURE

    2. pablogsal commented on Sep 16, 2019

      @pablogsal
      MemberAuthor

      Check this failure in the buildbots for reference:

      https://buildbot.python.org/all/#/builders/80/builds/705/steps/4/logs/stdio

    3. vstinner commented on Sep 16, 2019

      @vstinner
      Member

      I also opened https://bugs.python.org/issue38177#msg352474 we should only track this leak in a single issue, you can close bpo-38177.

    4. pablogsal commented on Sep 17, 2019

      @pablogsal
      MemberAuthor

      New changeset 6fbc924 by Pablo Galindo in branch 'master':
      bpo-38187: Fix reference leak in test_tools (GH-16233)
      6fbc924

    5. pablogsal commented on Sep 17, 2019

      @pablogsal
      MemberAuthor

      PR 16233 fixes the reference leaks but the original error is still present and

      ./python -m test test_tools -v -R 3:3

      is still failing (as in the test fails, instead of failing because there are leaks).

    6. ericsnowcurrently commented on Sep 27, 2019

      @ericsnowcurrently
      Member

      New changeset 6693f73 by Eric Snow in branch 'master':
      bpo-38187: Fix a refleak in Tools/c-analyzer. (gh-16304)
      6693f73

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    3.9 (EOL)end of lifetestsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions