Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wiredfool opened this issue May 22, 2013 · 9 comments

Comments

@wiredfool
Copy link

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 @@
@davidmalcolm
Copy link
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.

@wiredfool
Copy link
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.

@davidmalcolm
Copy link
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'

@davidmalcolm
Copy link
Owner

What version of gcc and python are you using?

@wiredfool
Copy link
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

@davidmalcolm
Copy link
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.

@wiredfool
Copy link
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.

@davidmalcolm
Copy link
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

@davidmalcolm davidmalcolm 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 May 20, 2014
@davidmalcolm davidmalcolm 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 May 20, 2014
@davidmalcolm davidmalcolm 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 May 20, 2014
@davidmalcolm
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants