Skip to content

Most libcpychecker tests fail with gcc 4.6.3 with libcpychecker.compat.CouldNotFindVarDecl #5

Closed

Description

@wiredfool

I'm trying to build the gcc-python-plugin from master on Ubuntu 12.04, and I'm getting a large number of test failures and a project that doesn't work. I suspect I'm missing something. I've also tried it on Fedora 17, but got similar results.

The errors start here, full output is 2 megs or so.

tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-lt-max-of-WithinRange: OK
tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-lt-min-of-WithinRange: OK
tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-lt-two-value-range: OK
tests/cpychecker/absinterp/comparisons/boundaries/WithinRange-eq-ConcreteValue-in-middle: OK
tests/cpychecker/absint--- Expected stdout (after cleaning)
+++ Actual stdout (after cleaning)
@@ -1,37 +0,0 @@
-Trace 0:
-  Transitions:
-    'when PyString_AsString() succeeds'
-    'releasing the GIL by calling PyEval_SaveThread()'
-    'reacquiring the GIL by calling PyEval_RestoreThread()'
-    'returning'
-  region for gcc.ParmDecl('self') on stack:
-    repr(): RegionOnStack("region for gcc.ParmDecl('self')")
-    str(): region for gcc.ParmDecl('self') on stack
-    r->ob_refcnt: refs: 0 + N where N >= 1
-    r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts
/GIL/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
-  region for gcc.ParmDecl('args') on stack:
-    repr(): RegionOnStack("region for gcc.ParmDecl('args')")
-    str(): region for gcc.ParmDecl('args') on stack
-    r->ob_refcnt: refs: 0 + N where N >= 1
-    r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts
/GIL/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
-  Exception:
-    (struct PyObject *)0 from tests/cpychecker/refcounts/GIL/correct/input.c:30
-
-Trace 1:
-  Transitions:
-    'when PyString_AsString() fails'
-    'releasing the GIL by calling PyEval_SaveThread()'
-    'reacquiring the GIL by calling PyEval_RestoreThread()'
-    'returning'
-  region for gcc.ParmDecl('self') on stack:
-    repr(): RegionOnStack("region for gcc.ParmDecl('self')")
-    str(): region for gcc.ParmDecl('self') on stack
-    r->ob_refcnt: refs: 0 + N where N >= 1
-    r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts
/GIL/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')"))
-  region for gcc.ParmDecl('args') on stack:
-    repr(): RegionOnStack("region for gcc.ParmDecl('args')")
-    str(): region for gcc.ParmDecl('args') on stack
-    r->ob_refcnt: refs: 0 + N where N >= 1
-    r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts
/GIL/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')"))
-  Exception:
-    (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/GIL/corr
ect/input.c:31
--- Expected stderr (after cleaning)
+++ Actual stderr (after cleaning)
@@ -0,0 +1,28 @@

Activity

  1. davidmalcolm commented on May 24, 2013

    @davidmalcolm
    Owner

    Note that "make plugin" will simply build the plugin, skipping the unit tests.

    Sorry about this. Unfortunately, yes, many of the tests are very fragile right now. By comparing stdout/stderr against "gold" outputs I've overspecified the behaviors. I hope to fix this when the "firehose" branch is merged, since this gives easier access to the internal state of the checker from a place where test cases can poke at it.

    In the meantime, it looks like you trimmed a bit too much from what you posted; do you have logs you can post somewhere? Thanks.

  2. wiredfool commented on May 24, 2013

    @wiredfool
    Author

    Here's the full output.

    https://raw.github.com/wiredfool/gcc-plugin-error-log/master/output

    I had originally tried to add this as a gist, but apparently pasting 2M into a text area is unsupported.

  3. davidmalcolm commented on May 24, 2013

    @davidmalcolm
    Owner

    Thanks.

    Looking at that log, I see 132 instances of "libcpychecker.compat.CouldNotFindVarDecl"
    e.g. libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError'
    $ grep -e "^\+libcpychecker.compat.CouldNotFindVarDecl" output|sort |uniq +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyCObject_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_AttributeError' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_ValueError' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyFloat_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type'

  4. davidmalcolm commented on May 24, 2013

    @davidmalcolm
    Owner

    What version of gcc and python are you using?

  5. wiredfool commented on May 24, 2013

    @wiredfool
    Author
    erics@builder-1204-x64:~/gcc-python-plugin$ gcc --version
    gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
    Copyright (C) 2011 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    erics@builder-1204-x64:~/gcc-python-plugin$ python --version
    Python 2.7.3
    erics@builder-1204-x64:~/gcc-python-plugin$ uname -a
    Linux builder-1204-x64 3.2.0-40-generic #64-Ubuntu SMP Mon Mar 25 21:22:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    
  6. davidmalcolm commented on May 24, 2013

    @davidmalcolm
    Owner

    Thanks

    I think this may be a general problem with gcc 4.6.3, alas; see https://fedorahosted.org/gcc-python-plugin/ticket/21 Working around this would require 4.6.3-specific changes, I think.

  7. wiredfool commented on May 24, 2013

    @wiredfool
    Author

    That explains it. I'm not too attached to gcc 4.6.3, it's just what's easily available on that machine.

    I'm trying again on Fedora 17, and it appears that it's working better now. There's only 3 test failing there. Either the improvements are from recent updates, or I wasn't paying close enough attention before. At least one of them looks like a fragile test.

    I'll give it a shot there.

  8. davidmalcolm commented on May 14, 2014

    @davidmalcolm
    Owner

    FWIW, I've now "fixed" the build by disabling many of the selftests on 4.6; as of ba4fa6d the Travis-CI build on 4.6.3 succeeds

  9. changed the title [-]Tests Fail massively[/-] [+]Most libcpychecker tests fail with gcc 4.6.3 with "libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type'" et al[/+] on May 20, 2014
  10. changed the title [-]Most libcpychecker tests fail with gcc 4.6.3 with "libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type'" et al[/-] [+]Most libcpychecker tests fail with gcc 4.6.3 with ```libcpychecker.compat.CouldNotFindVarDecl```[/+] on May 20, 2014
  11. changed the title [-]Most libcpychecker tests fail with gcc 4.6.3 with ```libcpychecker.compat.CouldNotFindVarDecl```[/-] [+]Most libcpychecker tests fail with gcc 4.6.3 with libcpychecker.compat.CouldNotFindVarDecl[/+] on May 20, 2014
  12. davidmalcolm commented on May 20, 2014

    @davidmalcolm
    Owner

    As noted above, I've committed a workaround that enables the Travis-CI build on 4.6.3 to succeed.

    In the absence of a real fix, I'm going to close this one out for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions