Repository navigation
Most libcpychecker tests fail with gcc 4.6.3 with libcpychecker.compat.CouldNotFindVarDecl #5
Copy link
Copy link
Closed
Description
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 @@
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
davidmalcolm commentedon May 24, 2013
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.
wiredfool commentedon May 24, 2013
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.
davidmalcolm commentedon May 24, 2013
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'davidmalcolm commentedon May 24, 2013
What version of gcc and python are you using?
wiredfool commentedon May 24, 2013
davidmalcolm commentedon May 24, 2013
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.
wiredfool commentedon May 24, 2013
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.
davidmalcolm commentedon May 14, 2014
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
[-]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[/+][-]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```[/+][-]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[/+]davidmalcolm commentedon May 20, 2014
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.
.travis.yml: experiment with Python versions #5