gcc-python-plugin icon indicating copy to clipboard operation
gcc-python-plugin copied to clipboard

TypeError: (long int)val […] is not an instance of RefcountValue

Open iustin opened this issue 10 years ago • 0 comments

Not sure if this is due to a an issue in my code, but at least I don't think it should raise an exception in cpychecker:

[fedora@fedora pylibacl]$ CC=~/gcc-python-plugin/gcc-with-cpychecker CFLAGS="--maxtrans=1000" ./setup.py build
running build
running build_ext
building 'posix1e' extension
/home/fedora/gcc-python-plugin/gcc-with-cpychecker -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv --maxtrans=1000 -fPIC -DHAVE_LINUX -DHAVE_LEVEL2 -I/usr/include/python2.7 -c acl.c -o build/temp.linux-x86_64-2.7/acl.o
acl.c: In function ‘initposix1e’:
acl.c:1807:9: error: Unhandled Python exception raised calling 'execute' method
     if (PyDict_SetItemString(d, "ACL",
         ^
Traceback (most recent call last):
  File "/home/fedora/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute
    self._check_refcounts(fun)
  File "/home/fedora/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts
    dump_json=self.dump_json)
  File "/home/fedora/gcc-python-plugin/libcpychecker/refcounts.py", line 4393, in check_refcounts
    maxtrans)
  File "/home/fedora/gcc-python-plugin/libcpychecker/refcounts.py", line 4248, in impl_check_refcounts
    limits=limits)
  File "/home/fedora/gcc-python-plugin/libcpychecker/absinterp.py", line 3033, in iter_traces
    depth + 1):
[…]
  File "/home/fedora/gcc-python-plugin/libcpychecker/absinterp.py", line 3033, in iter_traces
    depth + 1):
  File "/home/fedora/gcc-python-plugin/libcpychecker/absinterp.py", line 2997, in iter_traces
    transitions = curstate.get_transitions()
  File "/home/fedora/gcc-python-plugin/libcpychecker/absinterp.py", line 2049, in get_transitions
    return self._get_transitions_for_stmt(stmt)
  File "/home/fedora/gcc-python-plugin/libcpychecker/absinterp.py", line 2065, in _get_transitions_for_stmt
    return self._get_transitions_for_GimpleCall(stmt)
  File "/home/fedora/gcc-python-plugin/libcpychecker/absinterp.py", line 2232, in _get_transitions_for_GimpleCall
    return meth(stmt, *args)
  File "/home/fedora/gcc-python-plugin/libcpychecker/refcounts.py", line 1632, in impl_PyDict_SetItemString
    v_dp, v_key, v_item)
  File "/home/fedora/gcc-python-plugin/libcpychecker/refcounts.py", line 1590, in _handle_PyDict_SetItem
    s_success.cpython.add_external_ref(v_item, stmt.loc)
  File "/home/fedora/gcc-python-plugin/libcpychecker/refcounts.py", line 607, in add_external_ref
    _incref_external)
  File "/home/fedora/gcc-python-plugin/libcpychecker/refcounts.py", line 572, in change_refcount
    check_isinstance(oldvalue, RefcountValue)
  File "/home/fedora/gcc-python-plugin/gccutils/__init__.py", line 637, in check_isinstance
    raise TypeError('%s / %r is not an instance of %s' % (obj, obj, types))
TypeError: (long int)val [-0x7fffffffffffffff <= val <= 0x7fffffffffffffff] from acl.c:1806 / WithinRange(gcctype='long int', loc=gcc.Location(file='acl.c', line=1806), minvalue=-0x7fffffffffffffff, maxvalue=0x7fffffffffffffff) is not an instance of <class 'libcpychecker.refcounts.RefcountValue'>

The code which triggers this is in iustin/pylibacl@1c1acd9f639074e2cb7d9eef1c36f3e1c4efff24.

The line in cause doesn't do anything with refcounts itself, so I don't know why it trips cpychecker. Tested in a Fedora21 cloud image. Thanks!

iustin avatar May 01 '15 20:05 iustin