Makefile:189: warning: overriding commands for target `autogenerated-casts.c' Makefile:186: warning: ignoring old commands for target `autogenerated-casts.c' python testcpybuilder.py -v test_module_with_type (__main__.SimpleTest) ... ok test_simple_compilation (__main__.SimpleTest) ... ok test_version_parsing (__main__.SimpleTest) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.218s OK LD_LIBRARY_PATH=gcc-c-api python run-test-suite.py tests/cpychecker/PyArg_Parse/incorrect_codes_S_and_U: OK tests/cpychecker/PyArg_ParseTuple/code_O_bang: OK tests/cpychecker/PyArg_ParseTuple/code_s/incorrect-constness: OK tests/cpychecker/PyArg_ParseTuple/codes_accepting_null: OK tests/cpychecker/PyArg_ParseTuple/correct_codes_S_and_U: OK tests/cpychecker/PyArg_ParseTuple/correct_converter: OK tests/cpychecker/PyArg_ParseTuple/incorrect_code_z_hash: OK tests/cpychecker/PyArg_ParseTuple/incorrect_codes_S_and_U: OK tests/cpychecker/PyArg_ParseTuple/incorrect_converters: OK tests/cpychecker/PyArg_ParseTuple/keywords: OK tests/cpychecker/PyArg_ParseTuple/typedefs: OK tests/cpychecker/PyArg_ParseTuple/with_PY_SSIZE_T_CLEAN: OK tests/cpychecker/PyArg_ParseTuple/without_PY_SSIZE_T_CLEAN: OK tests/cpychecker/PyMethodDef/correct: OK tests/cpychecker/PyMethodDef/incorrect-types: OK tests/cpychecker/PyMethodDef/missing-sentinel: OK tests/cpychecker/Py_BuildValue/code_O/subclass: OK tests/cpychecker/Py_BuildValue/code_c/correct: OK tests/cpychecker/Py_BuildValue/code_f/correct: OK tests/cpychecker/Py_BuildValue/code_lower_d/correct: OK tests/cpychecker/Py_BuildValue/code_s_hash/correct: OK tests/cpychecker/Py_BuildValue/code_u/correct: OK tests/cpychecker/Py_BuildValue/code_u_hash/correct: OK tests/cpychecker/Py_BuildValue/code_upper_D/correct: OK tests/cpychecker/Py_BuildValue/code_upper_D/incorrect: OK tests/cpychecker/absinterp/arithmetic/correct: OK tests/cpychecker/absinterp/arithmetic/division-by-zero/definite: OK tests/cpychecker/absinterp/arithmetic/division-by-zero/possible: OK tests/cpychecker/absinterp/arithmetic/fix-trunc-expr: OK tests/cpychecker/absinterp/arithmetic/negative-shift/definite: OK tests/cpychecker/absinterp/arithmetic/negative-shift/possible: OK tests/cpychecker/absinterp/array-range/fully-checked: OK tests/cpychecker/absinterp/array-range/fully-checked-on-stack: OK tests/cpychecker/absinterp/array-range/implicitly-correct: OK tests/cpychecker/absinterp/array-range/off-by-one: OK tests/cpychecker/absinterp/array-range/partial-initialization-on-stack: OK tests/cpychecker/absinterp/array-range/unchecked: OK tests/cpychecker/absinterp/array-range/upper-checked: OK tests/cpychecker/absinterp/arrays: OK tests/cpychecker/absinterp/arrays2: OK tests/cpychecker/absinterp/arrays3: OK tests/cpychecker/absinterp/arrays4: OK tests/cpychecker/absinterp/arrays5: OK tests/cpychecker/absinterp/arrays6: OK tests/cpychecker/absinterp/arrays7: OK tests/cpychecker/absinterp/asm/empty: OK tests/cpychecker/absinterp/bitfields/reading: OK tests/cpychecker/absinterp/casts/int-to-char-with-extraction: OK tests/cpychecker/absinterp/casts/int-to-char-with-implicit-truncation: OK tests/cpychecker/absinterp/casts/int-to-char-within-range: OK tests/cpychecker/absinterp/casts/int-to-float: OK tests/cpychecker/absinterp/casts/int-to-pointer: OK tests/cpychecker/absinterp/casts/int-to-pointer2: OK tests/cpychecker/absinterp/casts/pointer-to-long: OK tests/cpychecker/absinterp/casts/pyobjectptr-to-long: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-eq-max-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-eq-min-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-ge-max-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-ge-min-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-gt-max-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-gt-min-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-le-max-of-WithinRange: OK tests/cpychecker/absinterp/comparisons/boundaries/ConcreteValue-le-min-of-WithinRange: OK 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/correct/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/GIL/correct/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3244, in impl_PyString_AsString + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_Parse() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyArg_Parse/correct_simple/input.c', line=30), 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/PyArg_Parse/correct_simple/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c:31 - -Trace 1: - Transitions: - 'when PyArg_Parse() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c:39 - 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/PyArg_Parse/correct_simple/input.c', line=30), 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/PyArg_Parse/correct_simple/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c:37 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c:37:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1118, in impl_PyArg_Parse + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' erp/comparisons/conditionals: OK tests/cpychecker/absinterp/comparisons/expressions: OK tests/cpychecker/absinterp/comparisons/pointers: OK tests/cpychecker/absinterp/custom-strdup: OK tests/cpychecker/absinterp/custom-strdup-with-attr: OK tests/cpychecker/absinterp/exit: OK tests/cpychecker/absinterp/function-pointers: OK tests/cpychecker/absinterp/nested-fields: OK tests/cpychecker/absinterp/nested-fields2: OK tests/cpychecker/absinterp/nested-fields3: OK tests/cpychecker/absinterp/nonnull-attribute: OK tests/cpychecker/absinterp/read-through-global-ptr-checked: OK tests/cpychecker/absinterp/read-through-global-ptr-unchecked: OK tests/cpychecker/absinterp/read-through-uninitialized-ptr: OK tests/cpychecker/absinterp/real-cst/regular: OK tests/cpychecker/absinterp/result-decl: OK tests/cpychecker/absinterp/static-data: OK tests/cpychecker/absinterp/string-constants: OK tests/cpychecker/absinterp/switch: OK tests/cpychecker/absinterp/two-loops: OK tests/cpychecker/absinterp/uninitialized-data: OK tests/cpychecker/absinterp/void-return: OK tests/cpychecker/absinterp/write-through-arg-unchecked: OK tests/cpychecker/absinterp/write-through-global-ptr-checked: OK tests/cpychecker/absinterp/write-through-global-ptr-unchecked: OK tests/cpychecker/fileptr-missing-error-check: OK tests/cpychecker/refcounts/GIL/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/GIL/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/GIL/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/GIL/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/GIL/correct/input.c: In function 'test': tests/cpychecker/refcounts/GIL/correct/input.c:31:17: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3244, in impl_PyString_AsString t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyArg_Parse/correct_simple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_Parse/correct_simple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_Parse/correct_simple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c', line=32), region=RegionOnHeap('object from arg "O"', gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('object from arg "O"', gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c', line=32)) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:32 - r->ob_refcnt: (Py_ssize_t)val [-0x7fffffffffffffff <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:42 - r->ob_type: None - 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/PyArg_ParseTuple/correct_O/input.c', line=28), 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/PyArg_ParseTuple/correct_O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:29 - -Trace 1: - Transitions: - 'when PyArg_ParseTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:34 - 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/PyArg_ParseTuple/correct_O/input.c', line=28), 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/PyArg_ParseTuple/correct_O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' /PyArg_Parse/correct_simple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_Parse/correct_simple/input.c:37:21: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1118, in impl_PyArg_Parse v_fmt, v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O/input.c:32:26: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/eric--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,88 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when treating unknown char * from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 as non-NULL' - 'when PyString_FromString() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c', line=52), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c', line=52))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c', line=52)) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c', line=52), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:36 - -Trace 1: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when treating unknown char * from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 as non-NULL' - 'when PyString_FromString() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c', line=52), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 - 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 - -Trace 2: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when treating unknown char * from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (D.nnnnn) at tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:52 - 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:36 - -Trace 3: - Transitions: - 'when PyArg_ParseTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c', line=41), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:41 - 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), 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/PyArg_ParseTuple/correct_O_bang/input.c', line=35), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:39 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:39:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyArg_ParseTuple/correct_converter/input.c', line=24), 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/PyArg_ParseTuple/correct_converter/input.c', line=24), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c:25 - -Trace 1: - Transitions: - 'when PyArg_ParseTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c:30 - 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/PyArg_ParseTuple/correct_converter/input.c', line=24), 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/PyArg_ParseTuple/correct_converter/input.c', line=24), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c:27 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'correct_usage_of_converter': +tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c:27:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' s/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple v_fmt, v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang/input.c:39:26: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple v_fmt, v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyArg_ParseTuple/correct_simple/input.c', line=30), 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/PyArg_ParseTuple/correct_simple/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c:31 - -Trace 1: - Transitions: - 'when PyArg_ParseTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c:39 - 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/PyArg_ParseTuple/correct_simple/input.c', line=30), 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/PyArg_ParseTuple/correct_simple/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c:37 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c:37:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' c: In function 'correct_usage_of_converter': tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter/input.c:27:26: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple v_fmt, v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple/input.c:37:26: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", lin--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,53 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_ParseTupleAndKeywords() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=33), region=RegionOnHeap('object from arg "O"', gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('object from arg "O"', gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=33)) from tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:33 - r->ob_refcnt: (Py_ssize_t)val [-0x7fffffffffffffff <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:44 - r->ob_type: None - 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/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=28), 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/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - region for gcc.ParmDecl('kwargs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('kwargs')") - str(): region for gcc.ParmDecl('kwargs') 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/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('kwargs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:29 - -Trace 1: - Transitions: - 'when PyArg_ParseTupleAndKeywords() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=36), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:36 - 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/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=28), 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/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - region for gcc.ParmDecl('kwargs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('kwargs')") - str(): region for gcc.ParmDecl('kwargs') 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/PyArg_ParseTupleAndKeywords/correct_O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('kwargs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1164, in impl_PyArg_ParseTupleAndKeywords + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,253 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_UnpackTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:34 - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - -Trace 1: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 1 argument(s)' - 'taking False path' - 'when PyTuple_Pack() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37)) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 1')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:28 - -Trace 2: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 1 argument(s)' - 'taking False path' - 'when PyTuple_Pack() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 1')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - -Trace 3: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 2 argument(s)' - 'taking False path' - 'when PyTuple_Pack() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37)) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 2')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:28 - -Trace 4: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 2 argument(s)' - 'taking False path' - 'when PyTuple_Pack() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 2')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - -Trace 5: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 3 argument(s)' - 'taking False path' - 'when PyTuple_Pack() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37)) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 2')) - argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 3', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 3')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:28 - -Trace 6: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 3 argument(s)' - 'taking False path' - 'when PyTuple_Pack() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 - 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/PyArg_UnpackTuple/correct/input.c', line=27), 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/PyArg_UnpackTuple/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')): - repr(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - str(): RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: None - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 2')) - argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33: - repr(): RegionOnHeap('argument 3', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33)) - str(): argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c', line=33), region=Region('PyTypeObject for argument 3')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:37 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1216, in impl_PyArg_UnpackTuple + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' e 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple v_fmt, v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O/input.c:33:37: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1164, in impl_PyArg_ParseTupleAndKeywords v_fmt, v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_UnpackTuple/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/script--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,149 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_UnpackTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:39 - 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - -Trace 1: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 1 argument(s)' - 'taking False path' - error: UsageOfUninitializedData() - error: passing uninitialized data (b.1) as argument 3 to function at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 - 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 1')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:28 - -Trace 2: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 2 argument(s)' - 'taking False path' - error: UsageOfUninitializedData() - error: passing uninitialized data (c.0) as argument 4 to function at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 - 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 2')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:28 - -Trace 3: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 3 argument(s)' - 'taking False path' - 'when PyTuple_Pack() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=42), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=42))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=42)) from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=42), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 2')) - argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 3', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 3')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:28 - -Trace 4: - Transitions: - 'when PyArg_UnpackTuple() successfully unpacks 3 argument(s)' - 'taking False path' - 'when PyTuple_Pack() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 - 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), 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/PyArg_UnpackTuple/missing-initialization/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 1', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 1 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 1')) - argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 2', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 2 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 2')) - argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38: - repr(): RegionOnHeap('argument 3', gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38)) - str(): argument 3 allocated at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c', line=38), region=Region('PyTypeObject for argument 3')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,10 +1,28 @@ In function 'test': -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42:nn: warning: passing uninitialized data (b.1) as argument 3 to function at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 [enabled by default] -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38:nn: note: when PyArg_UnpackTuple() successfully unpacks 1 argument(s) at: if (!PyArg_UnpackTuple(args, "test", 1, 3, &a, &b, &c)) { -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38:nn: note: taking False path at: if (!PyArg_UnpackTuple(args, "test", 1, 3, &a, &b, &c)) { -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42:nn: note: reaching: return PyTuple_Pack(3, a, b, c); -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42:nn: warning: passing uninitialized data (c.0) as argument 4 to function at tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42 [enabled by default] -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38:nn: note: when PyArg_UnpackTuple() successfully unpacks 2 argument(s) at: if (!PyArg_UnpackTuple(args, "test", 1, 3, &a, &b, &c)) { -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38:nn: note: taking False path at: if (!PyArg_UnpackTuple(args, "test", 1, 3, &a, &b, &c)) { -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:42:nn: note: reaching: return PyTuple_Pack(3, a, b, c); -tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1216, in impl_PyArg_UnpackTuple + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' .py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_UnpackTuple/correct/input.c:33:27: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1216, in impl_PyArg_UnpackTuple s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c: In function 'test': tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization/input.c:38:27: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,89 +0,0 @@ -Trace 0: - Transitions: - 'when PyCObject_FromVoidPtr() succeeds' - 'when PyTuple_Pack() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=44), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=44))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=44)) from tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38: - repr(): RegionOnHeap('PyCObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=38)) - str(): PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyCObject_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:37 - -Trace 1: - Transitions: - 'when PyCObject_FromVoidPtr() succeeds' - 'when PyTuple_Pack() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44 - 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38: - repr(): RegionOnHeap('PyCObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=38)) - str(): PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyCObject_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44 - -Trace 2: - Transitions: - 'when PyCObject_FromVoidPtr() fails (when py3k deprecation warnings are enabled and configured to raise exceptions)' - error: NullPtrArgument() - error: calling PyTuple_Pack with NULL as argument 3 (obj) at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44 - 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38 - -Trace 3: - Transitions: - 'when PyCObject_FromVoidPtr() fails' - error: NullPtrArgument() - error: calling PyTuple_Pack with NULL as argument 3 (obj) at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44 - 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtr/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,15 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: warning: ob_refcnt of '*obj' is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38:nn: note: PyCObject allocated at: PyObject *obj = PyCObject_FromVoidPtr(&some_foo, NULL); -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38:nn: note: when PyCObject_FromVoidPtr() succeeds at: PyObject *obj = PyCObject_FromVoidPtr(&some_foo, NULL); -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: when PyTuple_Pack() succeeds at: return PyTuple_Pack(2, self, obj); -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: returning at: return PyTuple_Pack(2, self, obj); -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: warning: calling PyTuple_Pack with NULL as argument 3 (obj) at tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44 [enabled by default] -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38:nn: note: when PyCObject_FromVoidPtr() fails (when py3k deprecation warnings are enabled and configured to raise exceptions) at: PyObject *obj = PyCObject_FromVoidPtr(&some_foo, NULL); -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: PyTuple_Pack() invokes Py_INCREF() on the pointer, thus accessing (NULL)->ob_refcnt -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:44:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:37:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1447, in impl_PyCObject_FromVoidPtr + 'PyCObject_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyCObject_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,89 +0,0 @@ -Trace 0: - Transitions: - 'when PyCObject_FromVoidPtrAndDesc() succeeds' - 'when PyTuple_Pack() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=44), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=44))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=44)) from tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38: - repr(): RegionOnHeap('PyCObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=38)) - str(): PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyCObject_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:37 - -Trace 1: - Transitions: - 'when PyCObject_FromVoidPtrAndDesc() succeeds' - 'when PyTuple_Pack() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44 - 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38: - repr(): RegionOnHeap('PyCObject', gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=38)) - str(): PyCObject allocated at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyCObject_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44 - -Trace 2: - Transitions: - 'when PyCObject_FromVoidPtrAndDesc() fails (when py3k deprecation warnings are enabled and configured to raise exceptions)' - error: NullPtrArgument() - error: calling PyTuple_Pack with NULL as argument 3 (obj) at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44 - 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38 - -Trace 3: - Transitions: - 'when PyCObject_FromVoidPtrAndDesc() fails' - error: NullPtrArgument() - error: calling PyTuple_Pack with NULL as argument 3 (obj) at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44 - 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), 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/PyCObject_FromVoidPtrAndDesc/incorrect/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,15 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: warning: ob_refcnt of '*obj' is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38:nn: note: PyCObject allocated at: PyObject *obj = PyCObject_FromVoidPtrAndDesc(&some_foo, "struct foo", NULL); -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38:nn: note: when PyCObject_FromVoidPtrAndDesc() succeeds at: PyObject *obj = PyCObject_FromVoidPtrAndDesc(&some_foo, "struct foo", NULL); -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: when PyTuple_Pack() succeeds at: return PyTuple_Pack(2, self, obj); -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: returning at: return PyTuple_Pack(2, self, obj); -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: warning: calling PyTuple_Pack with NULL as argument 3 (obj) at tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44 [enabled by default] -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38:nn: note: when PyCObject_FromVoidPtrAndDesc() fails (when py3k deprecation warnings are enabled and configured to raise exceptions) at: PyObject *obj = PyCObject_FromVoidPtrAndDesc(&some_foo, "struct foo", NULL); -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: PyTuple_Pack() invokes Py_INCREF() on the pointer, thus accessing (NULL)->ob_refcnt -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:44:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:37:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1464, in impl_PyCObject_FromVoidPtrAndDesc + 'PyCObject_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyCObject_Type' return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1216, in impl_PyArg_UnpackTuple s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyArg_UnpackTuple/wrong-number-of-varargs: OK tests/cpychecker/refcounts/PyBool_FromLong/correct: OK tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect/input.c:38:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1447, in impl_PyCObject_FromVoidPtr 'PyCObject_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyCObject_Type' tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorr--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,29 +0,0 @@ -Trace 0: - Transitions: - 'when PyCapsule_GetPointer() succeeds' - 'returning' - Return value: - repr(): UnknownValue(gcctype=gcc.PointerType(dereference=), loc=gcc.Location(file='tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c', line=29)) - str(): unknown void * from tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c:29 - region for gcc.ParmDecl('capsule') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('capsule')") - str(): region for gcc.ParmDecl('capsule') 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/PyCapsule_GetPointer/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('capsule')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c:28 - -Trace 1: - Transitions: - 'when PyCapsule_GetPointer() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='void *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c', line=29), value=0) - str(): (void *)0 from tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c:29 - region for gcc.ParmDecl('capsule') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('capsule')") - str(): region for gcc.ParmDecl('capsule') 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/PyCapsule_GetPointer/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('capsule')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_ValueError')) from tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1390, in impl_PyCapsule_GetPointer + stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_ValueError' ect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect/input.c:38:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1464, in impl_PyCObject_FromVoidPtrAndDesc 'PyCObject_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyCObject_Type' tests/cpychecker/refcounts/PyCapsule_GetPointer/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyCapsule_GetPointer/basic/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 21--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_New/correct/input.c', line=30), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_New/correct/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_New/correct/input.c', line=30)) from tests/cpychecker/refcounts/PyDict_New/correct/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_New/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_New/correct/input.c', line=27), 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/PyDict_New/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_New/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyDict_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_New/correct/input.c', line=32), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_New/correct/input.c:32 - 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/PyDict_New/correct/input.c', line=27), 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/PyDict_New/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_New/correct/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyDict_New/correct/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,731 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() succeeds' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28 - -Trace 2: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 3: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 4: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 5: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 6: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 7: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 8: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 9: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:48 - -Trace 10: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - -Trace 11: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - -Trace 12: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - -Trace 13: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43 - -Trace 14: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - -Trace 15: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38 - -Trace 16: - Transitions: - 'when PyDict_New() fails' - 'taking True path' - 'taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=65), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:65 - 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/PyDict_SetItem/correct/input.c', line=27), 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/PyDict_SetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,36 @@ +In function 'test': +tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' 05, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1390, in impl_PyCapsule_GetPointer stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_ValueError' tests/cpychecker/refcounts/PyDict_GetItem/correct: OK tests/cpychecker/refcounts/PyDict_GetItem/incorrect: OK tests/cpychecker/refcounts/PyDict_GetItemString/correct: OK tests/cpychecker/refcounts/PyDict_GetItemString/incorrect: OK tests/cpychecker/refcounts/PyDict_New/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyDict_New/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyDict_New/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyDict_New/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyDict_New/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyDict_New/correct/input.c:30:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyDict_SetItem/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyDict_SetItem/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyDict_SetItem/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c: In function 'test':--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,570 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() succeeds' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28 - -Trace 1: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28 - -Trace 2: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 3: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 4: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 5: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 6: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 7: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 8: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 9: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() succeeds' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - -Trace 10: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'when PyLong_FromLong() fails' - error: NullPtrArgument() - error: calling PyDict_SetItem with NULL as argument 3 (value) at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - -Trace 11: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'when PyLong_FromLong() succeeds' - error: NullPtrArgument() - error: calling PyDict_SetItem with NULL as argument 2 (key) at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38 - -Trace 12: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'when PyLong_FromLong() fails' - error: NullPtrArgument() - error: calling PyDict_SetItem with NULL as argument 2 (key) at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39 - -Trace 13: - Transitions: - 'when PyDict_New() fails' - 'taking True path' - 'taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=63), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:63 - 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/PyDict_SetItem/incorrect/input.c', line=27), 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/PyDict_SetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,17 +1,36 @@ In function 'test': -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:nn: warning: calling PyDict_SetItem with NULL as argument 3 (value) at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 [enabled by default] -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:nn: note: when PyDict_New() succeeds at: dict = PyDict_New(); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:34:nn: note: taking False path at: if (!dict) { -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:nn: note: reaching: key = PyLong_FromLong(500); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:nn: note: when PyLong_FromLong() succeeds at: key = PyLong_FromLong(500); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:nn: note: when PyLong_FromLong() fails at: value = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:nn: note: PyDict_SetItem() invokes Py_INCREF() on the pointer, thus accessing (NULL)->ob_refcnt -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:nn: warning: calling PyDict_SetItem with NULL as argument 2 (key) at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 [enabled by default] -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:nn: note: when PyDict_New() succeeds at: dict = PyDict_New(); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:34:nn: note: taking False path at: if (!dict) { -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:nn: note: reaching: key = PyLong_FromLong(500); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:nn: note: when PyLong_FromLong() fails at: key = PyLong_FromLong(500); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:nn: note: when PyLong_FromLong() succeeds at: value = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:nn: note: PyDict_SetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyDict_SetItem/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyDict_SetItem/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyDict_SetItem/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,278 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() succeeds' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42 - -Trace 2: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42 - -Trace 3: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42 - -Trace 4: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:42 - -Trace 5: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - -Trace 6: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:37 - -Trace 7: - Transitions: - 'when PyDict_New() fails' - 'taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c', line=56), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:56 - 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/PyDict_SetItemString/correct/input.c', line=27), 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/PyDict_SetItemString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyDict_SetItemString/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyDict_SetItemString/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyDict_SetItemString/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyDict_SetItemString/correct/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,277 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:28 - -Trace 1: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42 - -Trace 2: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42 - -Trace 3: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42 - -Trace 4: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_SetItemString() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=37)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42 - -Trace 5: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - -Trace 6: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=32)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37 - -Trace 7: - Transitions: - 'when PyDict_New() fails' - 'taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c', line=57), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:57 - 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/PyDict_SetItemString/incorrect/input.c', line=27), 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/PyDict_SetItemString/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,18 +1,34 @@ In function 'test': -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:58:nn: warning: ob_refcnt of '*value' is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:58:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:58:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37:nn: note: PyLongObject allocated at: value = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32:nn: note: when PyDict_New() succeeds at: dict = PyDict_New(); -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:33:nn: note: taking False path at: if (!dict) { -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37:nn: note: reaching: value = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37:nn: note: when PyLong_FromLong() succeeds at: value = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:37:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:38:nn: note: taking False path at: if (!value) { -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42:nn: note: reaching: if (-1 == PyDict_SetItemString(dict, "key", value)) { -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42:nn: note: when PyDict_SetItemString() succeeds at: if (-1 == PyDict_SetItemString(dict, "key", value)) { -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42:nn: note: ob_refcnt is now refs: 1 + N where N >= 1 -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:42:nn: note: taking False path at: if (-1 == PyDict_SetItemString(dict, "key", value)) { -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:52:nn: note: reaching: return dict; -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:58:nn: note: returning -tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,21 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown void * from tests/cpychecker/refcounts/PyDict_Size/simple/input.c:27 as non-NULL' - 'when PyDict_Size() returns ma_used' - 'returning' - Return value: - repr(): WithinRange(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_Size/simple/input.c', line=29), minvalue=-0x8000000000000000, maxvalue=0x7fffffffffffffff) - str(): (Py_ssize_t)val [-0x8000000000000000 <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyDict_Size/simple/input.c:29 - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_Size/simple/input.c:28 - -Trace 1: - Transitions: - 'when treating unknown void * from tests/cpychecker/refcounts/PyDict_Size/simple/input.c:27 as NULL' - 'when PyDict_Size raises SystemError (via PyErr_BadInternalCall) due to NULL as argument 1 at tests/cpychecker/refcounts/PyDict_Size/simple/input.c:29' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_Size/simple/input.c', line=29), value=-1) - str(): (Py_ssize_t)-1 from tests/cpychecker/refcounts/PyDict_Size/simple/input.c:29 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyDict_Size/simple/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyDict_Size/simple/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1621, in impl_PyDict_Size + ConcreteValue(stmt.lhs.type, stmt.loc, -1)) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 969, in handle_BadInternalCall_on_null + t_failure.dest.cpython.bad_internal_call(stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call + self.set_exception('PyExc_SystemError', loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyDict_SetItemString/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyDict_SetItemString/incorrect/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyDict_Size/simple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyDict_Size/simple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyDict_Size/simple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyDict_Size/simple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyDict_Size/simple/input.c: In function 'test': tests/cpychecker/refcounts/PyDict_Size/simple/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-pyt--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,61 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown char * from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:27 as non-NULL' - 'when PyErr_NewException() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyErr_NewException/basic/input.c', line=29), region=RegionOnHeap('new exception object from PyErr_NewException', gcc.Location(file='tests/cpychecker/refcounts/PyErr_NewException/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new exception object from PyErr_NewException', gcc.Location(file='tests/cpychecker/refcounts/PyErr_NewException/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyErr_NewException/basic/input.c', line=29), region=Region('PyTypeObject for new exception object from PyErr_NewException')) - region for gcc.ParmDecl('base') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('base')") - str(): region for gcc.ParmDecl('base') 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/PyErr_NewException/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('base')")) - region for gcc.ParmDecl('dict') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('dict')") - str(): region for gcc.ParmDecl('dict') 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/PyErr_NewException/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('dict')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:28 - -Trace 1: - Transitions: - 'when treating unknown char * from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:27 as non-NULL' - 'when PyErr_NewException() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyErr_NewException/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:29 - region for gcc.ParmDecl('base') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('base')") - str(): region for gcc.ParmDecl('base') 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/PyErr_NewException/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('base')")) - region for gcc.ParmDecl('dict') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('dict')") - str(): region for gcc.ParmDecl('dict') 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/PyErr_NewException/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('dict')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:29 - -Trace 2: - Transitions: - 'when treating unknown char * from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyErr_NewException with NULL as argument 1 (name) at tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:29 - region for gcc.ParmDecl('base') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('base')") - str(): region for gcc.ParmDecl('base') 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/PyErr_NewException/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('base')")) - region for gcc.ParmDecl('dict') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('dict')") - str(): region for gcc.ParmDecl('dict') 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/PyErr_NewException/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('dict')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1675, in impl_PyErr_NewException + objname='new exception object from %s' % fnmeta.name) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' hon-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1621, in impl_PyDict_Size ConcreteValue(stmt.lhs.type, stmt.loc, -1)) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 969, in handle_BadInternalCall_on_null t_failure.dest.cpython.bad_internal_call(stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call self.set_exception('PyExc_SystemError', loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/PyErr_Clear/correct: OK tests/cpychecker/refcounts/PyErr_Format/correct: OK tests/cpychecker/refcounts/PyErr_NewException/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyErr_NewException/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyErr_NewException/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyErr_NewException/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyErr_NewException/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyErr_NewException/basic/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1675, in impl_PyErr_NewException --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,19 +0,0 @@ -Trace 0: - Transitions: - 'PyErr_NoMemory() returns NULL, raising MemoryError' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c:29 - 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/PyErr_NoMemory/correct/input.c', line=27), 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/PyErr_NoMemory/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1688, in impl_PyErr_NoMemory + t_next.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyEval_CallMethod() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyEval_CallMethod', gcc.Location(file='tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyEval_CallMethod', gcc.Location(file='tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyEval_CallMethod')) - 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/PyEval_CallMethod/correct/input.c', line=27), 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/PyEval_CallMethod/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyEval_CallMethod() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c:29 - 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/PyEval_CallMethod/correct/input.c', line=27), 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/PyEval_CallMethod/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1830, in impl_PyEval_CallMethod + self._handle_PyObject_CallMethod(fncall, 2, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod + on_success, on_failure = fncall.new_ref_or_fail() + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail + on_failure.sets_exception('PyExc_MemoryError') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' objname='new exception object from %s' % fnmeta.name) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyErr_NoMemory/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyErr_NoMemory/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyErr_NoMemory/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyErr_NoMemory/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1688, in impl_PyErr_NoMemory t_next.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyErr_PrintEx: OK tests/cpychecker/refcounts/PyErr_SetFromErrno/correct: OK tests/cpychecker/refcounts/PyErr_SetNone/correct: OK tests/cpychecker/refcounts/PyErr_SetObject/correct: OK tests/cpychecker/refcounts/PyErr_SetString/correct: OK tests/cpychecker/refcounts/PyEval_CallMethod/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyEval_CallMethod/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyEval_CallMethod/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyEval_CallMethod/correct/input.c: In function 'test': tests--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,16 +0,0 @@ -Trace 0: - Transitions: - error: NullPtrArgument() - error: calling PyEval_CallMethod with NULL as argument 1 (0B) at tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:30 - 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/PyEval_CallMethod/incorrect/input.c', line=27), 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/PyEval_CallMethod/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,4 +1,34 @@ In function 'test': -tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:30:nn: warning: calling PyEval_CallMethod with NULL as argument 1 (0B) at tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:30 [enabled by default] -tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:30:nn: note: PyEval_CallMethod() invokes Py_TYPE() on the pointer within PyObject_GetAttrString(), thus accessing (NULL)->ob_type -tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1830, in impl_PyEval_CallMethod + self._handle_PyObject_CallMethod(fncall, 2, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod + on_success, on_failure = fncall.new_ref_or_fail() + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail + on_failure.sets_exception('PyExc_MemoryError') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' /cpychecker/refcounts/PyEval_CallMethod/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1830, in impl_PyEval_CallMethod self._handle_PyObject_CallMethod(fncall, 2, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod on_success, on_failure = fncall.new_ref_or_fail() File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail on_failure.sets_exception('PyExc_MemoryError') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyEval_CallMethod/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyEval_CallMethod/incorrect/input.c:30:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transition--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,48 +0,0 @@ -Trace 0: - Transitions: - 'when PyFloat_FromDouble() succeeds' - 'PyFloat_AsDouble() returns ob_fval' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='double', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c', line=33), value=42.0) - str(): (double)42.0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33 - PyFloatObject allocated at tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33: - repr(): RegionOnHeap('PyFloatObject', gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c', line=33)) - str(): PyFloatObject allocated at tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyFloat_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:29 - -Trace 1: - Transitions: - 'when PyFloat_FromDouble() succeeds' - 'PyFloat_AsDouble() returns ob_fval' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyFloatObject allocated at tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='double', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c', line=33), value=42.0) - str(): (double)42.0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33 - PyFloatObject allocated at tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33: - repr(): RegionOnHeap('PyFloatObject', gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c', line=33)) - str(): PyFloatObject allocated at tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:29 - -Trace 2: - Transitions: - 'when PyFloat_FromDouble() fails' - 'PyFloat_AsDouble() fails due to NULL argument' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='double', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c', line=36), value=-1) - str(): (double)-1 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:36 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:36 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1999, in impl_PyFloat_FromDouble + 'PyFloat_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyFloat_Type' s_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1830, in impl_PyEval_CallMethod self._handle_PyObject_CallMethod(fncall, 2, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod on_success, on_failure = fncall.new_ref_or_fail() File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail on_failure.sets_exception('PyExc_MemoryError') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c: In function 'test': tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject/input.c:33:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1999, in impl_PyFloat_FromDouble 'PyFloat_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl:--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,72 +0,0 @@ -Trace 0: - Transitions: - 'when PyFloat_AsDouble() succeeds' - 'when taking True path' - 'PyErr_Occurred()' - 'taking False path' - '__dump(unknown double from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:34)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c', line=49), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:49 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyFloat_AsDouble/correct_cast/input.c', line=30), 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/PyFloat_AsDouble/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:31 - -Trace 1: - Transitions: - 'when PyFloat_AsDouble() succeeds' - 'when taking False path' - '__dump(unknown double from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:34)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c', line=49), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:49 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyFloat_AsDouble/correct_cast/input.c', line=30), 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/PyFloat_AsDouble/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:31 - -Trace 2: - Transitions: - 'when PyFloat_AsDouble() fails' - 'taking True path' - 'PyErr_Occurred()' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:38 - 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/PyFloat_AsDouble/correct_cast/input.c', line=30), 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/PyFloat_AsDouble/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1987, in impl_PyFloat_AsDouble + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,21 +0,0 @@ -Trace 0: - Transitions: - 'when PyFloat_FromDouble() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c', line=29), region=RegionOnHeap('PyFloatObject', gcc.Location(file='tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyFloatObject', gcc.Location(file='tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c', line=29)) from tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyFloat_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c:28 - -Trace 1: - Transitions: - 'when PyFloat_FromDouble() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c:29 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1999, in impl_PyFloat_FromDouble + 'PyFloat_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyFloat_Type' could not find expected global variable 'PyFloat_Type' tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c: In function 'test': tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast/input.c:34:16: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1987, in impl_PyFloat_AsDouble t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyFloat_FromDouble/simple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyFloat_FromDouble/simple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyFloat_FromDouble/simple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c: In function 'test': tests/cpychecker/refcounts/PyFloat_FromDouble/simple/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpych--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,23 +0,0 @@ -Trace 0: - Transitions: - 'when PyInt_FromLong() succeeds' - 'PyInt_AsLong() returns ob_ival' - '__dump((long int)42 from tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c:35)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c', line=35), region=RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c', line=35))) - str(): (struct PyObject *)&RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c', line=35)) from tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c:35 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c', line=35), region=RegionForGlobal(gcc.VarDecl('PyInt_Type'))) - 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/PyInt_AsLong/correct_PyIntObject/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/PyInt_AsLong/correct_PyIntObject/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c:35:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2168, in impl_PyInt_FromLong + 'PyInt_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,99 +0,0 @@ -Trace 0: - Transitions: - 'when PyInt_AsLong() succeeds' - 'when considering range: -0x8000000000000000 <= value <= -2' - 'taking False path' - '__dump((long int)val [-0x8000000000000000 <= val <= -2] from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c', line=49), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:49 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyInt_AsLong/correct_cast/input.c', line=30), 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/PyInt_AsLong/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:31 - -Trace 1: - Transitions: - 'when PyInt_AsLong() succeeds' - 'when considering value == (long int)-1 from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34' - 'taking True path' - 'PyErr_Occurred()' - 'taking False path' - '__dump((long int)-1 from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c', line=49), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:49 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyInt_AsLong/correct_cast/input.c', line=30), 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/PyInt_AsLong/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:31 - -Trace 2: - Transitions: - 'when PyInt_AsLong() succeeds' - 'when considering range: 0 <= value <= 0x7fffffffffffffff' - 'taking False path' - '__dump((long int)val [0 <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c', line=49), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:49 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyInt_AsLong/correct_cast/input.c', line=30), 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/PyInt_AsLong/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:31 - -Trace 3: - Transitions: - 'when PyInt_AsLong() fails' - 'taking True path' - 'PyErr_Occurred()' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:38 - 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/PyInt_AsLong/correct_cast/input.c', line=30), 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/PyInt_AsLong/correct_cast/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2150, in impl_PyInt_AsLong + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' ecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1999, in impl_PyFloat_FromDouble 'PyFloat_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyFloat_Type' tests/cpychecker/refcounts/PyGILState_Ensure/correct: OK tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c: In function 'test': tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject/input.c:35:13: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2168, in impl_PyInt_FromLong 'PyInt_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' tests/cpychecker/refcounts/PyInt_AsLong/correct_cast: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplug--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyInt_FromLong() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c', line=34), region=RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c', line=34)) from tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyInt_Type'))) - 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/PyInt_FromLong/correct_large_int/input.c', line=28), 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/PyInt_FromLong/correct_large_int/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c:29 - -Trace 1: - Transitions: - 'when PyInt_FromLong() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c:34 - 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/PyInt_FromLong/correct_large_int/input.c', line=28), 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/PyInt_FromLong/correct_large_int/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2168, in impl_PyInt_FromLong + 'PyInt_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' in-arg-python-script=tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c: In function 'test': tests/cpychecker/refcounts/PyInt_AsLong/correct_cast/input.c:34:14: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2150, in impl_PyInt_AsLong t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c: In function 'test': tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int/input.c:34:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_G--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,21 +0,0 @@ -Trace 0: - Transitions: - 'when PyInt_FromLong() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c', line=31), region=RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c', line=31))) - str(): (struct PyObject *)&RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c', line=31)) from tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c:31 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyInt_Type'))) - 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/PyInt_FromLong/correct_small_int/input.c', line=28), 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/PyInt_FromLong/correct_small_int/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2168, in impl_PyInt_FromLong + 'PyInt_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,46 +0,0 @@ -Trace 0: - Transitions: - 'when PyIter_Next() retrieves a value (new ref)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyIter_Next/simple/input.c', line=29), region=RegionOnHeap('new ref returned by PyIter_Next()', gcc.Location(file='tests/cpychecker/refcounts/PyIter_Next/simple/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref returned by PyIter_Next()', gcc.Location(file='tests/cpychecker/refcounts/PyIter_Next/simple/input.c', line=29)) from tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyIter_Next/simple/input.c', line=29), region=Region('PyTypeObject for new ref returned by PyIter_Next()')) - region for gcc.ParmDecl('iter') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('iter')") - str(): region for gcc.ParmDecl('iter') 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/PyIter_Next/simple/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('iter')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyIter_Next/simple/input.c:28 - -Trace 1: - Transitions: - 'when PyIter_Next() returns NULL without setting an exception (end of iteration)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyIter_Next/simple/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29 - region for gcc.ParmDecl('iter') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('iter')") - str(): region for gcc.ParmDecl('iter') 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/PyIter_Next/simple/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('iter')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyIter_Next/simple/input.c:28 - -Trace 2: - Transitions: - 'when PyIter_Next() returns NULL setting an exception (error occurred)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyIter_Next/simple/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29 - region for gcc.ParmDecl('iter') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('iter')") - str(): region for gcc.ParmDecl('iter') 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/PyIter_Next/simple/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('iter')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,5 +1,28 @@ In function 'test': -tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29:nn: warning: returning (PyObject*)NULL without setting an exception [enabled by default] -tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29:nn: note: when PyIter_Next() returns NULL without setting an exception (end of iteration) at: return PyIter_Next(iter); -tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29:nn: note: returning at: return PyIter_Next(iter); -tests/cpychecker/refcounts/PyIter_Next/simple/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyIter_Next/simple/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2218, in impl_PyIter_Next + t_error.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' impleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2168, in impl_PyInt_FromLong 'PyInt_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c: In function 'test': tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int/input.c:31:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2168, in impl_PyInt_FromLong 'PyInt_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyInt_Type' tests/cpychecker/refcounts/PyIter_Next/simple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyIter_Next/simple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyIter_Next/simple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyIter_Next/simple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyIter_Next/simple/input.c: In function 'test': tests/cpychecker/refcounts/PyIter_Next/simple/input.c:29:5: error:--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,264 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() succeeds' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:45 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:42 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:45 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:42 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:45 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:42 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:45 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:42 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:39 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:39 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:36 - -Trace 7: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/correct/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/correct/input.c:34 - 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/PyList_Append/correct/input.c', line=27), 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/PyList_Append/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/correct/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyList_Append/correct/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2218, in impl_PyIter_Next t_error.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyList_Append/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Append/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Append/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Append/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Append/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Append/correct/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_n--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,263 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:28 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:45 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:45 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:45 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:45 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=36)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:39 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:39 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36 - -Trace 7: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:34 - 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/PyList_Append/incorrect/input.c', line=27), 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/PyList_Append/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,20 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:54:nn: warning: ob_refcnt of '*item' is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:54:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:54:nn: note: due to object being referenced by: PyListObject.ob_item[0] -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:54:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36:nn: note: PyLongObject allocated at: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32:nn: note: when PyList_New() succeeds at: list = PyList_New(0); -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:33:nn: note: taking False path at: if (!list) { -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36:nn: note: reaching: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36:nn: note: when PyLong_FromLong() succeeds at: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:36:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:37:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42:nn: note: reaching: if (-1 == PyList_Append(list, item)) { -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42:nn: note: when PyList_Append() succeeds at: if (-1 == PyList_Append(list, item)) { -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42:nn: note: '*item' is now referenced by 1 non-stack value(s): PyListObject.ob_item[0] -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:42:nn: note: taking False path at: if (-1 == PyList_Append(list, item)) { -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:53:nn: note: reaching: return list; -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:54:nn: note: returning -tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyList_Append/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,214 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= n <= 0' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:30 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() succeeds' - 'taking False path' - 'when PyList_Append() succeeds' - 'taking False path' - 'when considering n == (int)1 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:29' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41: - repr(): RegionOnHeap('new ref from (unknown) item_ctor', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41)) - str(): new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41), region=Region('PyTypeObject for new ref from (unknown) item_ctor')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:30 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=50), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:50 - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41: - repr(): RegionOnHeap('new ref from (unknown) item_ctor', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41)) - str(): new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41), region=Region('PyTypeObject for new ref from (unknown) item_ctor')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=50), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:50 - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41: - repr(): RegionOnHeap('new ref from (unknown) item_ctor', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41)) - str(): new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=50), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:50 - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: None - r->ob_type: None - new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41: - repr(): RegionOnHeap('new ref from (unknown) item_ctor', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41)) - str(): new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41), region=Region('PyTypeObject for new ref from (unknown) item_ctor')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=50), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:50 - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: None - r->ob_type: None - new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41: - repr(): RegionOnHeap('new ref from (unknown) item_ctor', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=41)) - str(): new ref from (unknown) item_ctor allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:44 - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - -Trace 7: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= n <= 0x7fffffff' - 'taking True path' - 'when item_ctor() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:44 - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41 - -Trace 8: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c', line=36), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:36 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,26 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:60:nn: warning: ob_refcnt of '*item' is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:60:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:60:nn: note: due to object being referenced by: PyListObject.ob_item[0] -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:60:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41:nn: note: new ref from (unknown) item_ctor allocated at: item = item_ctor(); -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34:nn: note: when PyList_New() succeeds at: list = PyList_New(0); -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:35:nn: note: taking False path at: if (!list) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:38:nn: note: reaching: for (i = 0; i < n; i++) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:38:nn: note: when considering range: 1 <= n <= 0x7fffffff at: for (i = 0; i < n; i++) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:38:nn: note: taking True path at: for (i = 0; i < n; i++) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41:nn: note: reaching: item = item_ctor(); -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41:nn: note: when item_ctor() succeeds at: item = item_ctor(); -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:41:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:42:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47:nn: note: reaching: if (PyList_Append(list, item)) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47:nn: note: when PyList_Append() succeeds at: if (PyList_Append(list, item)) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47:nn: note: '*item' is now referenced by 1 non-stack value(s): PyListObject.ob_item[0] -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:47:nn: note: taking False path at: if (PyList_Append(list, item)) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:38:nn: note: reaching: for (i = 0; i < n; i++) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:38:nn: note: when considering n == (int)1 from tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:29 at: for (i = 0; i < n; i++) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:38:nn: note: taking False path at: for (i = 0; i < n; i++) { -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:59:nn: note: reaching: return list; -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:60:nn: note: returning -tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:30:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' ame(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_Append/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Append/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Append/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Append/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Append/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Append/incorrect/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_Append/incorrect-loop: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Append/incorrect-loop/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Append/incorrect-loop/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Append/incorrect-loop/input.c:34:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", l--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,77 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'returning -1 from PyList_Append() due to NULL item' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c', line=37), value=-1) - str(): (int)-1 from tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:37 - 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/PyList_Append/null-newitem/input.c', line=27), 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/PyList_Append/null-newitem/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:37 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'returning -1 from PyList_Append() due to NULL item' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c', line=37), value=-1) - str(): (int)-1 from tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:37 - 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/PyList_Append/null-newitem/input.c', line=27), 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/PyList_Append/null-newitem/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c', line=32)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:37 - -Trace 2: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c', line=34), value=42) - str(): (int)42 from tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:34 - 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/PyList_Append/null-newitem/input.c', line=27), 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/PyList_Append/null-newitem/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' ine 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_Append/null-newitem: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Append/null-newitem/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Append/null-newitem/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Append/null-newitem/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_t--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,46 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown void * from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:30 as non-NULL' - 'when treating ob_size as 0' - 'when PyList_Append() succeeds' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c', line=33), value=0) - str(): (int)0 from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:33 - region for gcc.ParmDecl('item') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('item')") - str(): region for gcc.ParmDecl('item') on stack - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('item')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:31 - -Trace 1: - Transitions: - 'when treating unknown void * from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:30 as non-NULL' - 'when treating ob_size as 0' - 'when PyList_Append() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c', line=33), value=-1) - str(): (int)-1 from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:33 - region for gcc.ParmDecl('item') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('item')") - str(): region for gcc.ParmDecl('item') 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/PyList_Append/ticket-19/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('item')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:33 - -Trace 2: - Transitions: - 'when treating unknown void * from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:30 as NULL' - error: NullPtrArgument() - error: possibly calling PyList_Append with NULL as argument 1 (list) at tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:33 - region for gcc.ParmDecl('item') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('item')") - str(): region for gcc.ParmDecl('item') 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/PyList_Append/ticket-19/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('item')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2277, in impl_PyList_Append + s_failure.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,138 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:29 as non-NULL' - 'when PyList_Append() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37)) from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PyList_Append/ticket-22/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:33 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:29 as non-NULL' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:44 - 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/PyList_Append/ticket-22/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:42 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:29 as non-NULL' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:44 - 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/PyList_Append/ticket-22/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:42 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:29 as NULL' - 'returning -1 from PyList_Append() due to NULL item' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:44 - 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/PyList_Append/ticket-22/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:42 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:29 as NULL' - 'returning -1 from PyList_Append() due to NULL item' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=44), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:44 - 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/PyList_Append/ticket-22/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=37)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:42 - -Trace 5: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:39 - 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/PyList_Append/ticket-22/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' ypeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_Append/ticket-19: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Append/ticket-19/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Append/ticket-19/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Append/ticket-19/input.c:33:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2277, in impl_PyList_Append s_failure.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyList_Append/ticket-22: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Append/ticket-22/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Append/ticket-22/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Append/ticket-22/input.c:37:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-pytho--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,109 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27)) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PyList_SET_ITEM_macro/correct/input.c', line=23), 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/PyList_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:32: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=32)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:35 - 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/PyList_SET_ITEM_macro/correct/input.c', line=23), 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/PyList_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:32 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:35 - 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/PyList_SET_ITEM_macro/correct/input.c', line=23), 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/PyList_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=27)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:32 - -Trace 3: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:29 - 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/PyList_SET_ITEM_macro/correct/input.c', line=23), 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/PyList_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SET_ITEM_macro': +tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' n-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_GetItem/correct: OK tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c: In function 'handle_SET_ITEM_macro': tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct/input.c:27:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91,--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,647 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=50)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 7: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 8: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 9: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 10: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 11: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 12: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 13: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:42 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - -Trace 14: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:42 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:39 - -Trace 15: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:35 - 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SET_ITEM_macro': +tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,647 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=50)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 7: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 8: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 9: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 10: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 11: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 12: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 13: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:42 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - -Trace 14: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:42 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39 - -Trace 15: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:35 - 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyList_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,23 +1,30 @@ In function 'handle_SET_ITEM_macro': -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: warning: ob_refcnt of PyLongObject is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: due to object being referenced by: ob_item array for PyListObject[2] -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: PyLongObject allocated at: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33:nn: note: when PyList_New() succeeds at: list = PyList_New(3); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:34:nn: note: taking False path at: if (!list) { -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39:nn: note: reaching: items[0] = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:39:nn: note: when PyLong_FromLong() succeeds at: items[0] = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:40:nn: note: taking False path at: if (!items[0]) { -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44:nn: note: reaching: items[1] = PyLong_FromLong(2000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:44:nn: note: when PyLong_FromLong() succeeds at: items[1] = PyLong_FromLong(2000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:45:nn: note: taking False path at: if (!items[1]) { -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: reaching: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: when PyLong_FromLong() succeeds at: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:51:nn: note: taking False path at: if (!items[2]) { -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:64:nn: note: reaching: PyList_SET_ITEM(list, 0, items[0]); -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:66:nn: note: PyLongObject is now referenced by 1 non-stack value(s): ob_item array for PyListObject[2] -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:71:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: returning -tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:24:nn: note: graphical error report for function 'handle_SET_ITEM_macro' written out to 'tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c.handle_SET_ITEM_macro-refcount-errors.html' +tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c: In function 'handle_SET_ITEM_macro': tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple/input.c:33:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c: In function 'handle_SET_ITEM_macro': tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple/input.c:33:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gc--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,77 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyList_Size() returns ob_size' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Size/known-size/input.c', line=36), value=42) - str(): (int)42 from tests/cpychecker/refcounts/PyList_Size/known-size/input.c:36 - 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/PyList_Size/known-size/input.c', line=27), 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/PyList_Size/known-size/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Size/known-size/input.c', line=29)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Size/known-size/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Size/known-size/input.c:28 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyList_Size() returns ob_size' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Size/known-size/input.c', line=36), value=42) - str(): (int)42 from tests/cpychecker/refcounts/PyList_Size/known-size/input.c:36 - 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/PyList_Size/known-size/input.c', line=27), 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/PyList_Size/known-size/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PyList_Size/known-size/input.c', line=29)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyList_Size/known-size/input.c:28 - -Trace 2: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyList_Size/known-size/input.c', line=33), value=-1) - str(): (int)-1 from tests/cpychecker/refcounts/PyList_Size/known-size/input.c:33 - 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/PyList_Size/known-size/input.c', line=27), 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/PyList_Size/known-size/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' c-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_Size/known-size: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyList_Size/known-size/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyList_Size/known-size/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyList_Size/known-size/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyList_Size/known-size/input.c: In function 'test': tests/cpychecker/refcounts/PyList_Size/known-size/input.c:29:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.Co--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,29 +0,0 @@ -Trace 0: - Transitions: - 'when PyMapping_Size() succeeds' - 'returning' - Return value: - repr(): WithinRange(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyMapping_Size/basic/input.c', line=29), minvalue=-0x8000000000000000, maxvalue=0x7fffffffffffffff) - str(): (Py_ssize_t)val [-0x8000000000000000 <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyMapping_Size/basic/input.c:29 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyMapping_Size/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyMapping_Size/basic/input.c:28 - -Trace 1: - Transitions: - 'when PyMapping_Size() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyMapping_Size/basic/input.c', line=29), value=-1) - str(): (Py_ssize_t)-1 from tests/cpychecker/refcounts/PyMapping_Size/basic/input.c:29 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyMapping_Size/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PyMapping_Size/basic/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyMapping_Size/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2449, in impl_PyMapping_Size + stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,45 +0,0 @@ -Trace 0: - Transitions: - 'when PyMem_Malloc() succeeds' - 'taking False path' - 'calling PyMem_Free on PyMem_Malloc allocated at tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c:31' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c', line=41), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c:41 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PyMem_Malloc/correct/alloc-and-free/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/PyMem_Malloc/correct/alloc-and-free/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c:30 - -Trace 1: - Transitions: - 'when PyMem_Malloc() fails' - 'taking True path' - 'PyErr_NoMemory() returns NULL, raising MemoryError' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c:34 - 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/PyMem_Malloc/correct/alloc-and-free/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/PyMem_Malloc/correct/alloc-and-free/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/PyMem_Malloc/correct/alloc-and-free/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1688, in impl_PyErr_NoMemory + t_next.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' uldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PyList_Size/unknown-size: OK tests/cpychecker/refcounts/PyMapping_Size/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyMapping_Size/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyMapping_Size/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyMapping_Size/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyMapping_Size/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyMapping_Size/basic/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2449, in impl_PyMapping_Size stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c: In function 'test': tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free/input.c:34:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinte--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,39 +0,0 @@ -Trace 0: - Transitions: - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c', line=31), value=0) - str(): (int)0 from tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31 - region for gcc.ParmDecl('module') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('module')") - str(): region for gcc.ParmDecl('module') 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/PyModule_AddObject/incorrect-with-cast/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('module')")) - RegionForGlobal(gcc.VarDecl('fooType')): - repr(): RegionForGlobal(gcc.VarDecl('fooType')) - str(): RegionForGlobal(gcc.VarDecl('fooType')) - r->ob_refcnt: refs: -1 + N where N >= 2 - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:30 - -Trace 1: - Transitions: - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c', line=31), value=-1) - str(): (int)-1 from tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31 - region for gcc.ParmDecl('module') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('module')") - str(): region for gcc.ParmDecl('module') 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/PyModule_AddObject/incorrect-with-cast/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('module')")) - RegionForGlobal(gcc.VarDecl('fooType')): - repr(): RegionForGlobal(gcc.VarDecl('fooType')) - str(): RegionForGlobal(gcc.VarDecl('fooType')) - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,8 +1,28 @@ In function 'test': -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: warning: ob_refcnt of fooType is 1 too low [enabled by default] -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: note: but final ob_refcnt is N + -1 -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: note: when PyModule_AddObject() succeeds at: return PyModule_AddObject(module, -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: note: ob_refcnt is now refs: -1 + N where N >= 2 -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: note: returning at: return PyModule_AddObject(module, -tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:30:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2550, in impl_PyModule_AddObject + s_failure.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,31 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_CallFunction() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyObject_CallFunction', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallFunction', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyObject_CallFunction')) - region for gcc.ParmDecl('callable') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('callable')") - str(): region for gcc.ParmDecl('callable') 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/PyObject_CallFunction/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('callable')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_CallFunction() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c:29 - region for gcc.ParmDecl('callable') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('callable')") - str(): region for gcc.ParmDecl('callable') 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/PyObject_CallFunction/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('callable')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2692, in impl_PyObject_CallFunction + self._handle_PyObject_CallMethod(fncall, 1, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod + on_success, on_failure = fncall.new_ref_or_fail() + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail + on_failure.sets_exception('PyExc_MemoryError') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' rp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1688, in impl_PyErr_NoMemory t_next.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyMem_Malloc/correct/free-NULL: OK tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c: In function 'test': tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast/input.c:31:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2550, in impl_PyModule_AddObject s_failure.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_CallFunction/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallFunction/correct/output.o -fplu--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,51 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_CallFunctionObjArgs() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c', line=34), region=RegionOnHeap('new ref from call to PyObject_CallFunctionObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallFunctionObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c', line=34)) from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c', line=34), region=Region('PyTypeObject for new ref from call to PyObject_CallFunctionObjArgs')) - region for gcc.ParmDecl('callable') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('callable')") - str(): region for gcc.ParmDecl('callable') 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/PyObject_CallFunctionObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('callable')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallFunctionObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallFunctionObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c:33 - -Trace 1: - Transitions: - 'when PyObject_CallFunctionObjArgs() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c:34 - region for gcc.ParmDecl('callable') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('callable')") - str(): region for gcc.ParmDecl('callable') 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/PyObject_CallFunctionObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('callable')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallFunctionObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallFunctionObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2743, in impl_PyObject_CallFunctionObjArgs + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' gin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallFunction/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallFunction/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2692, in impl_PyObject_CallFunction self._handle_PyObject_CallMethod(fncall, 1, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod on_success, on_failure = fncall.new_ref_or_fail() File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail on_failure.sets_exception('PyExc_MemoryError') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct/input.c:34:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_CallFunctionObjArgs() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c', line=33), region=RegionOnHeap('new ref from call to PyObject_CallFunctionObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallFunctionObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c', line=33)) from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c', line=33), region=Region('PyTypeObject for new ref from call to PyObject_CallFunctionObjArgs')) - 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/PyObject_CallFunctionObjArgs/incorrect/input.c', line=28), 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/PyObject_CallFunctionObjArgs/incorrect/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:29 - -Trace 1: - Transitions: - 'when PyObject_CallFunctionObjArgs() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33 - 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/PyObject_CallFunctionObjArgs/incorrect/input.c', line=28), 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/PyObject_CallFunctionObjArgs/incorrect/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -6,3 +6,34 @@ tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:nn: warning: argument 6 had type char[3] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:nn: warning: argument 7 had type char[4] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:nn: warning: arguments to PyObject_CallFunctionObjArgs were not NULL-terminated [enabled by default] +tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2743, in impl_PyObject_CallFunctionObjArgs + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2743, in impl_PyObject_CallFunctionObjArgs return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: argument 2 had type char[12] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: argument 3 had type char[13] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: argument 4 had type char[4] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: argument 5 had type char[3] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: argument 6 had type char[3] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: argument 7 had type char[4] * but was expecting a PyObject* (or subclass) [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: warning: arguments to PyObject_CallFunctionObjArgs were not NULL-terminated [enabled by default] tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect/input.c:33:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refc--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_CallMethod() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyObject_CallMethod', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallMethod', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyObject_CallMethod')) - 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/PyObject_CallMethod/correct/input.c', line=27), 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/PyObject_CallMethod/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_CallMethod() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c:29 - 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/PyObject_CallMethod/correct/input.c', line=27), 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/PyObject_CallMethod/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2754, in impl_PyObject_CallMethod + self._handle_PyObject_CallMethod(fncall, 2, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_CallMethod + on_success, on_failure = fncall.new_ref_or_fail() + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail + on_failure.sets_exception('PyExc_MemoryError') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' ounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2743, in impl_PyObject_CallFunctionObjArgs return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_CallMethod/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallMethod/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallMethod/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallMethod/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2754, in impl_PyObject_CallMethod self._handle_PyObject_CallMethod(fncall, 2, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2613, in _handle_PyObject_Call--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,74 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when PyObject_CallMethod() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30), region=RegionOnHeap('new ref from call to PyObject_CallMethod', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallMethod', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30)) from tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30), region=Region('PyTypeObject for new ref from call to PyObject_CallMethod')) - 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/PyObject_CallMethod/correct-code-N/input.c', line=28), 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/PyObject_CallMethod/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:29 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when PyObject_CallMethod() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 - 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/PyObject_CallMethod/correct-code-N/input.c', line=28), 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/PyObject_CallMethod/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 - -Trace 2: - Transitions: - 'when PyLong_FromLong() fails' - 'when PyObject_CallMethod() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 - 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/PyObject_CallMethod/correct-code-N/input.c', line=28), 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/PyObject_CallMethod/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,163 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() succeeds' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39), region=RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39)) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39), region=Region('PyTypeObject for new ref from call to PyObject_CallMethodObjArgs')) - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=34)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:33 - -Trace 1: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() succeeds' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39), region=RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39)) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39), region=Region('PyTypeObject for new ref from call to PyObject_CallMethodObjArgs')) - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=34)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:33 - -Trace 2: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() fails' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:39 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=34)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:39 - -Trace 3: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() fails' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:39 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=34)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:39 - -Trace 4: - Transitions: - 'when PyString_FromString() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:37 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/correct/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' Method on_success, on_failure = fncall.new_ref_or_fail() File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 183, in new_ref_or_fail on_failure.sets_exception('PyExc_MemoryError') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N/input.c:30:31: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallMeth--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,163 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() succeeds' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43), region=RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43)) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43), region=Region('PyTypeObject for new ref from call to PyObject_CallMethodObjArgs')) - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=35)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=35), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:34 - -Trace 1: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() succeeds' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43), region=RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallMethodObjArgs', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43)) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43), region=Region('PyTypeObject for new ref from call to PyObject_CallMethodObjArgs')) - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=35)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:34 - -Trace 2: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() fails' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=35)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=35), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43 - -Trace 3: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PyObject_CallMethodObjArgs() fails' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=43), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=35)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43 - -Trace 4: - Transitions: - 'when PyString_FromString() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:38 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - region for gcc.ParmDecl('b') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('b')") - str(): region for gcc.ParmDecl('b') 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/PyObject_CallMethodObjArgs/incorrect/input.c', line=33), region=Region("region-for-type-of-arg-gcc.ParmDecl('b')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,7 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43:nn: warning: argument 3 had type char[13] * but was expecting a PyObject* (or subclass) [enabled by default] -tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43:nn: warning: argument 4 had type char[4] * but was expecting a PyObject* (or subclass) [enabled by default] -tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43:nn: warning: argument 5 had type char[3] * but was expecting a PyObject* (or subclass) [enabled by default] -tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43:nn: warning: argument 6 had type char[3] * but was expecting a PyObject* (or subclass) [enabled by default] -tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43:nn: warning: argument 7 had type char[4] * but was expecting a PyObject* (or subclass) [enabled by default] -tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:43:nn: warning: arguments to PyObject_CallMethodObjArgs were not NULL-terminated [enabled by default] +tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' odObjArgs/correct/input.c:34:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect/input.c:35:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_CallObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyObject_CallObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_CallObject', gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyObject_CallObject')) - region for gcc.ParmDecl('callable') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('callable')") - str(): region for gcc.ParmDecl('callable') 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/PyObject_CallObject/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('callable')")) - 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/PyObject_CallObject/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_CallObject() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c:29 - region for gcc.ParmDecl('callable') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('callable')") - str(): region for gcc.ParmDecl('callable') 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/PyObject_CallObject/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('callable')")) - 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/PyObject_CallObject/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2800, in impl_PyObject_CallObject + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_GenericGetAttr() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c', line=29), region=RegionOnHeap('new ref from PyObject_GenericGetAttr()', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from PyObject_GenericGetAttr()', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c', line=29), region=Region('PyTypeObject for new ref from PyObject_GenericGetAttr()')) - region for gcc.ParmDecl('o') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('o')") - str(): region for gcc.ParmDecl('o') 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/PyObject_GenericGetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('o')")) - region for gcc.ParmDecl('name') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('name')") - str(): region for gcc.ParmDecl('name') 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/PyObject_GenericGetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('name')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_GenericGetAttr() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c:29 - region for gcc.ParmDecl('o') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('o')") - str(): region for gcc.ParmDecl('o') 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/PyObject_GenericGetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('o')")) - region for gcc.ParmDecl('name') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('name')") - str(): region for gcc.ParmDecl('name') 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/PyObject_GenericGetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('name')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2859, in impl_PyObject_GenericGetAttr + on_failure.sets_exception('PyExc_MemoryError') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyObject_CallObject/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_CallObject/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_CallObject/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_CallObject/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2800, in impl_PyObject_CallObject return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/inp--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,49 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_GenericSetAttr() succeeds' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c', line=29), value=0) - str(): (int)0 from tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c:29 - region for gcc.ParmDecl('o') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('o')") - str(): region for gcc.ParmDecl('o') 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/PyObject_GenericSetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('o')")) - region for gcc.ParmDecl('name') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('name')") - str(): region for gcc.ParmDecl('name') 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/PyObject_GenericSetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('name')")) - region for gcc.ParmDecl('value') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('value')") - str(): region for gcc.ParmDecl('value') 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/PyObject_GenericSetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('value')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_GenericSetAttr() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='int', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c', line=29), value=-1) - str(): (int)-1 from tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c:29 - region for gcc.ParmDecl('o') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('o')") - str(): region for gcc.ParmDecl('o') 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/PyObject_GenericSetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('o')")) - region for gcc.ParmDecl('name') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('name')") - str(): region for gcc.ParmDecl('name') 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/PyObject_GenericSetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('name')")) - region for gcc.ParmDecl('value') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('value')") - str(): region for gcc.ParmDecl('value') 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/PyObject_GenericSetAttr/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('value')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_AttributeError')) from tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2882, in impl_PyObject_GenericSetAttr + on_failure.sets_exception('PyExc_AttributeError') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_AttributeError' ut.c: In function 'test': tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2859, in impl_PyObject_GenericGetAttr on_failure.sets_exception('PyExc_MemoryError') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitio--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_GetAttr() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyObject_GetAttr', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_GetAttr', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyObject_GetAttr')) - 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/PyObject_GetAttr/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - region for gcc.ParmDecl('attrname') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('attrname')") - str(): region for gcc.ParmDecl('attrname') 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/PyObject_GetAttr/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('attrname')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_GetAttr() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c:29 - 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/PyObject_GetAttr/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - region for gcc.ParmDecl('attrname') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('attrname')") - str(): region for gcc.ParmDecl('attrname') 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/PyObject_GetAttr/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('attrname')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2811, in impl_PyObject_GetAttr + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_GetAttrString() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyObject_GetAttrString', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_GetAttrString', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyObject_GetAttrString')) - 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/PyObject_GetAttrString/correct/input.c', line=27), 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/PyObject_GetAttrString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_GetAttrString() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c:29 - 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/PyObject_GetAttrString/correct/input.c', line=27), 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/PyObject_GetAttrString/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2824, in impl_PyObject_GetAttrString + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' ns_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2882, in impl_PyObject_GenericSetAttr on_failure.sets_exception('PyExc_AttributeError') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_AttributeError' tests/cpychecker/refcounts/PyObject_GetAttr/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_GetAttr/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_GetAttr/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_GetAttr/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2811, in impl_PyObject_GetAttr return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_GetAttr/incorrect: OK tests/cpychecker/refcounts/PyObject_GetAttrString/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_GetAttrString/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_GetAttrString/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecke--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_GetItem() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c', line=29), region=RegionOnHeap('new ref from call to PyObject_GetItem', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_GetItem', gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to PyObject_GetItem')) - 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/PyObject_GetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - region for gcc.ParmDecl('key') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('key')") - str(): region for gcc.ParmDecl('key') 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/PyObject_GetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('key')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_GetItem() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c:29 - 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/PyObject_GetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - region for gcc.ParmDecl('key') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('key')") - str(): region for gcc.ParmDecl('key') 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/PyObject_GetItem/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('key')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2838, in impl_PyObject_GetItem + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' r/refcounts/PyObject_GetAttrString/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_GetAttrString/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2824, in impl_PyObject_GetAttrString return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_GetAttrString/incorrect: OK tests/cpychecker/refcounts/PyObject_GetItem/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_GetItem/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_GetItem/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_GetItem/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absin--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,19 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_GetItem raises SystemError due to NULL as argument 2 at tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c:29' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c:29 - 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/PyObject_GetItem/incorrect/input.c', line=27), 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/PyObject_GetItem/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2835, in impl_PyObject_GetItem + t_err = self.handle_null_error(stmt, 1, v_key) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 941, in handle_null_error + stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' terp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2838, in impl_PyObject_GetItem return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_GetItem/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_GetItem/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_GetItem/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_GetItem/incorrect/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2835, in impl_PyObject_GetItem t_err = self.handle_null_error(stmt, 1, v_key) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 941, in handle_null_error stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/PyObject_HasAttrString/correct: OK tests/cpychecker/refcounts/PyObject_HasAttrString/incor--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,68 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_IsTrue() returns 1 (true)' - 'PyBool_FromLong() returns' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31), region=RegionOnHeap('PyBool_FromLong', gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31))) - str(): (struct PyObject *)&RegionOnHeap('PyBool_FromLong', gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31)) from tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:31 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31), region=Region('PyTypeObject for PyBool_FromLong')) - 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/PyObject_IsTrue/correct/input.c', line=27), 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/PyObject_IsTrue/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyObject_IsTrue() returns 0 (false)' - 'PyBool_FromLong() returns' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31), region=RegionOnHeap('PyBool_FromLong', gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31))) - str(): (struct PyObject *)&RegionOnHeap('PyBool_FromLong', gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31)) from tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:31 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31), region=Region('PyTypeObject for PyBool_FromLong')) - 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/PyObject_IsTrue/correct/input.c', line=27), 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/PyObject_IsTrue/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:28 - -Trace 2: - Transitions: - 'when PyObject_IsTrue() returns -1 (failure)' - 'PyBool_FromLong() returns' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31), region=RegionOnHeap('PyBool_FromLong', gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31))) - str(): (struct PyObject *)&RegionOnHeap('PyBool_FromLong', gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31)) from tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:31 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c', line=31), region=Region('PyTypeObject for PyBool_FromLong')) - 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/PyObject_IsTrue/correct/input.c', line=27), 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/PyObject_IsTrue/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2923, in impl_PyObject_IsTrue + on_failure.sets_exception('PyExc_MemoryError') # arbitrarily chosen error + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3010, in impl_PyObject_SetAttrString + on_failure.sets_exception('PyExc_TypeError') # e.g. + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception + self.state.cpython.set_exception(exc_name, self.get_stmt().loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' rect: OK tests/cpychecker/refcounts/PyObject_IsTrue/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_IsTrue/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_IsTrue/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_IsTrue/correct/input.c:29:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2923, in impl_PyObject_IsTrue on_failure.sets_exception('PyExc_MemoryError') # arbitrarily chosen error File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs/input.c: In function 'test': tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs/input.c:31:27: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpyc--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,146 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'PySequence_SetItem() succeeds' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29)) from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PySequence_SetItem/correct/input.c', line=23), 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/PySequence_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=34)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'PySequence_SetItem() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29)) from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PySequence_SetItem/correct/input.c', line=23), 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/PySequence_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=34)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:24 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:37 - 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/PySequence_SetItem/correct/input.c', line=23), 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/PySequence_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:37 - 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/PySequence_SetItem/correct/input.c', line=23), 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/PySequence_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=29)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:34 - -Trace 4: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c', line=31), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:31 - 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/PySequence_SetItem/correct/input.c', line=23), 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/PySequence_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SetItem': +tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,111 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'PySequence_SetItem() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29)) from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/PySequence_SetItem/incorrect/input.c', line=23), 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/PySequence_SetItem/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=34)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:37 - 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/PySequence_SetItem/incorrect/input.c', line=23), 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/PySequence_SetItem/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:37 - 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/PySequence_SetItem/incorrect/input.c', line=23), 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/PySequence_SetItem/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=29)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34 - -Trace 3: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c', line=31), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:31 - 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/PySequence_SetItem/incorrect/input.c', line=23), 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/PySequence_SetItem/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,17 +1,30 @@ In function 'handle_SetItem': -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:51:nn: warning: ob_refcnt of '*item' is 1 too high [enabled by default] -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:51:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:51:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34:nn: note: PyLongObject allocated at: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29:nn: note: when PyList_New() succeeds at: list = PyList_New(1); -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:30:nn: note: taking False path at: if (!list) { -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34:nn: note: reaching: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34:nn: note: when PyLong_FromLong() succeeds at: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:34:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:35:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:41:nn: note: reaching: rv = PySequence_SetItem(list, 0, item); -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:41:nn: note: PySequence_SetItem() succeeds at: rv = PySequence_SetItem(list, 0, item); -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:42:nn: note: taking False path at: if (rv != 0) { -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:50:nn: note: reaching: return list; -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:51:nn: note: returning -tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:24:nn: note: graphical error report for function 'handle_SetItem' written out to 'tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c.handle_SetItem-refcount-errors.html' +tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' hecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3010, in impl_PyObject_SetAttrString on_failure.sets_exception('PyExc_TypeError') # e.g. File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 261, in sets_exception self.state.cpython.set_exception(exc_name, self.get_stmt().loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/PySequence_SetItem/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PySequence_SetItem/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PySequence_SetItem/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c: In function 'handle_SetItem': tests/cpychecker/refcounts/PySequence_SetItem/correct/input.c:29:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PySequence_SetItem/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,147 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PySequence_Size() succeeds' - 'taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:36 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PySequence_Size/correct/input.c', line=23), 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/PySequence_Size/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=28)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=28), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PySequence_Size() succeeds' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:36 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PySequence_Size/correct/input.c', line=23), 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/PySequence_Size/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=28)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:24 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PySequence_Size() fails' - 'taking False path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=26), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:26 - 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/PySequence_Size/correct/input.c', line=23), 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/PySequence_Size/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=28)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=28), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:33 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PySequence_Size() fails' - 'taking False path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=26), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:26 - 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/PySequence_Size/correct/input.c', line=23), 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/PySequence_Size/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=28)) - str(): PyListObject allocated at tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:33 - -Trace 4: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/correct/input.c', line=26), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:26 - 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/PySequence_Size/correct/input.c', line=23), 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/PySequence_Size/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'handle_PySequence_Size': +tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' refcounts/PySequence_SetItem/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PySequence_SetItem/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c: In function 'handle_SetItem': tests/cpychecker/refcounts/PySequence_SetItem/incorrect/input.c:29:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PySequence_Size/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PySequence_Size/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PySequence_Size/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PySequence_Size/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PySequence_Size/correct/input.c: In function 'handle_PySequence_Size': tests/cpychecker/refcounts/PySequence_Size/correct/input.c:28:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,21 +0,0 @@ -Trace 0: - Transitions: - 'when PySequence_Size raises SystemError due to NULL as argument 1 at tests/cpychecker/refcounts/PySequence_Size/null/input.c:29' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySequence_Size/null/input.c', line=26), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySequence_Size/null/input.c:26 - 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/PySequence_Size/null/input.c', line=23), 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/PySequence_Size/null/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PySequence_Size/null/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'handle_PySequence_Size_NULL': +tests/cpychecker/refcounts/PySequence_Size/null/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3186, in impl_PySequence_Size + t_err = self.handle_null_error(stmt, 0, v_o, rawreturnvalue=-1) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 941, in handle_null_error + stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/PySequence_Size/null: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PySequence_Size/null/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PySequence_Size/null/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PySequence_Size/null/input.c Stdout: Stderr: tests/cpychecker/refcounts/PySequence_Size/null/input.c: In function 'handle_PySequence_Size_NULL': tests/cpychecker/refcounts/PySequence_Size/null/input.c:29:24: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3186, in impl_PySequence_Size t_err = self.handle_null_error(stmt, 0, v_o, rawreturnvalue=-1) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 941, in handle_null_error stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,142 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_Repr() succeeds' - 'taking False path' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() succeeds' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36)) from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:36 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_AsString/correct/input.c', line=26), 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/PyString_AsString/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:27 - -Trace 1: - Transitions: - 'when PyObject_Repr() succeeds' - 'taking False path' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() succeeds' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36)) from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:36 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_AsString/correct/input.c', line=26), 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/PyString_AsString/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:27 - -Trace 2: - Transitions: - 'when PyObject_Repr() succeeds' - 'taking False path' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() fails' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:36 - 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/PyString_AsString/correct/input.c', line=26), 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/PyString_AsString/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:36 - -Trace 3: - Transitions: - 'when PyObject_Repr() succeeds' - 'taking False path' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() fails' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=36), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:36 - 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/PyString_AsString/correct/input.c', line=26), 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/PyString_AsString/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:36 - -Trace 4: - Transitions: - 'when PyObject_Repr() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/correct/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:33 - 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/PyString_AsString/correct/input.c', line=26), 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/PyString_AsString/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2964, in impl_PyObject_Repr + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,135 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_Repr() succeeds' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() succeeds' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38)) from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_AsString/incorrect/input.c', line=26), 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/PyString_AsString/incorrect/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:27 - -Trace 1: - Transitions: - 'when PyObject_Repr() succeeds' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() succeeds' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38)) from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_AsString/incorrect/input.c', line=26), 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/PyString_AsString/incorrect/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:27 - -Trace 2: - Transitions: - 'when PyObject_Repr() succeeds' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() fails' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - 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/PyString_AsString/incorrect/input.c', line=26), 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/PyString_AsString/incorrect/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - -Trace 3: - Transitions: - 'when PyObject_Repr() succeeds' - 'PyString_AsString() returns ob_sval' - 'when PyString_FromFormat() fails' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - 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/PyString_AsString/incorrect/input.c', line=26), 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/PyString_AsString/incorrect/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - -Trace 4: - Transitions: - 'when PyObject_Repr() fails' - error: NullPtrArgument() - error: calling PyString_AsString with NULL as argument 1 (repr_args) at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 - 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/PyString_AsString/incorrect/input.c', line=26), 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/PyString_AsString/incorrect/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,5 +1,34 @@ In function 'test': -tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38:nn: warning: calling PyString_AsString with NULL as argument 1 (repr_args) at tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38 [enabled by default] -tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31:nn: note: when PyObject_Repr() fails at: repr_args = PyObject_Repr(args); -tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:38:nn: note: PyString_AsString() invokes Py_TYPE() on the pointer via the PyString_Check() macro, thus accessing (NULL)->ob_type -tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:27:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2964, in impl_PyObject_Repr + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' .compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/PyString_AsString/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_AsString/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_AsString/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_AsString/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_AsString/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyString_AsString/correct/input.c:31:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2964, in impl_PyObject_Repr 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_AsString/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_AsString/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_AsString/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyString_AsString/incorrect/input.c:31:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,87 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_AsString() succeeds' - 'when PyString_FromFormat() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33)) from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_AsString/unknown/input.c', line=27), 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/PyString_AsString/unknown/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:28 - -Trace 1: - Transitions: - 'when PyString_AsString() succeeds' - 'when PyString_FromFormat() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 - 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/PyString_AsString/unknown/input.c', line=27), 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/PyString_AsString/unknown/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 - -Trace 2: - Transitions: - 'when PyString_AsString() fails' - 'when PyString_FromFormat() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33)) from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_AsString/unknown/input.c', line=27), 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/PyString_AsString/unknown/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 - -Trace 3: - Transitions: - 'when PyString_AsString() fails' - 'when PyString_FromFormat() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_AsString/unknown/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 - 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/PyString_AsString/unknown/input.c', line=27), 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/PyString_AsString/unknown/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3244, in impl_PyString_AsString + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' .py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2964, in impl_PyObject_Repr 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_AsString/unknown: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_AsString/unknown/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_AsString/unknown/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_AsString/unknown/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_AsString/unknown/input.c: In function 'test': tests/cpychecker/refcounts/PyString_AsString/unknown/input.c:33:33: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3244, in impl_PyString_AsString t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = comp--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,101 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as non-NULL' - 'when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), region=Region('PyTypeObject for result of PyString_Concat')) - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_Concat/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:28 - -Trace 1: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as non-NULL' - 'when PyString_Concat() succeeds (Py_DECREF() with deallocation on *LHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), region=Region('PyTypeObject for result of PyString_Concat')) - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_Concat/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:28 - -Trace 2: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as non-NULL' - 'when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_Concat/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - -Trace 3: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as non-NULL' - 'when PyString_Concat() fails (Py_DECREF() with deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_Concat/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - -Trace 4: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as NULL' - 'when PyString_Concat() does nothing due to NULL *lhs' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_Concat/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:28 - -Trace 5: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_Concat with NULL as argument 1 (lhs) at tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_Concat/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,18 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: was expecting final ob_refcnt to be N + 2 (for some unknown N) -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: due to object being referenced by: return value, heap-region-0 -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: note: result of PyString_Concat allocated at: PyString_Concat(lhs, rhs); -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: note: when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL at: PyString_Concat(lhs, rhs); -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as non-NULL at: PyString_Concat(lhs, rhs); -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) at: return *lhs; -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: return value is now referenced by 1 non-stack value(s): heap-region-0 -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: returning at: return *lhs; -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: warning: returning (PyObject*)NULL without setting an exception [enabled by default] -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: note: when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:27 as non-NULL at: PyString_Concat(lhs, rhs); -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29 as NULL at: PyString_Concat(lhs, rhs); -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: note: when PyString_Concat() does nothing due to NULL *lhs at: PyString_Concat(lhs, rhs); -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:30:nn: note: returning at: return *lhs; -tests/cpychecker/refcounts/PyString_Concat/basic/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyString_Concat/basic/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3284, in impl_PyString_Concat + typeobjregion = self.typeobjregion_by_name('PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,203 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=Region('PyTypeObject for result of PyString_Concat')) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:28 - -Trace 1: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() succeeds (Py_DECREF() with deallocation on *LHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=Region('PyTypeObject for result of PyString_Concat')) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:28 - -Trace 2: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - -Trace 3: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() fails (Py_DECREF() with deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - -Trace 4: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when PyString_Concat() cleans up due to NULL right-hand side (Py_DECREF() without deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - -Trace 5: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when PyString_Concat() cleans up due to NULL right-hand side (Py_DECREF() with deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - -Trace 6: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (msg1) at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:28 - -Trace 7: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() does nothing due to NULL *lhs' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - -Trace 8: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when PyString_Concat() does nothing due to NULL *lhs' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - -Trace 9: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (msg1) at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - -Trace 10: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (msg0) at tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29 - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,14 +1,32 @@ In function 'test': -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:34:nn: warning: ob_refcnt of PyStringObject is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:34:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:34:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32:nn: note: PyStringObject allocated at: PyString_Concat(&result, PyString_FromString(msg1)); -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29:nn: note: when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL at: PyObject *result = PyString_FromString(msg0); -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29:nn: note: when PyString_FromString() succeeds at: PyObject *result = PyString_FromString(msg0); -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32:nn: note: when treating unknown const char * from tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:27 as non-NULL at: PyString_Concat(&result, PyString_FromString(msg1)); -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32:nn: note: when PyString_FromString() succeeds at: PyString_Concat(&result, PyString_FromString(msg1)); -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:32:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:34:nn: note: when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) at: return result; -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:34:nn: note: returning at: return result; -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:34:nn: note: found 4 similar trace(s) to this -tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' at.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyString_Concat/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_Concat/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_Concat/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_Concat/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_Concat/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyString_Concat/basic/input.c:29:20: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3284, in impl_PyString_Concat typeobjregion = self.typeobjregion_by_name('PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c: In function 'test': tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs/input.c:29:43: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,190 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=Region('PyTypeObject for result of PyString_Concat')) - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 - -Trace 1: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=Region('PyTypeObject for result of PyString_Concat')) - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 - -Trace 2: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() succeeds (Py_DECREF() with deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=Region('PyTypeObject for result of PyString_Concat')) - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 - -Trace 3: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() succeeds (Py_DECREF() with deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), region=Region('PyTypeObject for result of PyString_Concat')) - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 - -Trace 4: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - -Trace 5: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - -Trace 6: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() fails (Py_DECREF() with deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - -Trace 7: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL' - 'when PyString_Concat() fails (Py_DECREF() with deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - -Trace 8: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as NULL' - 'when PyString_Concat() does nothing due to NULL *lhs (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 - -Trace 9: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL' - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as NULL' - 'when PyString_Concat() does nothing due to NULL *lhs (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') on stack - r->ob_refcnt: refs: -1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 - -Trace 10: - Transitions: - 'when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_ConcatAndDel with NULL as argument 1 (lhs) at tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 - region for gcc.ParmDecl('rhs') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('rhs')") - str(): region for gcc.ParmDecl('rhs') 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/PyString_ConcatAndDel/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('rhs')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,27 +1,32 @@ In function 'test': -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: warning: ob_refcnt of '*rhs' is 1 too low [enabled by default] -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: but final ob_refcnt is N + -1 -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS) at: return *lhs; -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: ob_refcnt is now refs: -1 + N where N >= 1 -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: returning at: return *lhs; -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: found 9 similar trace(s) to this -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: was expecting final ob_refcnt to be N + 2 (for some unknown N) -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: due to object being referenced by: return value, heap-region-0 -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: result of PyString_Concat allocated at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as non-NULL at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS) at: return *lhs; -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: returning at: return *lhs; -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: found 3 similar trace(s) to this -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: warning: returning (PyObject*)NULL without setting an exception [enabled by default] -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: when treating unknown struct PyObject * * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:27 as non-NULL at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29 as NULL at: PyString_ConcatAndDel(lhs, rhs); -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: when PyString_Concat() does nothing due to NULL *lhs (Py_DECREF() without deallocation on RHS) at: return *lhs; -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: returning at: return *lhs; -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:37:nn: note: found 1 similar trace(s) to this -tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3328, in impl_PyString_ConcatAndDel + results = self.impl_PyString_Concat(stmt, v_pv, v_w) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3284, in impl_PyString_Concat + typeobjregion = self.typeobjregion_by_name('PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_Concat/null-lhs: OK tests/cpychecker/refcounts/PyString_Concat/null-rhs: OK tests/cpychecker/refcounts/PyString_ConcatAndDel/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyString_ConcatAndDel/basic/input.c:29:26: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3328, in impl_PyString_ConcatAndDel results = self.impl_PyString_Concat(stmt, v_pv, v_w) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3284, in impl_PyString_Concat typeobjregion = self.typeobjregion_by_name('PyString_--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,322 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=Region('PyTypeObject for result of PyString_Concat')) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:28 - -Trace 1: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=Region('PyTypeObject for result of PyString_Concat')) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:28 - -Trace 2: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() succeeds (Py_DECREF() with deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=Region('PyTypeObject for result of PyString_Concat')) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:28 - -Trace 3: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() succeeds (Py_DECREF() with deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('result of PyString_Concat', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=Region('PyTypeObject for result of PyString_Concat')) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:28 - -Trace 4: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 5: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 6: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() fails (Py_DECREF() with deallocation on *LHS) (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 7: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() fails (Py_DECREF() with deallocation on *LHS) (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 8: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when PyString_Concat() cleans up due to NULL right-hand side (Py_DECREF() without deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 9: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when PyString_Concat() cleans up due to NULL right-hand side (Py_DECREF() with deallocation on *LHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 10: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (msg1) at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:28 - -Trace 11: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() does nothing due to NULL *lhs (Py_DECREF() without deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - -Trace 12: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() succeeds' - 'when PyString_Concat() does nothing due to NULL *lhs (Py_DECREF() with deallocation on RHS)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - -Trace 13: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when PyString_Concat() does nothing due to NULL *lhs' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - -Trace 14: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as non-NULL' - 'when PyString_FromString() fails' - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (msg1) at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:30 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - -Trace 15: - Transitions: - 'when treating unknown const char * from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:27 as NULL' - error: NullPtrArgument() - error: possibly calling PyString_FromString with NULL as argument 1 (msg0) at tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29 - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:28 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'test': +tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_FromStringAndSize() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c', line=29), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c', line=29)) from tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/PyString_FromStringAndSize/correct/input.c', line=26), 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/PyString_FromStringAndSize/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c:27 - -Trace 1: - Transitions: - 'when PyString_FromStringAndSize() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c:29 - 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/PyString_FromStringAndSize/correct/input.c', line=26), 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/PyString_FromStringAndSize/correct/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3381, in impl_PyString_FromStringAndSize + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_ConcatAndDel/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyString_ConcatAndDel/correct/input.c:29:43: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_ConcatAndDel/null-lhs: OK tests/cpychecker/refcounts/PyString_ConcatAndDel/null-rhs: OK tests/cpychecker/refcounts/PyString_FromStringAndSize/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyString_FromStringAndSize/correct/input.c:29:12: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,29 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_Size() succeeds' - 'returning' - Return value: - repr(): WithinRange(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Size/correct/input.c', line=29), minvalue=0, maxvalue=0x7fffffffffffffff) - str(): (Py_ssize_t)val [0 <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyString_Size/correct/input.c:29 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyString_Size/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyString_Size/correct/input.c:28 - -Trace 1: - Transitions: - 'when PyString_Size() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyString_Size/correct/input.c', line=29), value=-1) - str(): (Py_ssize_t)-1 from tests/cpychecker/refcounts/PyString_Size/correct/input.c:29 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyString_Size/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyString_Size/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyString_Size/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3421, in impl_PyString_Size + s_failure.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' /home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3381, in impl_PyString_FromStringAndSize 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyString_Size/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyString_Size/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyString_Size/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyString_Size/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyString_Size/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyString_Size/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3421, in impl_PyString_Size s_failure.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcoun--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,55 +0,0 @@ -Trace 0: - Transitions: - 'when PyStructSequence_New() succeeds' - 'taking False path' - 'when PyInt_FromLong() succeeds' - 'when PyInt_FromLong() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=50), region=RegionOnHeap('PyStructSequence_New', gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=50))) - str(): (struct PyObject *)&RegionOnHeap('PyStructSequence_New', gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=50)) from tests/cpychecker/refcounts/PyStructSequence/correct/input.c:50 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('CoordType'))) - 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/PyStructSequence/correct/input.c', line=43), 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/PyStructSequence/correct/input.c', line=43), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyIntObject allocated at tests/cpychecker/refcounts/PyStructSequence/correct/input.c:59: - repr(): RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=59)) - str(): PyIntObject allocated at tests/cpychecker/refcounts/PyStructSequence/correct/input.c:59 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=59), region=RegionForGlobal(gcc.VarDecl('PyInt_Type'))) - PyIntObject allocated at tests/cpychecker/refcounts/PyStructSequence/correct/input.c:60: - repr(): RegionOnHeap('PyIntObject', gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=60)) - str(): PyIntObject allocated at tests/cpychecker/refcounts/PyStructSequence/correct/input.c:60 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=60), region=RegionForGlobal(gcc.VarDecl('PyInt_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyStructSequence/correct/input.c:44 - -Trace 1: - Transitions: - 'when PyStructSequence_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyStructSequence/correct/input.c', line=52), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyStructSequence/correct/input.c:52 - 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/PyStructSequence/correct/input.c', line=43), 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/PyStructSequence/correct/input.c', line=43), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyStructSequence/correct/input.c:50 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyStructSequence/correct/input.c:50:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3464, in impl_PyStructSequence_New + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,111 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PySys_SetObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=40), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:40 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PySys_SetObject/correct/input.c', line=28), 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/PySys_SetObject/correct/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:29 - -Trace 1: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PySys_SetObject() fails' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=40), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:40 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PySys_SetObject/correct/input.c', line=28), 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/PySys_SetObject/correct/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:37 - -Trace 2: - Transitions: - 'when PyString_FromString() succeeds' - 'taking False path' - 'when PySys_SetObject() fails' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=40), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:40 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/PySys_SetObject/correct/input.c', line=28), 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/PySys_SetObject/correct/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=31)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:37 - -Trace 3: - Transitions: - 'when PyString_FromString() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PySys_SetObject/correct/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:33 - 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/PySys_SetObject/correct/input.c', line=28), 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/PySys_SetObject/correct/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' ts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PyStructSequence/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyStructSequence/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyStructSequence/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyStructSequence/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyStructSequence/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyStructSequence/correct/input.c:50:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3464, in impl_PyStructSequence_New t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/PySys_GetObject/incorrect: OK tests/cpychecker/refcounts/PySys_SetObject/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PySys_SetObject/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PySys_SetObject/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PySys_SetObject/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PySys_SetObject/correct/input.c: In function 'test': tests/cpychecker/refcounts/PySys_SetObject/correct/input.c:31:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=lim--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,45 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyTuple_Size() returns ob_size' - '__dump((Py_ssize_t)0 from tests/cpychecker/refcounts/PyTuple_New/correct/input.c:32)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_New/correct/input.c', line=32), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_New/correct/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_New/correct/input.c', line=32)) from tests/cpychecker/refcounts/PyTuple_New/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_New/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_New/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/PyTuple_New/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_New/correct/input.c:30 - -Trace 1: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_New/correct/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_New/correct/input.c:34 - 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/PyTuple_New/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/PyTuple_New/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/PyTuple_New/correct/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyTuple_New/correct/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' its) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyTuple_GetItem/correct: OK tests/cpychecker/refcounts/PyTuple_GetItem/incorrect: OK tests/cpychecker/refcounts/PyTuple_New/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_New/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_New/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_New/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_New/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyTuple_New/correct/input.c:32:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecke--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,109 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27)) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:32: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=32)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:24 - -Trace 1: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:35 - 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:32 - -Trace 2: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:35 - 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=27)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:32 - -Trace 3: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:29 - 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SET_ITEM_macro': +tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,647 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=50)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:24 - -Trace 1: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 2: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 3: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 4: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 5: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 6: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 7: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 8: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:50 - -Trace 9: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 10: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 11: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 12: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:44 - -Trace 13: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:42 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - -Trace 14: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:42 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:39 - -Trace 15: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:35 - 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SET_ITEM_macro': +tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' r.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_Pack/incorrect-arg-count: OK tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c: In function 'handle_SET_ITEM_macro': tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct/input.c:27:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c: In function 'handle_SET_ITEM_macro': tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple/input.c:33:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,647 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=50)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:24 - -Trace 1: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 2: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 3: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 4: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 5: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 6: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 7: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 8: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:55 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50 - -Trace 9: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 10: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 11: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 12: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:48 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44 - -Trace 13: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:42 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - -Trace 14: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:42 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39 - -Trace 15: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:35 - 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), 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/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,23 +1,30 @@ In function 'handle_SET_ITEM_macro': -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: warning: ob_refcnt of PyLongObject is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: due to object being referenced by: PyTupleObject.ob_item[2] -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: PyLongObject allocated at: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33:nn: note: when PyTuple_New() succeeds at: tuple = PyTuple_New(3); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:34:nn: note: taking False path at: if (!tuple) { -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39:nn: note: reaching: items[0] = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:39:nn: note: when PyLong_FromLong() succeeds at: items[0] = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:40:nn: note: taking False path at: if (!items[0]) { -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44:nn: note: reaching: items[1] = PyLong_FromLong(2000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:44:nn: note: when PyLong_FromLong() succeeds at: items[1] = PyLong_FromLong(2000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:45:nn: note: taking False path at: if (!items[1]) { -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: reaching: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: when PyLong_FromLong() succeeds at: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:50:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:51:nn: note: taking False path at: if (!items[2]) { -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:64:nn: note: reaching: PyTuple_SET_ITEM(tuple, 0, items[0]); -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:66:nn: note: PyLongObject is now referenced by 1 non-stack value(s): PyTupleObject.ob_item[2] -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:71:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:76:nn: note: returning -tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:24:nn: note: graphical error report for function 'handle_SET_ITEM_macro' written out to 'tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c.handle_SET_ITEM_macro-refcount-errors.html' +tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c: In function 'handle_SET_ITEM_macro': tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple/input.c:33:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise Could--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,110 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyTuple_SetItem() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27)) from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_SetItem/correct/input.c', line=23), 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/PyTuple_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:32: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=32)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:24 - -Trace 1: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:35 - 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/PyTuple_SetItem/correct/input.c', line=23), 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/PyTuple_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:32 - -Trace 2: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:35 - 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/PyTuple_SetItem/correct/input.c', line=23), 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/PyTuple_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=27)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:32 - -Trace 3: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:29 - 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/PyTuple_SetItem/correct/input.c', line=23), 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/PyTuple_SetItem/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SetItem': +tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,650 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyTuple_SetItem() succeeds' - 'when PyTuple_SetItem() succeeds' - 'when PyTuple_SetItem() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=50)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:24 - -Trace 1: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 2: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 3: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 4: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 5: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 6: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 7: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 8: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:55 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:50 - -Trace 9: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:48 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - -Trace 10: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:48 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - -Trace 11: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:48 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - -Trace 12: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:48 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:44 - -Trace 13: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:42 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - -Trace 14: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:42 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:39 - -Trace 15: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:35 - 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/PyTuple_SetItem/correct_multiple/input.c', line=23), 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/PyTuple_SetItem/correct_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'handle_SetItem': +tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' NotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_SetItem/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_SetItem/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_SetItem/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c: In function 'handle_SetItem': tests/cpychecker/refcounts/PyTuple_SetItem/correct/input.c:27:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c: In function 'handle_SetItem': tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple/input.c:33:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,650 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyTuple_SetItem() succeeds' - 'when PyTuple_SetItem() succeeds' - 'when PyTuple_SetItem() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=50)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=50), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:24 - -Trace 1: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 2: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 3: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 4: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 5: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 6: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 7: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 8: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:55 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=44)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50 - -Trace 9: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:48 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - -Trace 10: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:48 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - -Trace 11: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:48 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - -Trace 12: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:48 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44 - -Trace 13: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:42 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyTuple_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - -Trace 14: - Transitions: - 'when PyTuple_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:42 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33: - repr(): RegionOnHeap('PyTupleObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=33)) - str(): PyTupleObject allocated at tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39 - -Trace 15: - Transitions: - 'when PyTuple_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:35 - 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), 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/PyTuple_SetItem/incorrect_multiple/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,26 +1,30 @@ In function 'handle_SetItem': -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:76:nn: warning: ob_refcnt of PyLongObject is 1 too high [enabled by default] -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:76:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:76:nn: note: due to object being referenced by: PyTupleObject.ob_item[2] -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:76:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50:nn: note: PyLongObject allocated at: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33:nn: note: when PyTuple_New() succeeds at: tuple = PyTuple_New(3); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:34:nn: note: taking False path at: if (!tuple) { -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39:nn: note: reaching: items[0] = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:39:nn: note: when PyLong_FromLong() succeeds at: items[0] = PyLong_FromLong(1000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:40:nn: note: taking False path at: if (!items[0]) { -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44:nn: note: reaching: items[1] = PyLong_FromLong(2000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:44:nn: note: when PyLong_FromLong() succeeds at: items[1] = PyLong_FromLong(2000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:45:nn: note: taking False path at: if (!items[1]) { -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50:nn: note: reaching: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50:nn: note: when PyLong_FromLong() succeeds at: items[2] = PyLong_FromLong(3000); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:50:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:51:nn: note: taking False path at: if (!items[2]) { -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:64:nn: note: reaching: PyTuple_SetItem(tuple, 0, items[0]); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:64:nn: note: when PyTuple_SetItem() succeeds at: PyTuple_SetItem(tuple, 0, items[0]); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:65:nn: note: when PyTuple_SetItem() succeeds at: PyTuple_SetItem(tuple, 1, items[1]); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:66:nn: note: when PyTuple_SetItem() succeeds at: PyTuple_SetItem(tuple, 2, items[2]); -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:66:nn: note: PyLongObject is now referenced by 1 non-stack value(s): PyTupleObject.ob_item[2] -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:71:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:76:nn: note: returning -tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:24:nn: note: graphical error report for function 'handle_SetItem' written out to 'tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c.handle_SetItem-refcount-errors.html' +tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New + 'PyTuple_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c: In function 'handle_SetItem': tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple/input.c:33:11: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3546, in impl_PyTuple_New 'PyTuple_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyTuple_Type' tests/cpychecker/refcounts/PyTuple_Siz--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,63 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'when PyTuple_Size() returns ob_size' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30)) from tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyTuple_Size/incorrect/input.c', line=27), 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/PyTuple_Size/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:28 - -Trace 1: - Transitions: - 'when PyDict_New() succeeds' - 'when PyTuple_Size() fails (not a tuple)' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30)) from tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - 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/PyTuple_Size/incorrect/input.c', line=27), 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/PyTuple_Size/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:37 - -Trace 2: - Transitions: - 'when PyDict_New() fails' - error: NullPtrArgument() - error: calling PyTuple_Size with NULL as argument 1 (dict) at tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:37 - 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/PyTuple_Size/incorrect/input.c', line=27), 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/PyTuple_Size/incorrect/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,5 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:37:nn: warning: calling PyTuple_Size with NULL as argument 1 (dict) at tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:37 [enabled by default] -tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:30:nn: note: when PyDict_New() fails at: dict = PyDict_New(); -tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:37:nn: note: PyTuple_Size() invokes Py_TYPE() on the pointer via the PyTuple_Check() macro, thus accessing (NULL)->ob_type -tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:28:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,29 +0,0 @@ -Trace 0: - Transitions: - 'when PyTuple_Size() returns ob_size' - 'returning' - Return value: - repr(): WithinRange(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c', line=29), minvalue=-0x8000000000000000, maxvalue=0x7fffffffffffffff) - str(): (Py_ssize_t)val [-0x8000000000000000 <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c:29 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyTuple_Size/ticket-24/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c:28 - -Trace 1: - Transitions: - 'when PyTuple_Size() fails (not a tuple)' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='Py_ssize_t', loc=gcc.Location(file='tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c', line=29), value=-1) - str(): (Py_ssize_t)-1 from tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c:29 - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/PyTuple_Size/ticket-24/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3688, in impl_PyTuple_Size + s_failure.cpython.set_exception('PyExc_SystemError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' e/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_Size/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_Size/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyTuple_Size/incorrect/input.c:30:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/PyTuple_Size/ticket-24: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyTuple_Size/ticket-24/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyTuple_Size/ticket-24/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c: In function 'test': tests/cpychecker/refcounts/PyTuple_Size/ticket-24/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_t--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,31 +0,0 @@ -Trace 0: - Transitions: - 'when PyUnicode_AsUTF8String() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c', line=29), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c', line=29)) from tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - region for gcc.ParmDecl('unicode') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('unicode')") - str(): region for gcc.ParmDecl('unicode') 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/PyUnicode_AsUTF8String/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('unicode')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c:28 - -Trace 1: - Transitions: - 'when PyUnicode_AsUTF8String() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c:29 - region for gcc.ParmDecl('unicode') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('unicode')") - str(): region for gcc.ParmDecl('unicode') 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/PyUnicode_AsUTF8String/basic/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('unicode')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3732, in impl_PyUnicode_AsUTF8String + return self.impl_PyUnicode_AsUTF8String(stmt, v_unicode) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3728, in impl_PyUnicode_AsUTF8String + r_newobj, t_success, t_failure = self.object_ctor_bytes(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 729, in object_ctor_bytes + typename, typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' ransitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3688, in impl_PyTuple_Size s_failure.cpython.set_exception('PyExc_SystemError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/PyType_IsSubtype/correct: OK tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c: In function 'test': tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3732, in impl_PyUnicodeUCS4_AsUTF8String return self.impl_PyUnicode_AsUTF8String(stmt, v_unicode) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3728, in impl_PyUnicode_AsUTF8String r_newobj, t_success, t_failure = self.object_ctor_bytes(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 729, in object_ctor_bytes typename, typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/PyWeakref_Ge--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,9 +0,0 @@ -Trace 0: - Transitions: - 'PyWeakref_GetObject() fails due to NULL argument' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c:29 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3762, in impl_PyWeakref_GetObject + s_failure.cpython.bad_internal_call(stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call + self.set_exception('PyExc_SystemError', loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,44 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:26 as non-NULL' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c', line=32), region=RegionOnHeap('borrowed reference returned by PyWeakref_GetObject()', gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('borrowed reference returned by PyWeakref_GetObject()', gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c', line=32)) from tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c', line=32), region=Region('PyTypeObject for borrowed reference returned by PyWeakref_GetObject()')) - 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/PyWeakref_GetObject/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/PyWeakref_GetObject/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:30 - -Trace 1: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:26 as NULL' - 'PyWeakref_GetObject() fails due to NULL argument' - 'taking False path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c', line=41), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:41 - 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/PyWeakref_GetObject/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/PyWeakref_GetObject/correct/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3762, in impl_PyWeakref_GetObject + s_failure.cpython.bad_internal_call(stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call + self.set_exception('PyExc_SystemError', loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tObject/NULL: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c: In function 'test': tests/cpychecker/refcounts/PyWeakref_GetObject/NULL/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3762, in impl_PyWeakref_GetObject s_failure.cpython.bad_internal_call(stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call self.set_exception('PyExc_SystemError', loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/PyWeakref_GetObject/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyWeakref_GetObject/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyWeakref_GetObject/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c: In function 'test': tests/cpychecker/refcounts/PyWeakref_GetObject/correct/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,44 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:26 as non-NULL' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c', line=32), region=RegionOnHeap('borrowed reference returned by PyWeakref_GetObject()', gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('borrowed reference returned by PyWeakref_GetObject()', gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c', line=32)) from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c', line=32), region=Region('PyTypeObject for borrowed reference returned by PyWeakref_GetObject()')) - 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/PyWeakref_GetObject/incorrect/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/PyWeakref_GetObject/incorrect/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:30 - -Trace 1: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:26 as NULL' - 'PyWeakref_GetObject() fails due to NULL argument' - 'taking False path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:37 - 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/PyWeakref_GetObject/incorrect/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/PyWeakref_GetObject/incorrect/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_SystemError')) from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,12 +1,34 @@ In function 'test': -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:38:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:38:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:38:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:38:nn: note: but final ob_refcnt is N + 0 -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32:nn: note: borrowed reference returned by PyWeakref_GetObject() allocated at: item = PyWeakref_GetObject(some_ref); -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:26 as non-NULL at: item = PyWeakref_GetObject(some_ref); -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32:nn: note: ob_refcnt is now refs: 0 + N where N >= 1 -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:33:nn: note: taking True path at: if (item) { -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:35:nn: note: reaching: return item; -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:38:nn: note: returning -tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:30:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3762, in impl_PyWeakref_GetObject + s_failure.cpython.bad_internal_call(stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call + self.set_exception('PyExc_SystemError', loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3762, in impl_PyWeakref_GetObject s_failure.cpython.bad_internal_call(stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call self.set_exception('PyExc_SystemError', loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect/input.c:32:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3762, in impl_PyWeakref_GetObject s_failure.cpython.bad_internal_call(stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 658, in bad_internal_call self.set_exception('PyExc_SystemError', loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,31 +0,0 @@ -Trace 0: - Transitions: - 'when Py_BuildValue() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c', line=30), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c', line=30)) from tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c', line=30), region=Region('PyTypeObject for new ref from call to Py_BuildValue')) - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/Py_BuildValue/Py_TYPE/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c:29 - -Trace 1: - Transitions: - 'when Py_BuildValue() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c', line=30), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c:30 - region for gcc.ParmDecl('a') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('a')") - str(): region for gcc.ParmDecl('a') 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/Py_BuildValue/Py_TYPE/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('a')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,36 @@ +In function 'test': +tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1337, in impl_Py_BuildValue + v_fmt, args, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1314, in _handle_Py_BuildValue + t_success, t_failure = self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when Py_BuildValue() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct/input.c', line=29), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct/input.c', line=29)) from tests/cpychecker/refcounts/Py_BuildValue/correct/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct/input.c', line=29), region=Region('PyTypeObject for new ref from call to Py_BuildValue')) - 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/Py_BuildValue/correct/input.c', line=27), 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/Py_BuildValue/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct/input.c:28 - -Trace 1: - Transitions: - 'when Py_BuildValue() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct/input.c:29 - 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/Py_BuildValue/correct/input.c', line=27), 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/Py_BuildValue/correct/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/Py_BuildValue/correct/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1337, in impl_Py_BuildValue + v_fmt, args, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1314, in _handle_Py_BuildValue + t_success, t_failure = self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' /gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_SystemError' tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c Stdout: Stderr: tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c: In function 'test': tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE/input.c:30:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1337, in impl_Py_BuildValue v_fmt, args, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1314, in _handle_Py_BuildValue t_success, t_failure = self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/Py_BuildValue/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/Py_BuildValue/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/Py_BuildValue/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/Py_BuildValue/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/Py_BuildValue/correct/input.c: In function 'test': tests/cpychecker/refcounts/Py_BuildValue/correct/input.c:29:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,110 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when Py_BuildValue() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34)) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34), region=Region('PyTypeObject for new ref from call to Py_BuildValue')) - 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/Py_BuildValue/correct-code-N/input.c', line=28), 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/Py_BuildValue/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=33)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:29 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when Py_BuildValue() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 - 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/Py_BuildValue/correct-code-N/input.c', line=28), 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/Py_BuildValue/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=33)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 - -Trace 2: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when Py_BuildValue() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 - 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/Py_BuildValue/correct-code-N/input.c', line=28), 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/Py_BuildValue/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=33)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 - -Trace 3: - Transitions: - 'when PyLong_FromLong() fails' - 'when Py_BuildValue() fails' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 - 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/Py_BuildValue/correct-code-N/input.c', line=28), 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/Py_BuildValue/correct-code-N/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1337, in impl_Py_BuildValue v_fmt, args, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1314, in _handle_Py_BuildValue t_success, t_failure = self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/Py_BuildValue/correct-code-N: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c Stdout: Stderr: tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c: In function 'test': tests/cpychecker/refcounts/Py_BuildValue/correct-code-N/input.c:33:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/abs--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,108 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when Py_BuildValue() succeeds' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37)) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), region=Region('PyTypeObject for new ref from call to Py_BuildValue')) - 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/Py_BuildValue/correct-code-O/input.c', line=28), 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/Py_BuildValue/correct-code-O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=34)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:29 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when Py_BuildValue() fails' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 - 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/Py_BuildValue/correct-code-O/input.c', line=28), 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/Py_BuildValue/correct-code-O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=34)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 - -Trace 2: - Transitions: - 'when PyLong_FromLong() succeeds' - 'when Py_BuildValue() fails' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 - 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/Py_BuildValue/correct-code-O/input.c', line=28), 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/Py_BuildValue/correct-code-O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=34)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 - -Trace 3: - Transitions: - 'when PyLong_FromLong() fails' - 'when Py_BuildValue() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c', line=37), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 - 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/Py_BuildValue/correct-code-O/input.c', line=28), 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/Py_BuildValue/correct-code-O/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:37 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,21 +0,0 @@ -Trace 0: - Transitions: - 'when Py_BuildValue() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c', line=29), region=RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to Py_BuildValue', gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c', line=29)) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c:29 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c', line=29), region=Region('PyTypeObject for new ref from call to Py_BuildValue')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c:28 - -Trace 1: - Transitions: - 'when Py_BuildValue() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c:29 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1337, in impl_Py_BuildValue + v_fmt, args, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1314, in _handle_Py_BuildValue + t_success, t_failure = self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' interp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/Py_BuildValue/correct-code-O: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c Stdout: Stderr: tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c: In function 'test': tests/cpychecker/refcounts/Py_BuildValue/correct-code-O/input.c:34:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/Py_BuildValue/correct-code-s: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c Stdout: Stderr: tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c: In function 'test': tests/cpychecker/refcounts/Py_BuildValue/correct-code-s/input.c:29:5: error: Unhandled Python exception raise--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,11 +0,0 @@ -Trace 0: - Transitions: - 'SWIG_Python_ErrorType()' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c', line=31), region=RegionForGlobal(gcc.VarDecl('PyExc_TypeError'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c:31 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,26 @@ +In function 'test': +tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3784, in impl_SWIG_Python_ErrorType + exc_decl = compat.get_exception_decl_by_name('PyExc_TypeError') + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' d calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1337, in impl_Py_BuildValue v_fmt, args, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1314, in _handle_Py_BuildValue t_success, t_failure = self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/Py_FatalError/correct: OK tests/cpychecker/refcounts/Py_Finalize/correct: OK tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c: In function 'test': tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct/input.c:31:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions re--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when _PyObject_New() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct FooObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/_PyObject_New/correct/input.c', line=40), region=RegionOnHeap('_PyObject_New', gcc.Location(file='tests/cpychecker/refcounts/_PyObject_New/correct/input.c', line=40))) - str(): (struct FooObject *)&RegionOnHeap('_PyObject_New', gcc.Location(file='tests/cpychecker/refcounts/_PyObject_New/correct/input.c', line=40)) from tests/cpychecker/refcounts/_PyObject_New/correct/input.c:40 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/_PyObject_New/correct/input.c', line=40), region=RegionForGlobal(gcc.VarDecl('FooType'))) - 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/_PyObject_New/correct/input.c', line=36), 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/_PyObject_New/correct/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/_PyObject_New/correct/input.c:37 - -Trace 1: - Transitions: - 'when _PyObject_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/_PyObject_New/correct/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/_PyObject_New/correct/input.c:42 - 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/_PyObject_New/correct/input.c', line=36), 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/_PyObject_New/correct/input.c', line=36), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/_PyObject_New/correct/input.c:40 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/_PyObject_New/correct/input.c:40:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2954, in impl__PyObject_New + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,7 +0,0 @@ -Trace 0: - Transitions: - 'PyErr_NoMemory() returns NULL, raising MemoryError' - 'taking True path' - 'returning' - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/__builtin_expect/input.c:56 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/__builtin_expect/input.c:56:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1688, in impl_PyErr_NoMemory + t_next.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' turn self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3784, in impl_SWIG_Python_ErrorType exc_decl = compat.get_exception_decl_by_name('PyExc_TypeError') File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/SWIG_Python_SetErrorMsg/correct: OK tests/cpychecker/refcounts/_PyObject_New/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/_PyObject_New/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/_PyObject_New/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/_PyObject_New/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/_PyObject_New/correct/input.c: In function 'test': tests/cpychecker/refcounts/_PyObject_New/correct/input.c:40:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2954, in impl__PyObject_New t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/__builtin_expect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/__builtin_expect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/__builtin_expect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/__builtin_expect/input.c Stdout: Stderr: tests/cpychecker/refcounts/__builtin_expect/input.c: In function 'test': tests/cpychecker/refcounts/__builtin_expect/input.c:56:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcoun--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when foo() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c', line=41), region=RegionOnHeap('borrowed reference returned by foo()', gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c', line=41))) - str(): (struct PyObject *)&RegionOnHeap('borrowed reference returned by foo()', gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c', line=41)) from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c:41 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c', line=41), region=Region('PyTypeObject for borrowed reference returned by foo()')) - 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/attributes/returns-borrowed-ref/correct-usage/input.c', line=39), 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/attributes/returns-borrowed-ref/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c:40 - -Trace 1: - Transitions: - 'when foo() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c', line=41), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c:41 - 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/attributes/returns-borrowed-ref/correct-usage/input.c', line=39), 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/attributes/returns-borrowed-ref/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c:41 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c:41:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2306, in _get_transitions_for_GimpleCall + fnmeta), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 873, in make_transitions_for_borrowed_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' ts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1688, in impl_PyErr_NoMemory t_next.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-marking: OK tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c: In function 'test': tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/input.c:41:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2306, in _get_transitions_for_GimpleCall fnmeta), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 873, in make_transitions_for_borrowed_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_excepti--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=45), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=45))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=45)) from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=39), 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/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:40 - -Trace 1: - Transitions: - 'when PyLong_FromLong() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45 - 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/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=39), 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/attributes/returns-borrowed-ref/incorrect-marking/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,9 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: warning: ob_refcnt of return value is 1 too high [enabled by default] -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: note: PyLongObject allocated at: return PyLong_FromLong(42); -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: note: when PyLong_FromLong() succeeds at: return PyLong_FromLong(42); -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: note: returning at: return PyLong_FromLong(42); -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:40:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when foo() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=45), region=RegionOnHeap('borrowed reference returned by foo()', gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=45))) - str(): (struct PyObject *)&RegionOnHeap('borrowed reference returned by foo()', gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=45)) from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=45), region=Region('PyTypeObject for borrowed reference returned by foo()')) - 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/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=39), 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/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:40 - -Trace 1: - Transitions: - 'when foo() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45 - 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/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=39), 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/attributes/returns-borrowed-ref/incorrect-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,10 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:46:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:46:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:46:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:46:nn: note: but final ob_refcnt is N + 0 -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45:nn: note: borrowed reference returned by foo() allocated at: PyObject *obj = foo(); -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45:nn: note: when foo() succeeds at: PyObject *obj = foo(); -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45:nn: note: ob_refcnt is now refs: 0 + N where N >= 1 -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:46:nn: note: returning at: return obj; -tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:40:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2306, in _get_transitions_for_GimpleCall + fnmeta), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 873, in make_transitions_for_borrowed_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' on t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c: In function 'test': tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking/input.c:45:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c: In function 'test': tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage/input.c:45:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): F--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when considering range: -0x80000000 <= value <= -1' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c', line=50), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c:50 - 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/attributes/sets-exception-on-nonzero-return/correct-usage/input.c', line=39), 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/attributes/sets-exception-on-nonzero-return/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c:43 - -Trace 1: - Transitions: - 'when considering range: 0 <= value <= 0x7fffffff' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c', line=52), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c:52 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/attributes/sets-exception-on-nonzero-return/correct-usage/input.c', line=39), 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/attributes/sets-exception-on-nonzero-return/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c:40 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test': +tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c:43:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2328, in _get_transitions_for_GimpleCall + stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2419, in apply_fncall_side_effects + handle_negative_return) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2921, in process_splittable_transitions + callback) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2913, in process_splittable_transitions + callback(t_iter) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2416, in handle_negative_return + stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' ile "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2306, in _get_transitions_for_GimpleCall fnmeta), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 873, in make_transitions_for_borrowed_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-marking: OK tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c: In function 'test': tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage/input.c:43:7: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,18 +0,0 @@ -Trace 0: - Transitions: - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c:42 - 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/attributes/sets-exception/correct-usage/input.c', line=39), 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/attributes/sets-exception/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c:41 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,28 @@ +In function 'test': +tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c:41:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2328, in _get_transitions_for_GimpleCall + stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2388, in apply_fncall_side_effects + stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,48 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c', line=59), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:59 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/attributes/steals-reference-to-arg/correct-usage/input.c', line=39), 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/attributes/steals-reference-to-arg/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:43: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c', line=43)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:43 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c', line=43), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:40 - -Trace 1: - Transitions: - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:45 - 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/attributes/steals-reference-to-arg/correct-usage/input.c', line=39), 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/attributes/steals-reference-to-arg/correct-usage/input.c', line=39), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:43 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:43:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' absinterp.py", line 2328, in _get_transitions_for_GimpleCall stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2419, in apply_fncall_side_effects handle_negative_return) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2921, in process_splittable_transitions callback) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2913, in process_splittable_transitions callback(t_iter) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2416, in handle_negative_return stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/incorrect-marking: OK tests/cpychecker/refcounts/attributes/sets-exception/correct-marking: OK tests/cpychecker/refcounts/attributes/sets-exception/correct-usage: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c: In function 'test': tests/cpychecker/refcounts/attributes/sets-exception/correct-usage/input.c:41:8: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2328, in _get_transitions_for_GimpleCall stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2388, in apply_fncall_side_effects stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/attributes/sets-exception/incorrect-marking: OK tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-marking: OK tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/output.o ---- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,43 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=44), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=44))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=44)) from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=44), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=40), 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/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=40), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:41 - -Trace 1: - Transitions: - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=46), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:46 - 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/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=40), 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/attributes/steals-reference-to-arg/incorrect-usage/input.c', line=40), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,13 +1,30 @@ In function 'test': -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:64:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:64:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:64:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:64:nn: note: but final ob_refcnt is N + 0 -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44:nn: note: PyLongObject allocated at: obj = PyLong_FromLong(42); -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44:nn: note: when PyLong_FromLong() succeeds at: obj = PyLong_FromLong(42); -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:45:nn: note: taking False path at: if (!obj) { -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:55:nn: note: reaching: foo(obj); -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:55:nn: note: ob_refcnt is now refs: 0 + N where N >= 1 -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:64:nn: note: returning -tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:41:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c: In function 'test': tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage/input.c:43:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-marking: OK tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c Stdout: Stderr: tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c: In function 'test': tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage/input.c:44:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces dept--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,983 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:160 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:172 - -Trace 2: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:168 - -Trace 3: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:172 - -Trace 4: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 32 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/combinatorial-explosion/input.c:31 - -Trace 5: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:172 - -Trace 6: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:168 - -Trace 7: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:172 - -Trace 8: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:164 - -Trace 9: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:172 - -Trace 10: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:168 - -Trace 11: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() succeeds' - 'taking True path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32)) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion/input.c', line=30), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion/input.c:172 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,2 +1,30 @@ In function 'test_adding_module_objects': -tests/cpychecker/refcounts/combinatorial-explosion/input.c:31:nn: note: this function is too complicated for the reference-count checker to fully analyze: not all paths were analyzed +tests/cpychecker/refcounts/combinatorial-explosion/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,1119 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 2 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 2: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149 - -Trace 3: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 4 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 4: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 32 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:33 - -Trace 5: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 2 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 6: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 2 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149 - -Trace 7: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 8: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 2 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146 - -Trace 9: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 10: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149 - -Trace 11: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 4 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 12: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 2 + N where N >= 31 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143 - -Trace 13: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 14: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149 - -Trace 15: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 4 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 16: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 3 + N where N >= 30 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146 - -Trace 17: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 4 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 - -Trace 18: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 4 + N where N >= 29 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149 - -Trace 19: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() succeeds' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'when PyModule_AddObject() fails' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34)) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34 - r->ob_refcnt: refs: 5 + N where N >= 28 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - region for gcc.ParmDecl('m') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('m')") - str(): region for gcc.ParmDecl('m') 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/combinatorial-explosion-with-error/input.c', line=32), region=Region("region-for-type-of-arg-gcc.ParmDecl('m')")) - PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c', line=45), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,467 +1,30 @@ In function 'test_adding_module_objects': -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:33:nn: note: this function is too complicated for the reference-count checker to fully analyze: not all paths were analyzed -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: warning: ob_refcnt of return value is 1 too high [enabled by default] -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: PyLongObject allocated at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: when PyLong_FromLong() succeeds at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:36:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: reaching: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: when PyDict_New() succeeds at: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:58:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_001", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: ob_refcnt is now refs: 1 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:61:nn: note: ob_refcnt is now refs: 2 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_002", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: ob_refcnt is now refs: 1 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:64:nn: note: ob_refcnt is now refs: 2 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_003", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: ob_refcnt is now refs: 1 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:67:nn: note: ob_refcnt is now refs: 2 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_004", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: ob_refcnt is now refs: 1 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:70:nn: note: ob_refcnt is now refs: 2 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_005", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: ob_refcnt is now refs: 1 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:73:nn: note: ob_refcnt is now refs: 2 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_006", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: ob_refcnt is now refs: 1 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:76:nn: note: ob_refcnt is now refs: 2 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_007", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: ob_refcnt is now refs: 1 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:79:nn: note: ob_refcnt is now refs: 2 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_008", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: ob_refcnt is now refs: 1 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:82:nn: note: ob_refcnt is now refs: 2 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_009", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: ob_refcnt is now refs: 1 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:85:nn: note: ob_refcnt is now refs: 2 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_010", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: ob_refcnt is now refs: 1 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:88:nn: note: ob_refcnt is now refs: 2 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_011", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: ob_refcnt is now refs: 1 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:91:nn: note: ob_refcnt is now refs: 2 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_012", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: ob_refcnt is now refs: 1 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:94:nn: note: ob_refcnt is now refs: 2 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_013", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: ob_refcnt is now refs: 1 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:97:nn: note: ob_refcnt is now refs: 2 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_014", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: ob_refcnt is now refs: 1 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:100:nn: note: ob_refcnt is now refs: 2 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_015", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: ob_refcnt is now refs: 1 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:103:nn: note: ob_refcnt is now refs: 2 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_016", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: ob_refcnt is now refs: 1 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:106:nn: note: ob_refcnt is now refs: 2 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_017", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: ob_refcnt is now refs: 1 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:109:nn: note: ob_refcnt is now refs: 2 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_018", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: ob_refcnt is now refs: 1 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:112:nn: note: ob_refcnt is now refs: 2 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_019", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: ob_refcnt is now refs: 1 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:115:nn: note: ob_refcnt is now refs: 2 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_020", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: ob_refcnt is now refs: 1 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:118:nn: note: ob_refcnt is now refs: 2 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_021", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: ob_refcnt is now refs: 1 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:121:nn: note: ob_refcnt is now refs: 2 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_022", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: ob_refcnt is now refs: 1 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:124:nn: note: ob_refcnt is now refs: 2 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_023", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: ob_refcnt is now refs: 1 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:127:nn: note: ob_refcnt is now refs: 2 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_024", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: ob_refcnt is now refs: 1 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:130:nn: note: ob_refcnt is now refs: 2 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_025", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: ob_refcnt is now refs: 1 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:133:nn: note: ob_refcnt is now refs: 2 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_026", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: ob_refcnt is now refs: 1 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:136:nn: note: ob_refcnt is now refs: 2 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_027", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: ob_refcnt is now refs: 1 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:139:nn: note: ob_refcnt is now refs: 2 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_028", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:142:nn: note: ob_refcnt is now refs: 3 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_029", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: ob_refcnt is now refs: 2 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:145:nn: note: ob_refcnt is now refs: 3 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_030", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: ob_refcnt is now refs: 2 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:148:nn: note: ob_refcnt is now refs: 3 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_031", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: ob_refcnt is now refs: 2 + N where N >= 30 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:151:nn: note: ob_refcnt is now refs: 3 + N where N >= 30 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_032", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152:nn: note: ob_refcnt is now refs: 2 + N where N >= 31 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: returning -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: found 4 similar trace(s) to this -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: warning: ob_refcnt of '*leaky' is 1 too high [enabled by default] -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: PyDictObject allocated at: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: when PyLong_FromLong() succeeds at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:36:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: reaching: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: when PyDict_New() succeeds at: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_001", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_002", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_003", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_004", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_005", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_006", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_007", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_008", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_009", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_010", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_011", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_012", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_013", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_014", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_015", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_016", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_017", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_018", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_019", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_020", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_021", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_022", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_023", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_024", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_025", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_026", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_027", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_028", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_029", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_030", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_031", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_032", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: returning -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: found 19 similar trace(s) to this -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: warning: ob_refcnt of return value is 2 too high [enabled by default] -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: but final ob_refcnt is N + 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: PyLongObject allocated at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: when PyLong_FromLong() succeeds at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:36:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: reaching: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: when PyDict_New() succeeds at: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:58:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_001", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: ob_refcnt is now refs: 1 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:61:nn: note: ob_refcnt is now refs: 2 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_002", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: ob_refcnt is now refs: 1 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:64:nn: note: ob_refcnt is now refs: 2 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_003", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: ob_refcnt is now refs: 1 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:67:nn: note: ob_refcnt is now refs: 2 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_004", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: ob_refcnt is now refs: 1 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:70:nn: note: ob_refcnt is now refs: 2 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_005", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: ob_refcnt is now refs: 1 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:73:nn: note: ob_refcnt is now refs: 2 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_006", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: ob_refcnt is now refs: 1 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:76:nn: note: ob_refcnt is now refs: 2 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_007", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: ob_refcnt is now refs: 1 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:79:nn: note: ob_refcnt is now refs: 2 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_008", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: ob_refcnt is now refs: 1 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:82:nn: note: ob_refcnt is now refs: 2 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_009", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: ob_refcnt is now refs: 1 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:85:nn: note: ob_refcnt is now refs: 2 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_010", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: ob_refcnt is now refs: 1 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:88:nn: note: ob_refcnt is now refs: 2 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_011", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: ob_refcnt is now refs: 1 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:91:nn: note: ob_refcnt is now refs: 2 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_012", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: ob_refcnt is now refs: 1 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:94:nn: note: ob_refcnt is now refs: 2 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_013", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: ob_refcnt is now refs: 1 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:97:nn: note: ob_refcnt is now refs: 2 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_014", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: ob_refcnt is now refs: 1 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:100:nn: note: ob_refcnt is now refs: 2 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_015", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: ob_refcnt is now refs: 1 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:103:nn: note: ob_refcnt is now refs: 2 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_016", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: ob_refcnt is now refs: 1 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:106:nn: note: ob_refcnt is now refs: 2 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_017", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: ob_refcnt is now refs: 1 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:109:nn: note: ob_refcnt is now refs: 2 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_018", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: ob_refcnt is now refs: 1 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:112:nn: note: ob_refcnt is now refs: 2 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_019", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: ob_refcnt is now refs: 1 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:115:nn: note: ob_refcnt is now refs: 2 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_020", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: ob_refcnt is now refs: 1 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:118:nn: note: ob_refcnt is now refs: 2 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_021", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: ob_refcnt is now refs: 1 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:121:nn: note: ob_refcnt is now refs: 2 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_022", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: ob_refcnt is now refs: 1 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:124:nn: note: ob_refcnt is now refs: 2 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_023", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: ob_refcnt is now refs: 1 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:127:nn: note: ob_refcnt is now refs: 2 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_024", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: ob_refcnt is now refs: 1 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:130:nn: note: ob_refcnt is now refs: 2 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_025", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: ob_refcnt is now refs: 1 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:133:nn: note: ob_refcnt is now refs: 2 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_026", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: ob_refcnt is now refs: 1 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:136:nn: note: ob_refcnt is now refs: 2 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_027", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: ob_refcnt is now refs: 1 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:139:nn: note: ob_refcnt is now refs: 2 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_028", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:142:nn: note: ob_refcnt is now refs: 3 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_029", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: ob_refcnt is now refs: 2 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:145:nn: note: ob_refcnt is now refs: 3 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_030", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: ob_refcnt is now refs: 2 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:148:nn: note: ob_refcnt is now refs: 3 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_031", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: ob_refcnt is now refs: 2 + N where N >= 30 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:151:nn: note: ob_refcnt is now refs: 3 + N where N >= 30 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_032", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: returning -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: found 7 similar trace(s) to this -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: warning: ob_refcnt of return value is 3 too high [enabled by default] -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: but final ob_refcnt is N + 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: PyLongObject allocated at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: when PyLong_FromLong() succeeds at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:36:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: reaching: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: when PyDict_New() succeeds at: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:58:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_001", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: ob_refcnt is now refs: 1 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:61:nn: note: ob_refcnt is now refs: 2 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_002", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: ob_refcnt is now refs: 1 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:64:nn: note: ob_refcnt is now refs: 2 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_003", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: ob_refcnt is now refs: 1 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:67:nn: note: ob_refcnt is now refs: 2 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_004", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: ob_refcnt is now refs: 1 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:70:nn: note: ob_refcnt is now refs: 2 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_005", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: ob_refcnt is now refs: 1 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:73:nn: note: ob_refcnt is now refs: 2 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_006", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: ob_refcnt is now refs: 1 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:76:nn: note: ob_refcnt is now refs: 2 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_007", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: ob_refcnt is now refs: 1 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:79:nn: note: ob_refcnt is now refs: 2 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_008", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: ob_refcnt is now refs: 1 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:82:nn: note: ob_refcnt is now refs: 2 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_009", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: ob_refcnt is now refs: 1 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:85:nn: note: ob_refcnt is now refs: 2 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_010", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: ob_refcnt is now refs: 1 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:88:nn: note: ob_refcnt is now refs: 2 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_011", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: ob_refcnt is now refs: 1 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:91:nn: note: ob_refcnt is now refs: 2 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_012", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: ob_refcnt is now refs: 1 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:94:nn: note: ob_refcnt is now refs: 2 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_013", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: ob_refcnt is now refs: 1 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:97:nn: note: ob_refcnt is now refs: 2 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_014", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: ob_refcnt is now refs: 1 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:100:nn: note: ob_refcnt is now refs: 2 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_015", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: ob_refcnt is now refs: 1 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:103:nn: note: ob_refcnt is now refs: 2 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_016", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: ob_refcnt is now refs: 1 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:106:nn: note: ob_refcnt is now refs: 2 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_017", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: ob_refcnt is now refs: 1 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:109:nn: note: ob_refcnt is now refs: 2 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_018", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: ob_refcnt is now refs: 1 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:112:nn: note: ob_refcnt is now refs: 2 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_019", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: ob_refcnt is now refs: 1 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:115:nn: note: ob_refcnt is now refs: 2 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_020", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: ob_refcnt is now refs: 1 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:118:nn: note: ob_refcnt is now refs: 2 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_021", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: ob_refcnt is now refs: 1 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:121:nn: note: ob_refcnt is now refs: 2 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_022", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: ob_refcnt is now refs: 1 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:124:nn: note: ob_refcnt is now refs: 2 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_023", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: ob_refcnt is now refs: 1 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:127:nn: note: ob_refcnt is now refs: 2 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_024", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: ob_refcnt is now refs: 1 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:130:nn: note: ob_refcnt is now refs: 2 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_025", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: ob_refcnt is now refs: 1 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:133:nn: note: ob_refcnt is now refs: 2 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_026", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: ob_refcnt is now refs: 1 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:136:nn: note: ob_refcnt is now refs: 2 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_027", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: ob_refcnt is now refs: 1 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:139:nn: note: ob_refcnt is now refs: 2 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_028", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:142:nn: note: ob_refcnt is now refs: 3 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_029", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: ob_refcnt is now refs: 2 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:145:nn: note: ob_refcnt is now refs: 3 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_030", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: ob_refcnt is now refs: 2 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:148:nn: note: ob_refcnt is now refs: 3 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_031", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:151:nn: note: ob_refcnt is now refs: 4 + N where N >= 29 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_032", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: returning -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: found 4 similar trace(s) to this -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: warning: ob_refcnt of return value is 4 too high [enabled by default] -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: but final ob_refcnt is N + 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: PyLongObject allocated at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: when PyLong_FromLong() succeeds at: PyObject *item = PyLong_FromLong(4096); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:36:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: reaching: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:45:nn: note: when PyDict_New() succeeds at: leaky = PyDict_New(); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:58:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_001", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:59:nn: note: ob_refcnt is now refs: 1 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:61:nn: note: ob_refcnt is now refs: 2 + N where N >= 1 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_002", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:62:nn: note: ob_refcnt is now refs: 1 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:64:nn: note: ob_refcnt is now refs: 2 + N where N >= 2 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_003", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:65:nn: note: ob_refcnt is now refs: 1 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:67:nn: note: ob_refcnt is now refs: 2 + N where N >= 3 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_004", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:68:nn: note: ob_refcnt is now refs: 1 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:70:nn: note: ob_refcnt is now refs: 2 + N where N >= 4 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_005", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:71:nn: note: ob_refcnt is now refs: 1 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:73:nn: note: ob_refcnt is now refs: 2 + N where N >= 5 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_006", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:74:nn: note: ob_refcnt is now refs: 1 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:76:nn: note: ob_refcnt is now refs: 2 + N where N >= 6 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_007", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:77:nn: note: ob_refcnt is now refs: 1 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:79:nn: note: ob_refcnt is now refs: 2 + N where N >= 7 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_008", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:80:nn: note: ob_refcnt is now refs: 1 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:82:nn: note: ob_refcnt is now refs: 2 + N where N >= 8 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_009", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:83:nn: note: ob_refcnt is now refs: 1 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:85:nn: note: ob_refcnt is now refs: 2 + N where N >= 9 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_010", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:86:nn: note: ob_refcnt is now refs: 1 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:88:nn: note: ob_refcnt is now refs: 2 + N where N >= 10 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_011", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:89:nn: note: ob_refcnt is now refs: 1 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:91:nn: note: ob_refcnt is now refs: 2 + N where N >= 11 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_012", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:92:nn: note: ob_refcnt is now refs: 1 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:94:nn: note: ob_refcnt is now refs: 2 + N where N >= 12 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_013", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:95:nn: note: ob_refcnt is now refs: 1 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:97:nn: note: ob_refcnt is now refs: 2 + N where N >= 13 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_014", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:98:nn: note: ob_refcnt is now refs: 1 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:100:nn: note: ob_refcnt is now refs: 2 + N where N >= 14 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_015", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:101:nn: note: ob_refcnt is now refs: 1 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:103:nn: note: ob_refcnt is now refs: 2 + N where N >= 15 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_016", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:104:nn: note: ob_refcnt is now refs: 1 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:106:nn: note: ob_refcnt is now refs: 2 + N where N >= 16 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_017", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:107:nn: note: ob_refcnt is now refs: 1 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:109:nn: note: ob_refcnt is now refs: 2 + N where N >= 17 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_018", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:110:nn: note: ob_refcnt is now refs: 1 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:112:nn: note: ob_refcnt is now refs: 2 + N where N >= 18 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_019", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:113:nn: note: ob_refcnt is now refs: 1 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:115:nn: note: ob_refcnt is now refs: 2 + N where N >= 19 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_020", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:116:nn: note: ob_refcnt is now refs: 1 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:118:nn: note: ob_refcnt is now refs: 2 + N where N >= 20 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_021", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:119:nn: note: ob_refcnt is now refs: 1 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:121:nn: note: ob_refcnt is now refs: 2 + N where N >= 21 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_022", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:122:nn: note: ob_refcnt is now refs: 1 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:124:nn: note: ob_refcnt is now refs: 2 + N where N >= 22 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_023", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:125:nn: note: ob_refcnt is now refs: 1 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:127:nn: note: ob_refcnt is now refs: 2 + N where N >= 23 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_024", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:128:nn: note: ob_refcnt is now refs: 1 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:130:nn: note: ob_refcnt is now refs: 2 + N where N >= 24 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_025", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:131:nn: note: ob_refcnt is now refs: 1 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:133:nn: note: ob_refcnt is now refs: 2 + N where N >= 25 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_026", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:134:nn: note: ob_refcnt is now refs: 1 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:136:nn: note: ob_refcnt is now refs: 2 + N where N >= 26 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_027", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:137:nn: note: ob_refcnt is now refs: 1 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:139:nn: note: ob_refcnt is now refs: 2 + N where N >= 27 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140:nn: note: when PyModule_AddObject() succeeds at: PyModule_AddObject(m, "item_028", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:140:nn: note: ob_refcnt is now refs: 1 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:142:nn: note: ob_refcnt is now refs: 2 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:143:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_029", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:145:nn: note: ob_refcnt is now refs: 3 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:146:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_030", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:148:nn: note: ob_refcnt is now refs: 4 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:149:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_031", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:151:nn: note: ob_refcnt is now refs: 5 + N where N >= 28 -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:152:nn: note: when PyModule_AddObject() fails at: PyModule_AddObject(m, "item_032", item); -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:155:nn: note: returning -tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:33:nn: note: graphical error report for function 'test_adding_module_objects' written out to 'tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c.test_adding_module_objects-refcount-errors.html' +tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' h + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/combinatorial-explosion: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/combinatorial-explosion/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/combinatorial-explosion/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/combinatorial-explosion/input.c Stdout: Stderr: tests/cpychecker/refcounts/combinatorial-explosion/input.c: In function 'test_adding_module_objects': tests/cpychecker/refcounts/combinatorial-explosion/input.c:32:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/combinatorial-explosion-with-error: FAIL returncode: 1 compiling: gcc ---- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,44 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/correct_decref/input.c', line=30), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/correct_decref/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/correct_decref/input.c', line=30)) from tests/cpychecker/refcounts/correct_decref/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/correct_decref/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/correct_decref/input.c', line=27), 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/correct_decref/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/correct_decref/input.c:28 - -Trace 1: - Transitions: - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/correct_decref/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/correct_decref/input.c:33 - 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/correct_decref/input.c', line=27), 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/correct_decref/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/correct_decref/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'correct_decref': +tests/cpychecker/refcounts/correct_decref/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' c -o tests/cpychecker/refcounts/combinatorial-explosion-with-error/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/combinatorial-explosion-with-error/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c Stdout: Stderr: tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c: In function 'test_adding_module_objects': tests/cpychecker/refcounts/combinatorial-explosion-with-error/input.c:34:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/correct_decref: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/correct_decref/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/correct_decref/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/correct_decref/input.c Stdout: Stderr: tests/cpychecker/refcounts/correct_decref/input.c: In function 'correct_decref': tests/cpychecker/refcounts/correct_decref/input.c:30:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_tr--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,5 +0,0 @@ -Trace 0: - returned: PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/correct_object_ctor/input.c', line=30), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/correct_object_ctor/input.c', line=30))) - r->ob_refcnt: RefcountValue(1, 0) -Trace 1: - returned: ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/correct_object_ctor/input.c', line=30), value=0) --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,26 @@ +In function 'correct_object_ctor': +tests/cpychecker/refcounts/correct_object_ctor/input.c:30:nn: error: Unhandled Python exception raised within callback +Traceback (most recent call last): + File "tests/cpychecker/refcounts/correct_object_ctor/script.py", line 27, in verify_traces + traces = get_traces(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3806, in get_traces + limits=Limits(maxtrans=1024))) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,45 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/fold_conditional/input.c', line=26), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/fold_conditional/input.c', line=26))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/fold_conditional/input.c', line=26)) from tests/cpychecker/refcounts/fold_conditional/input.c:26 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/fold_conditional/input.c', line=26), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/fold_conditional/input.c', line=23), 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/fold_conditional/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/fold_conditional/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/fold_conditional/input.c', line=28), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/fold_conditional/input.c:28 - 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/fold_conditional/input.c', line=23), 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/fold_conditional/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/fold_conditional/input.c:26 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'fold_conditional': +tests/cpychecker/refcounts/fold_conditional/input.c:26:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' ansitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/correct_object_ctor: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/correct_object_ctor/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/correct_object_ctor/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/correct_object_ctor/input.c Stdout: Stderr: tests/cpychecker/refcounts/correct_object_ctor/input.c: In function 'correct_object_ctor': tests/cpychecker/refcounts/correct_object_ctor/input.c:30:10: error: Unhandled Python exception raised within callback Traceback (most recent call last): File "tests/cpychecker/refcounts/correct_object_ctor/script.py", line 27, in verify_traces traces = get_traces(fun) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3806, in get_traces limits=Limits(maxtrans=1024))) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/correct_py_none: OK tests/cpychecker/refcounts/cplusplus/destructor: OK tests/cpychecker/refcounts/cplusplus/empty-function: OK tests/cpychecker/refcounts/cplusplus/method: OK tests/cpychecker/refcounts/cplusplus/reference: OK tests/cpychecker/refcounts/cplusplus/simple: OK tests/cpychecker/refcounts/cplusplus/this: OK tests/cpychecker/refcounts/fold_conditional: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/fold_conditional/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/fold_conditional/script.py -fsigned--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,31 +0,0 @@ -Trace 0: - Transitions: - 'when PyObject_Repr() succeeds' - 'taking True path' - 'PyString_AsString() returns ob_sval' - 'not returning from exit' - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/function-that-exits/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - PyStringObject allocated at tests/cpychecker/refcounts/function-that-exits/input.c:33: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/function-that-exits/input.c', line=33)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/function-that-exits/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/function-that-exits/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/function-that-exits/input.c:29 - -Trace 1: - Transitions: - 'when PyObject_Repr() fails' - 'taking False path' - 'not returning from exit' - region for gcc.ParmDecl('obj') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('obj')") - str(): region for gcc.ParmDecl('obj') 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/function-that-exits/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('obj')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/function-that-exits/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/function-that-exits/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2964, in impl_PyObject_Repr + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' -char -I/usr/include/python2.7 tests/cpychecker/refcounts/fold_conditional/input.c Stdout: Stderr: tests/cpychecker/refcounts/fold_conditional/input.c: In function 'fold_conditional': tests/cpychecker/refcounts/fold_conditional/input.c:26:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/function-that-exits: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/function-that-exits/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/function-that-exits/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/function-that-exits/input.c Stdout: Stderr: tests/cpychecker/refcounts/function-that-exits/input.c: In function 'test': tests/cpychecker/refcounts/function-that-exits/input.c:33:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpych--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,31 +0,0 @@ -Trace 0: - Transitions: - 'when make_wrapper() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/getter/input.c', line=42), region=RegionOnHeap('new ref from (unknown) make_wrapper', gcc.Location(file='tests/cpychecker/refcounts/getter/input.c', line=42))) - str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) make_wrapper', gcc.Location(file='tests/cpychecker/refcounts/getter/input.c', line=42)) from tests/cpychecker/refcounts/getter/input.c:42 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/getter/input.c', line=42), region=Region('PyTypeObject for new ref from (unknown) make_wrapper')) - 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/getter/input.c', line=35), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/getter/input.c:36 - -Trace 1: - Transitions: - 'when make_wrapper() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/getter/input.c', line=42), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/getter/input.c:42 - 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/getter/input.c', line=35), region=Region("region-for-type-of-arg-gcc.ParmDecl('self')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/getter/input.c:42 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,32 @@ +In function 'simple_getter': +tests/cpychecker/refcounts/getter/input.c:42:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall + 'new ref from (unknown) %s' % fnname), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,114 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_FromString() succeeds' - 'when PyObject_GetItem() succeeds' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), region=RegionOnHeap('new ref from call to PyObject_GetItem', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_GetItem', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38)) from tests/cpychecker/refcounts/handle_null_error/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), region=Region('PyTypeObject for new ref from call to PyObject_GetItem')) - region for gcc.ParmDecl('mapping') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('mapping')") - str(): region for gcc.ParmDecl('mapping') 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/handle_null_error/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('mapping')")) - PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=33)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/handle_null_error/input.c:28 - -Trace 1: - Transitions: - 'when PyString_FromString() succeeds' - 'when PyObject_GetItem() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), region=RegionOnHeap('new ref from call to PyObject_GetItem', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('new ref from call to PyObject_GetItem', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38)) from tests/cpychecker/refcounts/handle_null_error/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), region=Region('PyTypeObject for new ref from call to PyObject_GetItem')) - region for gcc.ParmDecl('mapping') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('mapping')") - str(): region for gcc.ParmDecl('mapping') 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/handle_null_error/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('mapping')")) - PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=33)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/handle_null_error/input.c:28 - -Trace 2: - Transitions: - 'when PyString_FromString() succeeds' - 'when PyObject_GetItem() fails' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/handle_null_error/input.c:38 - region for gcc.ParmDecl('mapping') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('mapping')") - str(): region for gcc.ParmDecl('mapping') 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/handle_null_error/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('mapping')")) - PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=33)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/handle_null_error/input.c:38 - -Trace 3: - Transitions: - 'when PyString_FromString() succeeds' - 'when PyObject_GetItem() fails' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/handle_null_error/input.c:38 - region for gcc.ParmDecl('mapping') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('mapping')") - str(): region for gcc.ParmDecl('mapping') 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/handle_null_error/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('mapping')")) - PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33: - repr(): RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=33)) - str(): PyStringObject allocated at tests/cpychecker/refcounts/handle_null_error/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/handle_null_error/input.c:38 - -Trace 4: - Transitions: - 'when PyString_FromString() fails' - 'when PyObject_GetItem fails due to NULL as argument 2 at tests/cpychecker/refcounts/handle_null_error/input.c:38' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/handle_null_error/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/handle_null_error/input.c:38 - region for gcc.ParmDecl('mapping') on stack: - repr(): RegionOnStack("region for gcc.ParmDecl('mapping')") - str(): region for gcc.ParmDecl('mapping') 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/handle_null_error/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('mapping')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/handle_null_error/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/handle_null_error/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' ecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2964, in impl_PyObject_Repr 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/getter: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/getter/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/getter/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/getter/input.c Stdout: Stderr: tests/cpychecker/refcounts/getter/input.c: In function 'simple_getter': tests/cpychecker/refcounts/getter/input.c:42:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall 'new ref from (unknown) %s' % fnname), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/handle_null_error: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/handle_null_error/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/handle_null_error/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/handle_null_error/input.c Stdout: Stderr: tests/cpychecker/refcounts/handle_null_error/input.c: In function 'test': tests/cpychecker/refcounts/handle_null_error/input.c:33:9: error: Unhandled Python exception raised--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,215 +0,0 @@ -Trace 0: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= count.1 <= 0' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)) from tests/cpychecker/refcounts/loop_n_times/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=42)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=42), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:29 - -Trace 1: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= count.1 <= 0' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)) from tests/cpychecker/refcounts/loop_n_times/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=42)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:29 - -Trace 2: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when considering range: 1 <= count.1 <= 0x7fffffff' - 'taking True path' - 'PyList_SetItem() succeeds' - 'when considering count.1 == (int)1 from tests/cpychecker/refcounts/loop_n_times/input.c:34' - 'taking False path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)) from tests/cpychecker/refcounts/loop_n_times/input.c:38 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=42)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:42 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=42), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:29 - -Trace 3: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:45 - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:38: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:38 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loop_n_times/input.c:42 - -Trace 4: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:38' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=45), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:45 - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:38: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=38)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loop_n_times/input.c:38 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loop_n_times/input.c:42 - -Trace 5: - Transitions: - 'when PyArg_ParseTuple() succeeds' - 'taking False path' - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=40), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:40 - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loop_n_times/input.c:38 - -Trace 6: - Transitions: - 'when PyArg_ParseTuple() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loop_n_times/input.c', line=35), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loop_n_times/input.c:35 - 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/loop_n_times/input.c', line=28), 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/loop_n_times/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_TypeError')) from tests/cpychecker/refcounts/loop_n_times/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'loop_n_times': +tests/cpychecker/refcounts/loop_n_times/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple + v_fmt, v_varargs, with_size_t=False) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function + s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3364, in impl_PyString_FromString 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/incorrect_py_none: OK tests/cpychecker/refcounts/json/basic: OK tests/cpychecker/refcounts/loop_n_times: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/loop_n_times/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/loop_n_times/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/loop_n_times/input.c Stdout: Stderr: tests/cpychecker/refcounts/loop_n_times/input.c: In function 'loop_n_times': tests/cpychecker/refcounts/loop_n_times/input.c:34:26: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1139, in impl_PyArg_ParseTuple v_fmt, --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,311 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering unknown_unsigned_val.1 == (const unsigned int)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:22' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:29 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() succeeds' - 'taking False path' - 'when considering unknown_unsigned_val.1 == (const unsigned int)1 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:22' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39), region=Region('PyTypeObject for new ref from (unknown) make_item')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:29 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39), region=Region('PyTypeObject for new ref from (unknown) make_item')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: None - r->ob_type: None - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39), region=Region('PyTypeObject for new ref from (unknown) make_item')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: None - r->ob_type: None - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=39)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - -Trace 7: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff' - 'taking True path' - 'when make_item() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39 - -Trace 8: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c', line=61), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:61 - 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/loops/complex-loop-conditional-1/input.c', line=28), 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/loops/complex-loop-conditional-1/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,26 +1,32 @@ In function 'test': -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:62:nn: warning: ob_refcnt of '*item' is 1 too high [enabled by default] -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:62:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:62:nn: note: due to object being referenced by: PyListObject.ob_item[0] -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:62:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39:nn: note: new ref from (unknown) make_item allocated at: PyObject *item = make_item(i); -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33:nn: note: when PyList_New() succeeds at: result = PyList_New(0); -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:34:nn: note: taking False path at: if (!result) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:38:nn: note: reaching: for (i = 0; i < unknown_unsigned_val; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:38:nn: note: when considering range: 1 <= unknown_unsigned_val.1 <= 0xffffffff at: for (i = 0; i < unknown_unsigned_val; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:38:nn: note: taking True path at: for (i = 0; i < unknown_unsigned_val; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39:nn: note: reaching: PyObject *item = make_item(i); -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39:nn: note: when make_item() succeeds at: PyObject *item = make_item(i); -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:39:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:40:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43:nn: note: reaching: if (-1 == PyList_Append(result, item)) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43:nn: note: when PyList_Append() succeeds at: if (-1 == PyList_Append(result, item)) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43:nn: note: '*item' is now referenced by 1 non-stack value(s): PyListObject.ob_item[0] -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:43:nn: note: taking False path at: if (-1 == PyList_Append(result, item)) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:38:nn: note: reaching: for (i = 0; i < unknown_unsigned_val; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:38:nn: note: when considering unknown_unsigned_val.1 == (const unsigned int)1 from tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:22 at: for (i = 0; i < unknown_unsigned_val; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:38:nn: note: taking False path at: for (i = 0; i < unknown_unsigned_val; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:57:nn: note: reaching: return result; -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:62:nn: note: returning -tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:29:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,311 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= value <= 0' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:29 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= value <= 1' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40), region=Region('PyTypeObject for new ref from (unknown) make_item')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:29 - -Trace 2: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40), region=Region('PyTypeObject for new ref from (unknown) make_item')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44 - -Trace 3: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: None - r->ob_type: None - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40), region=Region('PyTypeObject for new ref from (unknown) make_item')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44 - -Trace 4: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44 - -Trace 5: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() succeeds' - 'taking False path' - 'when PyList_Append() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: None - r->ob_type: None - new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40: - repr(): RegionOnHeap('new ref from (unknown) make_item', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=40)) - str(): new ref from (unknown) make_item allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44 - -Trace 6: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - -Trace 7: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= value <= 0x7fffffff' - 'taking True path' - 'when make_item() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=33)) - str(): PyListObject allocated at tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40 - -Trace 8: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c', line=55), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:55 - 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/loops/complex-loop-conditional-2/input.c', line=28), 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/loops/complex-loop-conditional-2/input.c', line=28), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,26 +1,32 @@ In function 'test': -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:56:nn: warning: ob_refcnt of '*item' is 1 too high [enabled by default] -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:56:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:56:nn: note: due to object being referenced by: PyListObject.ob_item[0] -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:56:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40:nn: note: new ref from (unknown) make_item allocated at: PyObject *item = make_item(i); -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33:nn: note: when PyList_New() succeeds at: result = PyList_New(0); -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:34:nn: note: taking False path at: if (!result) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:39:nn: note: reaching: for (i = 0; i < (2 * get_limit()) + 42; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:39:nn: note: when considering range: 1 <= value <= 0x7fffffff at: for (i = 0; i < (2 * get_limit()) + 42; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:39:nn: note: taking True path at: for (i = 0; i < (2 * get_limit()) + 42; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40:nn: note: reaching: PyObject *item = make_item(i); -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40:nn: note: when make_item() succeeds at: PyObject *item = make_item(i); -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:40:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:41:nn: note: taking False path at: if (!item) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44:nn: note: reaching: if (-1 == PyList_Append(result, item)) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44:nn: note: when PyList_Append() succeeds at: if (-1 == PyList_Append(result, item)) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44:nn: note: '*item' is now referenced by 1 non-stack value(s): PyListObject.ob_item[0] -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:44:nn: note: taking False path at: if (-1 == PyList_Append(result, item)) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:39:nn: note: reaching: for (i = 0; i < (2 * get_limit()) + 42; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:39:nn: note: when considering range: -0x80000000 <= value <= 1 at: for (i = 0; i < (2 * get_limit()) + 42; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:39:nn: note: taking False path at: for (i = 0; i < (2 * get_limit()) + 42; i++) { -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:51:nn: note: reaching: return result; -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:56:nn: note: returning -tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:29:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' v_varargs, with_size_t=False) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1047, in _handle_PyArg_function s_failure.cpython.set_exception('PyExc_TypeError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_TypeError' tests/cpychecker/refcounts/loops/complex-loop-conditional-1: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/loops/complex-loop-conditional-1/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/loops/complex-loop-conditional-1/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c Stdout: Stderr: tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c: In function 'test': tests/cpychecker/refcounts/loops/complex-loop-conditional-1/input.c:33:12: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/loops/complex-loop-conditional-2: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/loops/complex-loop-conditional-2/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/loops/complex-loop-conditional-2/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c Stdout: Stderr: tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c: In function 'test': tests/cpychecker/refcounts/loops/complex-loop-conditional-2/input.c:33:12: error: Unhandled Python exception raised calling 'execute' method--- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,28 +1,32 @@ In function 'test': -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:46:nn: warning: ob_refcnt of new ref from call to PyObject_CallObject is 1 too high [enabled by default] -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:46:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:46:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: new ref from call to PyObject_CallObject allocated at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() succeeds at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: taking False path at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: reaching: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() succeeds at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when taking True path at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:46:nn: note: reaching: } -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:46:nn: note: returning at: } -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:46:nn: note: found 4 similar trace(s) to this -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: warning: dereferencing NULL (D.nnnnn->ob_type) at tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35 [enabled by default] -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() succeeds at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: taking False path at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: reaching: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() succeeds at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when taking False path at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: reaching: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() fails at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: warning: dereferencing NULL (D.nnnnn->ob_refcnt) at tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35 [enabled by default] -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() succeeds at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: taking False path at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: reaching: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: note: when PyObject_CallObject() fails at: Py_XDECREF(PyObject_CallObject(callable, args)); -tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:29:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2800, in impl_PyObject_CallObject + return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/macros/Py_XDECREF/crash: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/macros/Py_XDECREF/crash/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/macros/Py_XDECREF/crash/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c Stdout: Stderr: tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c: In function 'test': tests/cpychecker/refcounts/macros/Py_XDECREF/crash/input.c:35:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,79 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'PyList_SetItem() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27)) from tests/cpychecker/refcounts/missing_decref/input.c:27 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - 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/missing_decref/input.c', line=23), 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/missing_decref/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:30: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=30)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:30 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/missing_decref/input.c:24 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=34), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/missing_decref/input.c:34 - 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/missing_decref/input.c', line=23), 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/missing_decref/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyListObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:27: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27)) - str(): PyListObject allocated at tests/cpychecker/refcounts/missing_decref/input.c:27 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=27), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/missing_decref/input.c:30 - -Trace 2: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/missing_decref/input.c', line=29), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/missing_decref/input.c:29 - 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/missing_decref/input.c', line=23), 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/missing_decref/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/missing_decref/input.c:27 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,14 +1,30 @@ In function 'missing_decref': -tests/cpychecker/refcounts/missing_decref/input.c:38:nn: warning: ob_refcnt of '*list' is 1 too high [enabled by default] -tests/cpychecker/refcounts/missing_decref/input.c:38:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/missing_decref/input.c:38:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/missing_decref/input.c:27:nn: note: PyListObject allocated at: list = PyList_New(1); -tests/cpychecker/refcounts/missing_decref/input.c:27:nn: note: when PyList_New() succeeds at: list = PyList_New(1); -tests/cpychecker/refcounts/missing_decref/input.c:27:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/missing_decref/input.c:28:nn: note: taking False path at: if (!list) -tests/cpychecker/refcounts/missing_decref/input.c:30:nn: note: reaching: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/missing_decref/input.c:30:nn: note: when PyLong_FromLong() fails at: item = PyLong_FromLong(42); -tests/cpychecker/refcounts/missing_decref/input.c:33:nn: note: taking True path at: if (!item) -tests/cpychecker/refcounts/missing_decref/input.c:34:nn: note: reaching: return NULL; -tests/cpychecker/refcounts/missing_decref/input.c:38:nn: note: returning -tests/cpychecker/refcounts/missing_decref/input.c:24:nn: note: graphical error report for function 'missing_decref' written out to 'tests/cpychecker/refcounts/missing_decref/input.c.missing_decref-refcount-errors.html' +tests/cpychecker/refcounts/missing_decref/input.c:27:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,485 +0,0 @@ -Trace 0: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/module_handling/input.c:44 - -Trace 1: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 2: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:71 - -Trace 3: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 4: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:70 - -Trace 5: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 6: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:71 - -Trace 7: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 8: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:69 - -Trace 9: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 10: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:71 - -Trace 11: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 12: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:70 - -Trace 13: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() succeeds' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 14: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() succeeds' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:71 - -Trace 15: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() succeeds' - 'taking False path' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'when PyModule_AddIntConstant() fails' - 'when PyModule_AddStringConstant() fails' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:72 - -Trace 16: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking True path' - 'when taking True path' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:64 - -Trace 17: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyModule_AddObject() fails' - 'taking True path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=58)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/module_handling/input.c:58 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:64 - -Trace 18: - Transitions: - 'when Py_InitModule4_64() succeeds' - 'taking False path' - 'when PyDict_New() fails' - 'taking True path' - 'returning' - borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50: - repr(): RegionOnHeap('borrowed reference returned by Py_InitModule4_64()', gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50)) - str(): borrowed reference returned by Py_InitModule4_64() allocated at tests/cpychecker/refcounts/module_handling/input.c:50 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/module_handling/input.c', line=50), region=Region('PyTypeObject for borrowed reference returned by Py_InitModule4_64()')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:58 - -Trace 19: - Transitions: - 'when Py_InitModule4_64() fails' - 'taking True path' - 'returning' - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/module_handling/input.c:50 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'PyInit_example': +tests/cpychecker/refcounts/module_handling/input.c:50:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2112, in impl_Py_InitModule4_64 + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' 800, in impl_PyObject_CallObject return self.make_transitions_for_new_ref_or_fail(stmt, fnmeta) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/missing_decref: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/missing_decref/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/missing_decref/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/missing_decref/input.c Stdout: Stderr: tests/cpychecker/refcounts/missing_decref/input.c: In function 'missing_decref': tests/cpychecker/refcounts/missing_decref/input.c:27:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/module_handling: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/module_handling/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/module_handling/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/module_handling/input.c Stdout: Stderr: tests/cpychecker/refcounts/module_handling/input.c: In function 'PyInit_example': tests/cpychecker/refcounts/module_handling/input.c:50:7: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/eri--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,561 +0,0 @@ -Trace 0: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() succeeds' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) from tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48), region=Region('PyTypeObject for new ref from call through function pointer')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:29 - -Trace 1: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) from tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: refs: 0 + N where N >= 1 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48), region=Region('PyTypeObject for new ref from call through function pointer')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:29 - -Trace 2: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48), region=Region('PyTypeObject for new ref from call through function pointer')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 3: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 4: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48), region=Region('PyTypeObject for new ref from call through function pointer')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 5: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 6: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48), region=Region('PyTypeObject for new ref from call through function pointer')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 7: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 8: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48), region=Region('PyTypeObject for new ref from call through function pointer')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 9: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call succeeds' - 'taking False path' - 'when PyDict_SetItem() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48: - repr(): RegionOnHeap('new ref from call through function pointer', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=48)) - str(): new ref from call through function pointer allocated at tests/cpychecker/refcounts/object_from_callback/input.c:48 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:54 - -Trace 10: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48 - -Trace 11: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48 - -Trace 12: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking False path' - 'when taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48 - -Trace 13: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when call fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=39)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:39 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:48 - -Trace 14: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyDict_Type'))) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:39 - -Trace 15: - Transitions: - 'when PyDict_New() succeeds' - 'taking False path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34: - repr(): RegionOnHeap('PyDictObject', gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=34)) - str(): PyDictObject allocated at tests/cpychecker/refcounts/object_from_callback/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:39 - -Trace 16: - Transitions: - 'when PyDict_New() fails' - 'taking True path' - 'taking True path' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_from_callback/input.c', line=71), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/object_from_callback/input.c:71 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/object_from_callback/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,36 @@ +In function 'test': +tests/cpychecker/refcounts/object_from_callback/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New + 'PyDict_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' cs/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2112, in impl_Py_InitModule4_64 s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/not_setting_exception: OK tests/cpychecker/refcounts/object_from_callback: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/object_from_callback/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/object_from_callback/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/object_from_callback/input.c Stdout: Stderr: tests/cpychecker/refcounts/object_from_callback/input.c: In function 'test': tests/cpychecker/refcounts/object_from_callback/input.c:34:10: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_f--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,4 +0,0 @@ -Trace 0: - returned: ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_leak/input.c', line=29), value=0) -Trace 1: - returned: ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/object_leak/input.c', line=29), value=0) --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,12 +1,55 @@ In function 'object_leak': -tests/cpychecker/refcounts/object_leak/input.c:29:nn: warning: ob_refcnt of '*tmp' is 1 too high [enabled by default] -tests/cpychecker/refcounts/object_leak/input.c:29:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/object_leak/input.c:29:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/object_leak/input.c:26:nn: note: PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/object_leak/input.c:26:nn: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/object_leak/input.c:26:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/object_leak/input.c:29:nn: note: returning at: return NULL; -tests/cpychecker/refcounts/object_leak/input.c:29:nn: warning: returning (PyObject*)NULL without setting an exception [enabled by default] -tests/cpychecker/refcounts/object_leak/input.c:26:nn: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/object_leak/input.c:29:nn: note: returning at: return NULL; -tests/cpychecker/refcounts/object_leak/input.c:24:nn: note: graphical error report for function 'object_leak' written out to 'tests/cpychecker/refcounts/object_leak/input.c.object_leak-refcount-errors.html' +tests/cpychecker/refcounts/object_leak/input.c:26:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' +tests/cpychecker/refcounts/object_leak/input.c:26:nn: error: Unhandled Python exception raised within callback +Traceback (most recent call last): + File "tests/cpychecker/refcounts/object_leak/script.py", line 27, in verify_traces + traces = get_traces(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3806, in get_traces + limits=Limits(maxtrans=1024))) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' or_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 1559, in impl_PyDict_New 'PyDict_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyDict_Type' tests/cpychecker/refcounts/object_leak: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/object_leak/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/object_leak/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/object_leak/input.c Stdout: Stderr: tests/cpychecker/refcounts/object_leak/input.c: In function 'object_leak': tests/cpychecker/refcounts/object_leak/input.c:26:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/object_leak/input.c:26:15: error: Unhandled Python exception raised within callback Traceback (most recent call last): File "tests/cpychecker/refcounts/object_leak/script.py", line 27, in verify_traces traces = get_traces(fun) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3806, in get_traces limits=Limits(maxtrans=1024))) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = cu--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,67 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when taking True path' - '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/passing_dead_object/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/passing_dead_object/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/passing_dead_object/input.c:32: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/passing_dead_object/input.c', line=32)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/passing_dead_object/input.c:32 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/passing_dead_object/input.c', line=32), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/passing_dead_object/input.c:30 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/passing_dead_object/input.c:32' - error: PassingPointerToDeallocatedMemory() - error: passing pointer to deallocated memory as argument 1 of function at tests/cpychecker/refcounts/passing_dead_object/input.c:45: memory deallocated at tests/cpychecker/refcounts/passing_dead_object/input.c:42 - 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/passing_dead_object/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/passing_dead_object/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/passing_dead_object/input.c:32: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/passing_dead_object/input.c', line=32)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/passing_dead_object/input.c:32 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/passing_dead_object/input.c:30 - -Trace 2: - Transitions: - 'when PyLong_FromLong() fails' - 'taking True path' - '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/passing_dead_object/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/passing_dead_object/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/passing_dead_object/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,10 +1,30 @@ In function 'passing_dead_object_to_function': -tests/cpychecker/refcounts/passing_dead_object/input.c:45:nn: warning: passing pointer to deallocated memory as argument 1 of function at tests/cpychecker/refcounts/passing_dead_object/input.c:45: memory deallocated at tests/cpychecker/refcounts/passing_dead_object/input.c:42 [enabled by default] -tests/cpychecker/refcounts/passing_dead_object/input.c:32:nn: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/passing_dead_object/input.c:34:nn: note: taking False path at: if (!tmp) { -tests/cpychecker/refcounts/passing_dead_object/input.c:42:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/passing_dead_object/input.c:42:nn: note: when taking False path at: Py_DECREF(tmp); -tests/cpychecker/refcounts/passing_dead_object/input.c:42:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/passing_dead_object/input.c:42:nn: note: calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/passing_dead_object/input.c:32 at: Py_DECREF(tmp); -tests/cpychecker/refcounts/passing_dead_object/input.c:45:nn: note: reaching: foo(tmp); -tests/cpychecker/refcounts/passing_dead_object/input.c:30:nn: note: graphical error report for function 'passing_dead_object_to_function' written out to 'tests/cpychecker/refcounts/passing_dead_object/input.c.passing_dead_object_to_function-refcount-errors.html' +tests/cpychecker/refcounts/passing_dead_object/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,69 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29)) from tests/cpychecker/refcounts/returning_dead_object/input.c:29 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/returning_dead_object/input.c', line=26), 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/returning_dead_object/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/returning_dead_object/input.c:27 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/returning_dead_object/input.c:29' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=29)) from tests/cpychecker/refcounts/returning_dead_object/input.c:29 - r->ob_refcnt: None - r->ob_type: None - 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/returning_dead_object/input.c', line=26), 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/returning_dead_object/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/returning_dead_object/input.c:27 - -Trace 2: - Transitions: - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/returning_dead_object/input.c', line=32), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/returning_dead_object/input.c:32 - 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/returning_dead_object/input.c', line=26), 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/returning_dead_object/input.c', line=26), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/returning_dead_object/input.c:29 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,25 +1,30 @@ In function 'returning_dead_object': -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: note: but final ob_refcnt is N + 0 -tests/cpychecker/refcounts/returning_dead_object/input.c:29:nn: note: PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/returning_dead_object/input.c:29:nn: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/returning_dead_object/input.c:29:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/returning_dead_object/input.c:31:nn: note: taking False path at: if (!tmp) { -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: ob_refcnt is now refs: 0 + N where N >= 0 -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: when taking True path at: Py_DECREF(tmp); -tests/cpychecker/refcounts/returning_dead_object/input.c:42:nn: note: reaching: return tmp; -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: note: returning -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: warning: returning pointer to deallocated memory [enabled by default] -tests/cpychecker/refcounts/returning_dead_object/input.c:29:nn: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/returning_dead_object/input.c:31:nn: note: taking False path at: if (!tmp) { -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: when taking False path at: Py_DECREF(tmp); -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/returning_dead_object/input.c:29 at: Py_DECREF(tmp); -tests/cpychecker/refcounts/returning_dead_object/input.c:42:nn: note: reaching: return tmp; -tests/cpychecker/refcounts/returning_dead_object/input.c:43:nn: note: returning -tests/cpychecker/refcounts/returning_dead_object/input.c:39:nn: note: memory deallocated here -tests/cpychecker/refcounts/returning_dead_object/input.c:27:nn: note: graphical error report for function 'returning_dead_object' written out to 'tests/cpychecker/refcounts/returning_dead_object/input.c.returning_dead_object-refcount-errors.html' +tests/cpychecker/refcounts/returning_dead_object/input.c:29:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' rstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/passing_dead_object: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/passing_dead_object/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/passing_dead_object/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/passing_dead_object/input.c Stdout: Stderr: tests/cpychecker/refcounts/passing_dead_object/input.c: In function 'passing_dead_object_to_function': tests/cpychecker/refcounts/passing_dead_object/input.c:32:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/returning_dead_object: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/returning_dead_object/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refco--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,80 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:24 as non-NULL' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/correct/input.c', line=30), region=Region('heap-region-0')) - str(): (struct PyObject *)&Region('heap-region-0') from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:30 - r->ob_refcnt: (Py_ssize_t)val [-0x7fffffffffffffff <= val <= 0x7fffffffffffffff] from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:46 - r->ob_type: None - 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/storage_regions/static/correct/input.c', line=23), 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/storage_regions/static/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:24 - -Trace 1: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:24 as NULL' - 'taking True path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/correct/input.c', line=36), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/correct/input.c', line=36))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/correct/input.c', line=36)) from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:36 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/correct/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/storage_regions/static/correct/input.c', line=23), 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/storage_regions/static/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Region('heap-region-0'): - repr(): Region('heap-region-0') - str(): Region('heap-region-0') - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:24 - -Trace 2: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:24 as NULL' - 'taking True path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/correct/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:38 - 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/storage_regions/static/correct/input.c', line=23), 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/storage_regions/static/correct/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Region('heap-region-0'): - repr(): Region('heap-region-0') - str(): Region('heap-region-0') - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/storage_regions/static/correct/input.c:36 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,36 @@ +In function 'test': +tests/cpychecker/refcounts/storage_regions/static/correct/input.c:36:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' unts/returning_dead_object/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/returning_dead_object/input.c Stdout: Stderr: tests/cpychecker/refcounts/returning_dead_object/input.c: In function 'returning_dead_object': tests/cpychecker/refcounts/returning_dead_object/input.c:29:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/storage_regions/static/correct: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/storage_regions/static/correct/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/storage_regions/static/correct/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/storage_regions/static/correct/input.c Stdout: Stderr: tests/cpychecker/refcounts/storage_regions/static/correct/input.c: In function 'test': tests/cpychecker/refcounts/storage_regions/static/correct/input.c:36:32: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-pyt--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,70 +0,0 @@ -Trace 0: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24 as non-NULL' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c', line=30), region=Region('heap-region-0')) - str(): (struct PyObject *)&Region('heap-region-0') from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:30 - r->ob_refcnt: None - r->ob_type: None - 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/storage_regions/static/incorrect/input.c', line=23), 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/storage_regions/static/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24 - -Trace 1: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24 as NULL' - 'taking True path' - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c', line=36), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c', line=36))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c', line=36)) from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c', line=36), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/storage_regions/static/incorrect/input.c', line=23), 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/storage_regions/static/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24 - -Trace 2: - Transitions: - 'when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24 as NULL' - 'taking True path' - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:38 - 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/storage_regions/static/incorrect/input.c', line=23), 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/storage_regions/static/incorrect/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,16 +1,36 @@ In function 'test': -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:50:nn: warning: ob_refcnt of return value is 1 too low [enabled by default] -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:50:nn: note: was expecting final ob_refcnt to be N + 2 (for some unknown N) -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:50:nn: note: due to object being referenced by: return value, cache -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:50:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:nn: note: PyLongObject allocated at: cache = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:30:nn: note: when treating unknown struct PyObject * from tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24 as NULL at: if (!cache) { -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:30:nn: note: taking True path at: if (!cache) { -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:nn: note: reaching: cache = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:nn: note: when PyLong_FromLong() succeeds at: cache = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:nn: note: return value is now referenced by 1 non-stack value(s): cache -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:37:nn: note: taking False path at: if (!cache) { -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:49:nn: note: reaching: return cache; -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:50:nn: note: returning -tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:24:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' hon-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/storage_regions/static/incorrect: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/storage_regions/static/incorrect/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/storage_regions/static/incorrect/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c Stdout: Stderr: tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c: In function 'test': tests/cpychecker/refcounts/storage_regions/static/incorrect/input.c:36:32: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when PyString_FromFormat() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/subclass/handling/input.c', line=39), region=RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/subclass/handling/input.c', line=39))) - str(): (struct PyObject *)&RegionOnHeap('PyStringObject', gcc.Location(file='tests/cpychecker/refcounts/subclass/handling/input.c', line=39)) from tests/cpychecker/refcounts/subclass/handling/input.c:39 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/subclass/handling/input.c', line=39), region=RegionForGlobal(gcc.VarDecl('PyString_Type'))) - 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/subclass/handling/input.c', line=37), 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/subclass/handling/input.c', line=37), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/subclass/handling/input.c:38 - -Trace 1: - Transitions: - 'when PyString_FromFormat() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/subclass/handling/input.c', line=39), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/subclass/handling/input.c:39 - 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/subclass/handling/input.c', line=37), 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/subclass/handling/input.c', line=37), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/subclass/handling/input.c:39 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,34 @@ +In function 'test_function': +tests/cpychecker/refcounts/subclass/handling/input.c:39:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3351, in impl_PyString_FromFormat + 'PyString_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,39 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26)) from tests/cpychecker/refcounts/too_many_increfs/input.c:26 - r->ob_refcnt: refs: 2 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/too_many_increfs/input.c', line=26), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/too_many_increfs/input.c', line=23), 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/too_many_increfs/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/too_many_increfs/input.c:24 - -Trace 1: - Transitions: - 'when PyLong_FromLong() fails' - error: NullPtrDereference() - error: dereferencing NULL (tmp->ob_refcnt) at tests/cpychecker/refcounts/too_many_increfs/input.c:30 - 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/too_many_increfs/input.c', line=23), 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/too_many_increfs/input.c', line=23), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/too_many_increfs/input.c:26 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,13 +1,30 @@ In function 'too_many_increfs': -tests/cpychecker/refcounts/too_many_increfs/input.c:31:nn: warning: ob_refcnt of return value is 1 too high [enabled by default] -tests/cpychecker/refcounts/too_many_increfs/input.c:31:nn: note: was expecting final ob_refcnt to be N + 1 (for some unknown N) -tests/cpychecker/refcounts/too_many_increfs/input.c:31:nn: note: due to object being referenced by: return value -tests/cpychecker/refcounts/too_many_increfs/input.c:31:nn: note: but final ob_refcnt is N + 2 -tests/cpychecker/refcounts/too_many_increfs/input.c:26:nn: note: PyLongObject allocated at: tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/too_many_increfs/input.c:26:nn: note: when PyLong_FromLong() succeeds at: tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/too_many_increfs/input.c:26:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/too_many_increfs/input.c:30:nn: note: ob_refcnt is now refs: 2 + N where N >= 0 -tests/cpychecker/refcounts/too_many_increfs/input.c:31:nn: note: returning at: return tmp; -tests/cpychecker/refcounts/too_many_increfs/input.c:30:nn: warning: dereferencing NULL (tmp->ob_refcnt) at tests/cpychecker/refcounts/too_many_increfs/input.c:30 [enabled by default] -tests/cpychecker/refcounts/too_many_increfs/input.c:26:nn: note: when PyLong_FromLong() fails at: tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/too_many_increfs/input.c:24:nn: note: graphical error report for function 'too_many_increfs' written out to 'tests/cpychecker/refcounts/too_many_increfs/input.c.too_many_increfs-refcount-errors.html' +tests/cpychecker/refcounts/too_many_increfs/input.c:26:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' /home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/subclass/detection: OK tests/cpychecker/refcounts/subclass/handling: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/subclass/handling/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/subclass/handling/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/subclass/handling/input.c Stdout: Stderr: tests/cpychecker/refcounts/subclass/handling/input.c: In function 'test_function': tests/cpychecker/refcounts/subclass/handling/input.c:39:5: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 3351, in impl_PyString_FromFormat 'PyString_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyString_Type' tests/cpychecker/refcounts/subclass/incorrect-subclass-ptr: OK tests/cpychecker/refcounts/subclass/opaque-struct: OK tests/cpychecker/refcounts/ticket-20: OK tests/cpychecker/refcounts/too_many_increfs: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/too_many_increfs/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/too_many_increfs/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/too_many_increfs/input.c Stdout: Stderr: tests/cpychecker/refcounts/too_many_increfs/input.c: In function 'too_many_increfs': tests/cpychecker/refcounts/too_many_increfs/input.c:26:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/li--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,42 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= len <= 0' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=34), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=34)) from tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:29 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= len <= 0x7fffffff' - 'taking True path' - error: UsageOfUninitializedData() - error: comparison against uninitialized data (item) at tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:41 - PyListObject allocated at tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:29 - -Trace 2: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/comparison/input.c', line=52), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:52 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,9 +1,34 @@ In function 'test': -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:41:nn: warning: comparison against uninitialized data (item) at tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:41 [enabled by default] -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34:nn: note: when PyList_New() succeeds at: result = PyList_New(len); -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:35:nn: note: taking False path at: if (!result) { -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:39:nn: note: reaching: for (i = 0; i < len; i++) { -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:39:nn: note: when considering range: 1 <= len <= 0x7fffffff at: for (i = 0; i < len; i++) { -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:39:nn: note: taking True path at: for (i = 0; i < len; i++) { -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:41:nn: note: reaching: if (!item) { -tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:29:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/uninitialized_data/comparison/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' bcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/tp_iternext/correct: OK tests/cpychecker/refcounts/tp_iternext/partial-type-object: OK tests/cpychecker/refcounts/uninitialized_data/comparison: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/uninitialized_data/comparison/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/uninitialized_data/comparison/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/uninitialized_data/comparison/input.c Stdout: Stderr: tests/cpychecker/refcounts/uninitialized_data/comparison/input.c: In function 'test': tests/cpychecker/refcounts/uninitialized_data/comparison/input.c:34:12: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,42 +0,0 @@ -Trace 0: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: -0x80000000 <= len <= 0' - 'taking False path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=34), region=RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=34))) - str(): (struct PyObject *)&RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=34)) from tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:29 - -Trace 1: - Transitions: - 'when PyList_New() succeeds' - 'taking False path' - 'when considering range: 1 <= len <= 0x7fffffff' - 'taking True path' - error: UsageOfUninitializedData() - error: passing uninitialized data (item) as argument 3 to function at tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:41 - PyListObject allocated at tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34: - repr(): RegionOnHeap('PyListObject', gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=34)) - str(): PyListObject allocated at tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=34), region=RegionForGlobal(gcc.VarDecl('PyList_Type'))) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:29 - -Trace 2: - Transitions: - 'when PyList_New() fails' - 'taking True path' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c', line=48), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:48 - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,9 +1,34 @@ In function 'test': -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:41:nn: warning: passing uninitialized data (item) as argument 3 to function at tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:41 [enabled by default] -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34:nn: note: when PyList_New() succeeds at: result = PyList_New(len); -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:35:nn: note: taking False path at: if (!result) { -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:39:nn: note: reaching: for (i = 0; i < len; i++) { -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:39:nn: note: when considering range: 1 <= len <= 0x7fffffff at: for (i = 0; i < len; i++) { -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:39:nn: note: taking True path at: for (i = 0; i < len; i++) { -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:41:nn: note: reaching: PyList_SetItem(result, i, item); -tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:29:nn: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c.test-refcount-errors.html' +tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New + 'PyList_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,41 +0,0 @@ -Trace 0: - Transitions: - 'when foo() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function/input.c', line=31), region=RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function/input.c', line=31))) - str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function/input.c', line=31)) from tests/cpychecker/refcounts/unrecognized_function/input.c:31 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function/input.c', line=31), region=Region('PyTypeObject for new ref from (unknown) foo')) - 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/unrecognized_function/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/unrecognized_function/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function/input.c:30 - -Trace 1: - Transitions: - 'when foo() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function/input.c', line=31), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function/input.c:31 - 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/unrecognized_function/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/unrecognized_function/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/unrecognized_function/input.c:31 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'call_to_unrecognized_function': +tests/cpychecker/refcounts/unrecognized_function/input.c:31:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall + 'new ref from (unknown) %s' % fnname), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/uninitialized_data/function_arg: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/uninitialized_data/function_arg/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/uninitialized_data/function_arg/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c Stdout: Stderr: tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c: In function 'test': tests/cpychecker/refcounts/uninitialized_data/function_arg/input.c:34:12: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2308, in impl_PyList_New 'PyList_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyList_Type' tests/cpychecker/refcounts/unrecognized_function: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/unrecognized_function/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/unrecognized_function/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/unrecognized_function/input.c Stdout: Stderr: tests/cpychecker/refcounts/unrecognized_function/input.c: In function 'call_to_unrecogn--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,138 +0,0 @@ -Trace 0: - Transitions: - 'when foo() succeeds' - 'taking False path' - 'when taking True path' - 'when foo() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43), region=RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43))) - str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43)) from tests/cpychecker/refcounts/unrecognized_function2/input.c:43 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43), region=Region('PyTypeObject for new ref from (unknown) foo')) - 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/unrecognized_function2/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/unrecognized_function2/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34: - repr(): RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=34)) - str(): new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=34), region=Region('PyTypeObject for new ref from (unknown) foo')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function2/input.c:30 - -Trace 1: - Transitions: - 'when foo() succeeds' - 'taking False path' - 'when taking True path' - 'when foo() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function2/input.c:43 - 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/unrecognized_function2/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/unrecognized_function2/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34: - repr(): RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=34)) - str(): new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=34), region=Region('PyTypeObject for new ref from (unknown) foo')) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/unrecognized_function2/input.c:43 - -Trace 2: - Transitions: - 'when foo() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34' - 'when foo() succeeds' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43), region=RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43))) - str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43)) from tests/cpychecker/refcounts/unrecognized_function2/input.c:43 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43), region=Region('PyTypeObject for new ref from (unknown) foo')) - 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/unrecognized_function2/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/unrecognized_function2/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34: - repr(): RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=34)) - str(): new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function2/input.c:30 - -Trace 3: - Transitions: - 'when foo() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34' - 'when foo() fails' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=43), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function2/input.c:43 - 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/unrecognized_function2/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/unrecognized_function2/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34: - repr(): RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=34)) - str(): new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function2/input.c:34 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/unrecognized_function2/input.c:43 - -Trace 4: - Transitions: - 'when foo() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function2/input.c', line=36), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function2/input.c:36 - 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/unrecognized_function2/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/unrecognized_function2/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/unrecognized_function2/input.c:34 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'call_to_unrecognized_function': +tests/cpychecker/refcounts/unrecognized_function2/input.c:34:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall + 'new ref from (unknown) %s' % fnname), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' ized_function': tests/cpychecker/refcounts/unrecognized_function/input.c:31:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall 'new ref from (unknown) %s' % fnname), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/unrecognized_function2: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/unrecognized_function2/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/unrecognized_function2/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/unrecognized_function2/input.c Stdout: Stderr: tests/cpychecker/refcounts/unrecognized_function2/input.c: In function 'call_to_unrecognized_function': tests/cpychecker/refcounts/unrecognized_function2/input.c:34:9: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_Gimpl--- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,38 +0,0 @@ -Trace 0: - Transitions: - 'when foo() succeeds' - '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/unrecognized_function3/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/unrecognized_function3/input.c', line=29), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function3/input.c:32: - repr(): RegionOnHeap('new ref from (unknown) foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function3/input.c', line=32)) - str(): new ref from (unknown) foo allocated at tests/cpychecker/refcounts/unrecognized_function3/input.c:32 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function3/input.c', line=32), region=Region('PyTypeObject for new ref from (unknown) foo')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function3/input.c:30 - -Trace 1: - Transitions: - 'when foo() fails' - '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/unrecognized_function3/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/unrecognized_function3/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/unrecognized_function3/input.c:32 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,9 +1,30 @@ In function 'call_to_unrecognized_function': -tests/cpychecker/refcounts/unrecognized_function3/input.c:33:nn: warning: ob_refcnt of new ref from (unknown) foo is 1 too high [enabled by default] -tests/cpychecker/refcounts/unrecognized_function3/input.c:33:nn: note: was expecting final ob_refcnt to be N + 0 (for some unknown N) -tests/cpychecker/refcounts/unrecognized_function3/input.c:33:nn: note: but final ob_refcnt is N + 1 -tests/cpychecker/refcounts/unrecognized_function3/input.c:32:nn: note: new ref from (unknown) foo allocated at: foo(42); -tests/cpychecker/refcounts/unrecognized_function3/input.c:32:nn: note: when foo() succeeds at: foo(42); -tests/cpychecker/refcounts/unrecognized_function3/input.c:32:nn: note: ob_refcnt is now refs: 1 + N where N >= 0 -tests/cpychecker/refcounts/unrecognized_function3/input.c:33:nn: note: returning at: } -tests/cpychecker/refcounts/unrecognized_function3/input.c:30:nn: note: graphical error report for function 'call_to_unrecognized_function' written out to 'tests/cpychecker/refcounts/unrecognized_function3/input.c.call_to_unrecognized_function-refcount-errors.html' +tests/cpychecker/refcounts/unrecognized_function3/input.c:32:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall + 'new ref from (unknown) %s' % fnname), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,79 +0,0 @@ -Trace 0: - Transitions: - 'when make_foo() succeeds' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function4/input.c', line=42), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/unrecognized_function4/input.c:42 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/unrecognized_function4/input.c', line=34), 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/unrecognized_function4/input.c', line=34), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) make_foo allocated at tests/cpychecker/refcounts/unrecognized_function4/input.c:36: - repr(): RegionOnHeap('new ref from (unknown) make_foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function4/input.c', line=36)) - str(): new ref from (unknown) make_foo allocated at tests/cpychecker/refcounts/unrecognized_function4/input.c:36 - r->ob_refcnt: refs: 0 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function4/input.c', line=36), region=Region('PyTypeObject for new ref from (unknown) make_foo')) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function4/input.c:35 - -Trace 1: - Transitions: - 'when make_foo() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on new ref from (unknown) make_foo allocated at tests/cpychecker/refcounts/unrecognized_function4/input.c:36' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function4/input.c', line=42), region=RegionForGlobal(gcc.VarDecl('_Py_NoneStruct'))) - str(): (struct PyObject *)&RegionForGlobal(gcc.VarDecl('_Py_NoneStruct')) from tests/cpychecker/refcounts/unrecognized_function4/input.c:42 - r->ob_refcnt: refs: 1 + N where N >= 1 - r->ob_type: None - 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/unrecognized_function4/input.c', line=34), 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/unrecognized_function4/input.c', line=34), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - new ref from (unknown) make_foo allocated at tests/cpychecker/refcounts/unrecognized_function4/input.c:36: - repr(): RegionOnHeap('new ref from (unknown) make_foo', gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function4/input.c', line=36)) - str(): new ref from (unknown) make_foo allocated at tests/cpychecker/refcounts/unrecognized_function4/input.c:36 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function4/input.c:35 - -Trace 2: - Transitions: - 'when make_foo() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/unrecognized_function4/input.c', line=38), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/unrecognized_function4/input.c:38 - 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/unrecognized_function4/input.c', line=34), 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/unrecognized_function4/input.c', line=34), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/unrecognized_function4/input.c:36 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -0,0 +1,30 @@ +In function 'test': +tests/cpychecker/refcounts/unrecognized_function4/input.c:36:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall + 'new ref from (unknown) %s' % fnname), + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail + s_failure = self.mkstate_exception(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception + t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception + exc_decl = compat.get_exception_decl_by_name(exc_name) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name + raise CouldNotFindVarDecl(exc_name) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' eCall 'new ref from (unknown) %s' % fnname), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/unrecognized_function3: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/unrecognized_function3/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/unrecognized_function3/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/unrecognized_function3/input.c Stdout: Stderr: tests/cpychecker/refcounts/unrecognized_function3/input.c: In function 'call_to_unrecognized_function': tests/cpychecker/refcounts/unrecognized_function3/input.c:32:8: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall 'new ref from (unknown) %s' % fnname), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/unrecognized_function4: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/unrecognized_function4/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/unrecognized_function4/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/unrecognized_function4/input.c Stdout: Stderr: tests/cpychecker/refcounts/unrecognized_function4/input.c: In function 'test': tests/cpychecker/refcounts/unrecognized_function4/input.c:36:16: error: Unhandled --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,70 +0,0 @@ -Trace 0: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when taking True path' - 'returning' - Return value: - repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30), region=RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30))) - str(): (struct PyObject *)&RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30)) from tests/cpychecker/refcounts/use_after_dealloc/input.c:30 - r->ob_refcnt: refs: 1 + N where N >= 0 - r->ob_type: PointerToRegion(gcctype='struct PyTypeObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30), region=RegionForGlobal(gcc.VarDecl('PyLong_Type'))) - 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/use_after_dealloc/input.c', line=27), 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/use_after_dealloc/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/use_after_dealloc/input.c:28 - -Trace 1: - Transitions: - 'when PyLong_FromLong() succeeds' - 'taking False path' - 'when taking False path' - 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30' - error: ReadFromDeallocatedMemory() - error: reading from deallocated memory at tests/cpychecker/refcounts/use_after_dealloc/input.c:42: memory deallocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:41 - 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/use_after_dealloc/input.c', line=27), 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/use_after_dealloc/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30: - repr(): RegionOnHeap('PyLongObject', gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=30)) - str(): PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30 - r->ob_refcnt: None - r->ob_type: None - Exception: - (struct PyObject *)0 from tests/cpychecker/refcounts/use_after_dealloc/input.c:28 - -Trace 2: - Transitions: - 'when PyLong_FromLong() fails' - 'taking True path' - 'returning' - Return value: - repr(): ConcreteValue(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/use_after_dealloc/input.c', line=33), value=0) - str(): (struct PyObject *)0 from tests/cpychecker/refcounts/use_after_dealloc/input.c:33 - 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/use_after_dealloc/input.c', line=27), 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/use_after_dealloc/input.c', line=27), region=Region("region-for-type-of-arg-gcc.ParmDecl('args')")) - Exception: - (struct PyObject *)&RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) from tests/cpychecker/refcounts/use_after_dealloc/input.c:30 --- Expected stderr (after cleaning) +++ Actual stderr (after cleaning) @@ -1,10 +1,30 @@ In function 'use_after_dealloc': -tests/cpychecker/refcounts/use_after_dealloc/input.c:42:nn: warning: reading from deallocated memory at tests/cpychecker/refcounts/use_after_dealloc/input.c:42: memory deallocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:41 [enabled by default] -tests/cpychecker/refcounts/use_after_dealloc/input.c:30:nn: note: when PyLong_FromLong() succeeds at: PyObject *tmp = PyLong_FromLong(0x1000); -tests/cpychecker/refcounts/use_after_dealloc/input.c:32:nn: note: taking False path at: if (!tmp) { -tests/cpychecker/refcounts/use_after_dealloc/input.c:41:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/use_after_dealloc/input.c:41:nn: note: when taking False path at: Py_DECREF(tmp); -tests/cpychecker/refcounts/use_after_dealloc/input.c:41:nn: note: reaching: Py_DECREF(tmp); -tests/cpychecker/refcounts/use_after_dealloc/input.c:41:nn: note: calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/use_after_dealloc/input.c:30 at: Py_DECREF(tmp); -tests/cpychecker/refcounts/use_after_dealloc/input.c:42:nn: note: reaching: Py_INCREF(tmp); -tests/cpychecker/refcounts/use_after_dealloc/input.c:28:nn: note: graphical error report for function 'use_after_dealloc' written out to 'tests/cpychecker/refcounts/use_after_dealloc/input.c.use_after_dealloc-refcount-errors.html' +tests/cpychecker/refcounts/use_after_dealloc/input.c:30:nn: error: Unhandled Python exception raised calling 'execute' method +Traceback (most recent call last): + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute + self._check_refcounts(fun) + File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts + dump_json=self.dump_json) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts + maxtrans) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts + limits=limits) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces + depth + 1): + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces + transitions = curstate.get_transitions() + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions + return self._get_transitions_for_stmt(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt + return self._get_transitions_for_GimpleCall(stmt) + File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall + return meth(stmt, *args) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong + 'PyLong_Type') + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor + typeobjregion = self.typeobjregion_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name + typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) + File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name + raise CouldNotFindVarDecl(typeobjname) +libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2311, in _get_transitions_for_GimpleCall 'new ref from (unknown) %s' % fnname), File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 860, in make_transitions_for_new_ref_or_fail s_failure = self.mkstate_exception(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 843, in mkstate_exception t_failure.dest.cpython.set_exception('PyExc_MemoryError', stmt.loc) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 647, in set_exception exc_decl = compat.get_exception_decl_by_name(exc_name) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 85, in get_exception_decl_by_name raise CouldNotFindVarDecl(exc_name) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyExc_MemoryError' tests/cpychecker/refcounts/use_after_dealloc: FAIL returncode: 1 compiling: gcc -c -o tests/cpychecker/refcounts/use_after_dealloc/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/cpychecker/refcounts/use_after_dealloc/script.py -fsigned-char -I/usr/include/python2.7 tests/cpychecker/refcounts/use_after_dealloc/input.c Stdout: Stderr: tests/cpychecker/refcounts/use_after_dealloc/input.c: In function 'use_after_dealloc': tests/cpychecker/refcounts/use_after_dealloc/input.c:30:15: error: Unhandled Python exception raised calling 'execute' method Traceback (most recent call last): File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 79, in execute self._check_refcounts(fun) File "/home/erics/gcc-python-plugin/libcpychecker/__init__.py", line 85, in _check_refcounts dump_json=self.dump_json) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4361, in check_refcounts maxtrans) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 4216, in impl_check_refcounts limits=limits) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3073, in iter_traces depth + 1): File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 3037, in iter_traces transitions = curstate.get_transitions() File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2089, in get_transitions return self._get_transitions_for_stmt(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2105, in _get_transitions_for_stmt return self._get_transitions_for_GimpleCall(stmt) File "/home/erics/gcc-python-plugin/libcpychecker/absinterp.py", line 2276, in _get_transitions_for_GimpleCall return meth(stmt, *args) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 2398, in impl_PyLong_FromLong 'PyLong_Type') File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 702, in object_ctor typeobjregion = self.typeobjregion_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/refcounts.py", line 675, in typeobjregion_by_name typeobjdecl = compat.get_typeobject_decl_by_name(typeobjname) File "/home/erics/gcc-python-plugin/libcpychecker/compat.py", line 91, in get_typeobject_decl_by_name raise CouldNotFindVarDecl(typeobjname) libcpychecker.compat.CouldNotFindVarDecl: could not find expected global variable 'PyLong_Type' tests/cpychecker/refcounts/without-python-headers: OK tests/cpychecker/unknown-function: OK tests/examples/attributes: OK tests/examples/attributes-with-macros: OK tests/examples/c/struct: OK tests/examples/cplusplus/classes: FAIL returncode: 0 compiling: gcc -c -o tests/examples/cplusplus/classes/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/examples/cplusplus/classes/script.py -fsigned-char tests/examples/cplusplus/classes/input.cc Stdout: fn: gcc.Function('__base_dtor ') fn.decl.name: '__base_dtor ' fn.decl.fullname: 'Example::Widget::~Widget()' str(fn.decl): __base_dtor type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['struct Widget *'] block 2 gimple[0]: str(stmt): 'this->_vptr.Widget = &_ZTVN7Example6WidgetE[2];' repr(stmt): 'gcc.GimpleAssign()' block 3 gimple[0]: str(stmt): ':' repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(2107))' gimple[1]: str(stmt): 'D.2218 = 0 & 1;' repr(stmt): 'gcc.GimpleAssign()' gimple[2]: str(stmt): 'D.2219 = (bool) D.2218;' repr(stmt): 'gcc.GimpleAssign()' gimple[3]: str(stmt): 'if (D.2219 != 0)' repr(stmt): 'gcc.GimpleCond()' block 4 gimple[0]: str(stmt): 'operator delete (this);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'operator delete' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('operator delete') stmt.fn.operand.fullname: 'void operator delete(void*) throw ()' str(stmt.args[0]): 'this' str(stmt.lhs): None block 5 gimple[0]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('__base_dtor ') fn.decl.name: '__base_dtor ' fn.decl.fullname: 'Example::Dialog::~Dialog()' str(fn.decl): __base_dtor type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['struct Dialog *'] block 2 gimple[0]: str(stmt): 'this->D.2134._vptr.Widget = &_ZTVN7Example6DialogE[2];' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: str(stmt): 'D.2223 = &this->D.2134;' repr(stmt): 'gcc.GimpleAssign()' gimple[2]: str(stmt): 'Example::Widget::~Widget (D.2223);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): '__base_dtor ' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('__base_dtor ') stmt.fn.operand.fullname: 'Example::Widget::~Widget()' str(stmt.args[0]): 'D.2223' str(stmt.lhs): None block 3 gimple[0]: str(stmt): ':' repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(2178))' gimple[1]: str(stmt): 'D.2224 = 0 & 1;' repr(stmt): 'gcc.GimpleAssign()' gimple[2]: str(stmt): 'D.2225 = (bool) D.2224;' repr(stmt): 'gcc.GimpleAssign()' gimple[3]: str(stmt): 'if (D.2225 != 0)' repr(stmt): 'gcc.GimpleCond()' block 4 gimple[0]: str(stmt): 'operator delete (this);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'operator delete' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('operator delete') stmt.fn.operand.fullname: 'void operator delete(void*) throw ()' str(stmt.args[0]): 'this' str(stmt.lhs): None block 5 gimple[0]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('foo') fn.decl.name: 'foo' fn.decl.fullname: 'void foo(const Example::Coord&)' str(fn.decl): foo type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['const struct Coord &'] block 2 gimple[0]: str(stmt): 'D.2235 = operator new (16);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'operator new' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('operator new') stmt.fn.operand.fullname: 'void* operator new(long unsigned int) throw (std::bad_alloc)' str(stmt.args[0]): '16' str(stmt.lhs): D.2235 gimple[1]: str(stmt): 'dlg.0 = D.2235;' repr(stmt): 'gcc.GimpleAssign()' gimple[2]: str(stmt): 'Example::Dialog::Dialog (dlg.0);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): '__comp_ctor ' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('__comp_ctor ') stmt.fn.operand.fullname: 'Example::Dialog::Dialog()' str(stmt.args[0]): 'dlg.0' str(stmt.lhs): None gimple[3]: str(stmt): 'dlg = dlg.0;' repr(stmt): 'gcc.GimpleAssign()' gimple[4]: str(stmt): 'Example::Widget::set_location (dlg, coord);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'set_location' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('set_location') stmt.fn.operand.fullname: 'void Example::Widget::set_location(const Example::Coord&)' str(stmt.args[0]): 'dlg' str(stmt.args[1]): 'coord' str(stmt.lhs): None gimple[5]: str(stmt): 'if (dlg != 0B)' repr(stmt): 'gcc.GimpleCond()' block 3 gimple[0]: str(stmt): 'D.2231 = dlg->_vptr.Widget;' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: str(stmt): 'D.2232 = D.2231 + 8;' repr(stmt): 'gcc.GimpleAssign()' gimple[2]: str(stmt): 'D.2233 = *D.2232;' repr(stmt): 'gcc.GimpleAssign()' gimple[3]: str(stmt): 'OBJ_TYPE_REF(D.2233;dlg->1) (dlg);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'OBJ_TYPE_REF(D.2233;dlg->1)' stmt.fn: str(stmt.args[0]): 'dlg' str(stmt.lhs): None block 4 gimple[0]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('__base_ctor ') fn.decl.name: '__base_ctor ' fn.decl.fullname: 'Example::Dialog::Dialog()' str(fn.decl): __base_ctor type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['struct Dialog *'] block 2 gimple[0]: str(stmt): 'D.2236 = &this->D.2134;' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: str(stmt): 'Example::Widget::Widget (D.2236);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): '__base_ctor ' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('__base_ctor ') stmt.fn.operand.fullname: 'Example::Widget::Widget()' str(stmt.args[0]): 'D.2236' str(stmt.lhs): None gimple[2]: str(stmt): 'this->D.2134._vptr.Widget = &_ZTVN7Example6DialogE[2];' repr(stmt): 'gcc.GimpleAssign()' gimple[3]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('__base_ctor ') fn.decl.name: '__base_ctor ' fn.decl.fullname: 'Example::Widget::Widget()' str(fn.decl): __base_ctor type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: True fn.decl.is_static: True return type: 'void' argument types: ['struct Widget *'] block 2 gimple[0]: str(stmt): 'this->_vptr.Widget = &_ZTVN7Example6WidgetE[2];' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('foo') fn.decl.name: 'foo' fn.decl.fullname: 'void foo(const char*)' str(fn.decl): foo type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['const char *'] block 2 gimple[0]: str(stmt): 'GIMPLE_NOP' repr(stmt): 'gcc.GimpleNop()' gimple[1]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('foo') fn.decl.name: 'foo' fn.decl.fullname: 'void foo()' str(fn.decl): foo type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: [] block 2 gimple[0]: str(stmt): 'GIMPLE_NOP' repr(stmt): 'gcc.GimpleNop()' gimple[1]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('set_location') fn.decl.name: 'set_location' fn.decl.fullname: 'void Example::Widget::set_location(const Example::Coord&)' str(fn.decl): set_location type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['struct Widget *', 'const struct Coord &'] block 2 gimple[0]: str(stmt): 'this->m_location = *coord;' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('get_width') fn.decl.name: 'get_width' fn.decl.fullname: 'virtual int Example::Dialog::get_width()' str(fn.decl): get_width type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'int' argument types: ['struct Dialog *'] block 2 gimple[0]: str(stmt): 'D.2238 = 400;' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: str(stmt): 'return D.2238;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('__deleting_dtor ') fn.decl.name: '__deleting_dtor ' fn.decl.fullname: 'virtual Example::Dialog::~Dialog()' str(fn.decl): __deleting_dtor type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['struct Dialog *'] block 2 gimple[0]: str(stmt): 'Example::Dialog::~Dialog (this);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): '__comp_dtor ' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('__comp_dtor ') stmt.fn.operand.fullname: 'virtual Example::Dialog::~Dialog()' str(stmt.args[0]): 'this' str(stmt.lhs): None block 3 gimple[0]: str(stmt): ':' repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(2182))' gimple[1]: str(stmt): 'operator delete (this);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'operator delete' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('operator delete') stmt.fn.operand.fullname: 'void operator delete(void*) throw ()' str(stmt.args[0]): 'this' str(stmt.lhs): None gimple[2]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' fn: gcc.Function('__deleting_dtor ') fn.decl.name: '__deleting_dtor ' fn.decl.fullname: 'virtual Example::Widget::~Widget()' str(fn.decl): __deleting_dtor type(fn): type(fn.decl): type(fn.decl.type): fn.decl.is_public: True fn.decl.is_private: False fn.decl.is_protected: False fn.decl.is_static: True return type: 'void' argument types: ['struct Widget *'] block 2 gimple[0]: str(stmt): 'Example::Widget::~Widget (this);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): '__comp_dtor ' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('__comp_dtor ') stmt.fn.operand.fullname: 'virtual Example::Widget::~Widget()' str(stmt.args[0]): 'this' str(stmt.lhs): None block 3 gimple[0]: str(stmt): ':' repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(2111))' gimple[1]: str(stmt): 'operator delete (this);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): 'operator delete' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('operator delete') stmt.fn.operand.fullname: 'void operator delete(void*) throw ()' str(stmt.args[0]): 'this' str(stmt.lhs): None gimple[2]: str(stmt): 'return;' repr(stmt): 'gcc.GimpleReturn()' Stderr: --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -18,7 +18,7 @@ block 3 gimple[0]: str(stmt): ':' - repr(stmt): 'gcc.GimpleLabel()' + repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(nnnn))' gimple[1]: str(stmt): 'D.nnnnn = 0 & 1;' repr(stmt): 'gcc.GimpleAssign()' @@ -61,19 +61,22 @@ str(stmt): 'this->D.nnnnn._vptr.Widget = &_ZTVN7Example6DialogE[2];' repr(stmt): 'gcc.GimpleAssign()' gimple[1]: - str(stmt): 'Example::Widget::~Widget (this);' + str(stmt): 'D.nnnnn = &this->D.nnnnn;' + repr(stmt): 'gcc.GimpleAssign()' + gimple[2]: + str(stmt): 'Example::Widget::~Widget (D.nnnnn);' repr(stmt): 'gcc.GimpleCall()' type(stmt.fn): str(stmt.fn): '__base_dtor ' stmt.fn: stmt.fn.operand: gcc.FunctionDecl('__base_dtor ') stmt.fn.operand.fullname: 'Example::Widget::~Widget()' - str(stmt.args[0]): 'this' + str(stmt.args[0]): 'D.nnnnn' str(stmt.lhs): None block 3 gimple[0]: str(stmt): ':' - repr(stmt): 'gcc.GimpleLabel()' + repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(nnnn))' gimple[1]: str(stmt): 'D.nnnnn = 0 & 1;' repr(stmt): 'gcc.GimpleAssign()' @@ -334,7 +337,7 @@ block 3 gimple[0]: str(stmt): ':' - repr(stmt): 'gcc.GimpleLabel()' + repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(nnnn))' gimple[1]: str(stmt): 'operator delete (this);' repr(stmt): 'gcc.GimpleCall()' @@ -375,7 +378,7 @@ block 3 gimple[0]: str(stmt): ':' - repr(stmt): 'gcc.GimpleLabel()' + repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(nnnn))' gimple[1]: str(stmt): 'operator delete (this);' repr(stmt): 'gcc.GimpleCall()' tests/examples/find-global-state: OK tests/examples/hello-world: OK tests/examples/lto: OK tests/gccutils/graph: OK tests/gccutils/topological-sort: OK tests/plugin/array-type: FAIL returncode: 0 compiling: gcc -c -o tests/plugin/array-type/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/array-type/script.py -fsigned-char tests/plugin/array-type/input.c Stdout: Stderr: --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,3 +0,0 @@ -arr-range-min:0 -arr-range-max:36 -arr2-range:None tests/plugin/arrays: OK tests/plugin/attributes: OK tests/plugin/callback-FINISH_DECL: skipped: required feature GCC_PYTHON_PLUGIN_CONFIG_has_PLUGIN_FINISH_DECL not available in autogenerated-config.h tests/plugin/callbacks/PLUGIN_FINISH: OK tests/plugin/callbacks/args: OK tests/plugin/callbacks/exception: OK tests/plugin/callbacks/refs: OK tests/plugin/callgraph: OK tests/plugin/constants: OK tests/plugin/diagnostics: OK tests/plugin/dumpfiles: OK tests/plugin/expressions/get_symbol: FAIL returncode: 0 compiling: gcc -c -o tests/plugin/expressions/get_symbol/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/expressions/get_symbol/script.py -fsigned-char tests/plugin/expressions/get_symbol/input.c Stdout: ================================= ============ Class get_symbol() ================================= ============ :py:class:`gcc.AddrExpr` `&` :py:class:`gcc.BitAndExpr` `&` :py:class:`gcc.BitIorExpr` `|` :py:class:`gcc.BitNotExpr` `~` :py:class:`gcc.BitXorExpr` `^` :py:class:`gcc.CeilDivExpr` `/[cl]` :py:class:`gcc.CeilModExpr` `%[cl]` :py:class:`gcc.EqExpr` `==` :py:class:`gcc.ExactDivExpr` `/[ex]` :py:class:`gcc.FloorDivExpr` `/[fl]` :py:class:`gcc.FloorModExpr` `%[fl]` :py:class:`gcc.GeExpr` `>=` :py:class:`gcc.GtExpr` `>` :py:class:`gcc.IndirectRef` `*` :py:class:`gcc.LeExpr` `<=` :py:class:`gcc.LrotateExpr` `r<<` :py:class:`gcc.LshiftExpr` `<<` :py:class:`gcc.LtExpr` `<` :py:class:`gcc.LtgtExpr` `<>` :py:class:`gcc.MaxExpr` `max` :py:class:`gcc.MinExpr` `min` :py:class:`gcc.MinusExpr` `-` :py:class:`gcc.ModifyExpr` `=` :py:class:`gcc.MultExpr` `*` :py:class:`gcc.NeExpr` `!=` :py:class:`gcc.NegateExpr` `-` :py:class:`gcc.OrderedExpr` `ord` :py:class:`gcc.PlusExpr` `+` :py:class:`gcc.PointerPlusExpr` `+` :py:class:`gcc.PostdecrementExpr` `--` :py:class:`gcc.PostincrementExpr` `++` :py:class:`gcc.PredecrementExpr` `--` :py:class:`gcc.PreincrementExpr` `++` :py:class:`gcc.RdivExpr` `/` :py:class:`gcc.ReducPlusExpr` `r+` :py:class:`gcc.RoundDivExpr` `/[rd]` :py:class:`gcc.RoundModExpr` `%[rd]` :py:class:`gcc.RrotateExpr` `r>>` :py:class:`gcc.RshiftExpr` `>>` :py:class:`gcc.TruncDivExpr` `/` :py:class:`gcc.TruncModExpr` `%` :py:class:`gcc.TruthAndExpr` `&&` :py:class:`gcc.TruthAndifExpr` `&&` :py:class:`gcc.TruthNotExpr` `!` :py:class:`gcc.TruthOrExpr` `||` :py:class:`gcc.TruthOrifExpr` `||` :py:class:`gcc.TruthXorExpr` `^` :py:class:`gcc.UneqExpr` `u==` :py:class:`gcc.UngeExpr` `u>=` :py:class:`gcc.UngtExpr` `u>` :py:class:`gcc.UnleExpr` `u<=` :py:class:`gcc.UnltExpr` `u<` :py:class:`gcc.UnorderedExpr` `unord` :py:class:`gcc.VecLshiftExpr` `v<<` :py:class:`gcc.VecRshiftExpr` `v>>` :py:class:`gcc.WidenLshiftExpr` `w<<` :py:class:`gcc.WidenMultExpr` `w*` :py:class:`gcc.WidenSumExpr` `w+` ================================= ============ Stderr: --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -56,6 +56,7 @@ :py:class:`gcc.UnorderedExpr` `unord` :py:class:`gcc.VecLshiftExpr` `v<<` :py:class:`gcc.VecRshiftExpr` `v>>` + :py:class:`gcc.WidenLshiftExpr` `w<<` :py:class:`gcc.WidenMultExpr` `w*` :py:class:`gcc.WidenSumExpr` `w+` ================================= ============ tests/plugin/function-types: OK tests/plugin/functions: OK tests/plugin/gc/_force_garbage_collection: OK tests/plugin/gc/_gc_selftest: OK tests/plugin/gc/segfault-on-instance-of-pass-subclass: OK tests/plugin/gimple-asm: OK tests/plugin/gimple-cond/explicit-comparison: OK tests/plugin/gimple-cond/implicit-comparison: OK tests/plugin/gimple-walk-tree/dump-all: FAIL returncode: 0 compiling: gcc -c -o tests/plugin/gimple-walk-tree/dump-all/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/gimple-walk-tree/dump-all/script.py -fsigned-char tests/plugin/gimple-walk-tree/dump-all/input.c Stdout: fun: gcc.Function('main') stmt: D.2053 = (const char * restrict) &"argc: %i\n"[0]; node: (&"argc: %i\n"[0]) node: gcc.ArrayRef(array=gcc.StringCst('argc: %i\n'), index=gcc.IntegerCst(0)) ("argc: %i\n"[0]) node: gcc.StringCst('argc: %i\n') ("argc: %i\n") node: gcc.IntegerCst(0) (0) node: gcc.VarDecl(2053) (D.2053) stmt: printf (D.2053, argc); node: (printf) node: gcc.FunctionDecl('printf') (printf) node: gcc.VarDecl(2053) (D.2053) node: gcc.ParmDecl('argc') (argc) stmt: i = 0; node: gcc.IntegerCst(0) (0) node: gcc.VarDecl('i') (i) stmt: D.2054 = (long unsigned int) i; node: gcc.VarDecl('i') (i) node: gcc.VarDecl(2054) (D.2054) stmt: D.2055 = D.2054 * 8; node: gcc.VarDecl(2054) (D.2054) node: gcc.IntegerCst(8) (8) node: gcc.VarDecl(2055) (D.2055) stmt: D.2056 = argv + D.2055; node: gcc.ParmDecl('argv') (argv) node: gcc.VarDecl(2055) (D.2055) node: gcc.VarDecl(2056) (D.2056) stmt: D.2057 = *D.2056; node: (*D.2056) node: gcc.VarDecl(2056) (D.2056) node: gcc.IntegerCst(0) (0B) node: gcc.VarDecl(2057) (D.2057) stmt: D.2058 = (const char * restrict) &"argv[%i]: %s\n"[0]; node: (&"argv[%i]: %s\n"[0]) node: gcc.ArrayRef(array=gcc.StringCst('argv[%i]: %s\n'), index=gcc.IntegerCst(0)) ("argv[%i]: %s\n"[0]) node: gcc.StringCst('argv[%i]: %s\n') ("argv[%i]: %s\n") node: gcc.IntegerCst(0) (0) node: gcc.VarDecl(2058) (D.2058) stmt: printf (D.2058, i, D.2057); node: (printf) node: gcc.FunctionDecl('printf') (printf) node: gcc.VarDecl(2058) (D.2058) node: gcc.VarDecl('i') (i) node: gcc.VarDecl(2057) (D.2057) stmt: i = i + 1; node: gcc.VarDecl('i') (i) node: gcc.IntegerCst(1) (1) node: gcc.VarDecl('i') (i) stmt: if (i < argc) node: gcc.VarDecl('i') (i) node: gcc.ParmDecl('argc') (argc) stmt: helper_function (); node: (helper_function) node: gcc.FunctionDecl('helper_function') (helper_function) stmt: D.2059 = 0; node: gcc.IntegerCst(0) (0) node: gcc.VarDecl(2059) (D.2059) stmt: return D.2059; node: gcc.VarDecl(2059) (D.2059) fun: gcc.Function('helper_function') stmt: __builtin_puts (&"I am a helper function"[0]); node: (__builtin_puts) node: gcc.FunctionDecl('__builtin_puts') (__builtin_puts) node: (&"I am a helper function"[0]) node: gcc.ArrayRef(array=gcc.StringCst('I am a helper function'), index=gcc.IntegerCst(0)) ("I am a helper function"[0]) node: gcc.StringCst('I am a helper function') ("I am a helper function") node: gcc.IntegerCst(0) (0) stmt: D.2061 = 42; node: gcc.IntegerCst(42) (42) node: gcc.VarDecl(2061) (D.2061) stmt: return D.2061; node: gcc.VarDecl(2061) (D.2061) Stderr: --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -1,7 +1,7 @@ fun: gcc.Function('main') stmt: D.nnnnn = (const char * restrict) &"argc: %i\n"[0]; node: (&"argc: %i\n"[0]) - node: ("argc: %i\n"[0]) + node: gcc.ArrayRef(array=gcc.StringCst('argc: %i\n'), index=gcc.IntegerCst(0)) ("argc: %i\n"[0]) node: gcc.StringCst('argc: %i\n') ("argc: %i\n") node: gcc.IntegerCst(0) (0) node: gcc.VarDecl(nnnn) (D.nnnnn) @@ -31,7 +31,7 @@ node: gcc.VarDecl(nnnn) (D.nnnnn) stmt: D.nnnnn = (const char * restrict) &"argv[%i]: %s\n"[0]; node: (&"argv[%i]: %s\n"[0]) - node: ("argv[%i]: %s\n"[0]) + node: gcc.ArrayRef(array=gcc.StringCst('argv[%i]: %s\n'), index=gcc.IntegerCst(0)) ("argv[%i]: %s\n"[0]) node: gcc.StringCst('argv[%i]: %s\n') ("argv[%i]: %s\n") node: gcc.IntegerCst(0) (0) node: gcc.VarDecl(nnnn) (D.nnnnn) @@ -61,7 +61,7 @@ node: (__builtin_puts) node: gcc.FunctionDecl('__builtin_puts') (__builtin_puts) node: (&"I am a helper function"[0]) - node: ("I am a helper function"[0]) + node: gcc.ArrayRef(array=gcc.StringCst('I am a helper function'), index=gcc.IntegerCst(0)) ("I am a helper function"[0]) node: gcc.StringCst('I am a helper function') ("I am a helper function") node: gcc.IntegerCst(0) (0) stmt: D.nnnnn = 42; tests/plugin/gimple-walk-tree/exceptions: OK tests/plugin/gimple-walk-tree/find-one: OK tests/plugin/identifiers: OK tests/plugin/initializers: OK tests/plugin/language-specific-errors/fullname: OK tests/plugin/macros/correct: OK tests/plugin/macros/too-early: OK tests/plugin/namespace: OK tests/plugin/new-passes: OK tests/plugin/options: OK tests/plugin/parameters: OK tests/plugin/rtl: OK tests/plugin/switch: FAIL returncode: 0 compiling: gcc -c -o tests/plugin/switch/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/switch/script.py -fsigned-char tests/plugin/switch/input.c Stdout: fn: gcc.Function('test_switch') fn.decl.name: 'test_switch' gimple[0]: str(stmt): 'switch (i) , case 1 ... 2: , case 4: , case 8: >' repr(stmt): 'gcc.GimpleSwitch()' stmt.indexvar: gcc.ParmDecl('i') stmt.labels: [gcc.CaseLabelExpr(low=None, high=None, target=gcc.LabelDecl(1591)), gcc.CaseLabelExpr(low=gcc.IntegerCst(1), high=gcc.IntegerCst(2), target=gcc.LabelDecl(1587)), gcc.CaseLabelExpr(low=gcc.IntegerCst(4), high=None, target=gcc.LabelDecl(1587)), gcc.CaseLabelExpr(low=gcc.IntegerCst(8), high=None, target=gcc.LabelDecl(1587))] label[0].low: None label[0].high: None label[0].target: gcc.LabelDecl(1591) label[1].low: gcc.IntegerCst(1) label[1].high: gcc.IntegerCst(2) label[1].target: gcc.LabelDecl(1587) label[2].low: gcc.IntegerCst(4) label[2].high: None label[2].target: gcc.LabelDecl(1587) label[3].low: gcc.IntegerCst(8) label[3].high: None label[3].target: gcc.LabelDecl(1587) gimple[0]: str(stmt): ':' repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(1587))' gimple[1]: str(stmt): 'D.1593 = 1;' repr(stmt): 'gcc.GimpleAssign()' gimple[0]: str(stmt): ':' repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(1591))' gimple[1]: str(stmt): 'D.1593 = 0;' repr(stmt): 'gcc.GimpleAssign()' gimple[0]: str(stmt): 'return D.1593;' repr(stmt): 'gcc.GimpleReturn()' Stderr: --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -4,7 +4,7 @@ str(stmt): 'switch (i) , case 1 ... 2: , case 4: , case 8: >' repr(stmt): 'gcc.GimpleSwitch()' stmt.indexvar: gcc.ParmDecl('i') - stmt.labels: [, , , ] + stmt.labels: [gcc.CaseLabelExpr(low=None, high=None, target=gcc.LabelDecl(nnnn)), gcc.CaseLabelExpr(low=gcc.IntegerCst(1), high=gcc.IntegerCst(2), target=gcc.LabelDecl(nnnn)), gcc.CaseLabelExpr(low=gcc.IntegerCst(4), high=None, target=gcc.LabelDecl(nnnn)), gcc.CaseLabelExpr(low=gcc.IntegerCst(8), high=None, target=gcc.LabelDecl(nnnn))] label[0].low: None label[0].high: None label[0].target: gcc.LabelDecl(nnnn) @@ -19,13 +19,13 @@ label[3].target: gcc.LabelDecl(nnnn) gimple[0]: str(stmt): ':' - repr(stmt): 'gcc.GimpleLabel()' + repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(nnnn))' gimple[1]: str(stmt): 'D.nnnnn = 1;' repr(stmt): 'gcc.GimpleAssign()' gimple[0]: str(stmt): ':' - repr(stmt): 'gcc.GimpleLabel()' + repr(stmt): 'gcc.GimpleLabel(label=gcc.LabelDecl(nnnn))' gimple[1]: str(stmt): 'D.nnnnn = 0;' repr(stmt): 'gcc.GimpleAssign()' tests/plugin/syntax-error: OK tests/plugin/sys: OK tests/plugin/translation-units: FAIL returncode: 0 compiling: gcc -c -o tests/plugin/translation-units/output.o -fplugin=/home/erics/gcc-python-plugin/python.so -fplugin-arg-python-script=tests/plugin/translation-units/script.py -fsigned-char tests/plugin/translation-units/input.c Stdout: len(gcc.get_translation_units()): 1 type(u): u.language: 'GNU C' type(u.block): v.name: 'test_typedef' type(v): gcc.TypeDecl('test_typedef') td: gcc.TypeDecl('test_typedef') td.name: 'test_typedef' type(td.type): Stderr: --- Expected stdout (after cleaning) +++ Actual stdout (after cleaning) @@ -4,8 +4,6 @@ type(u.block): v.name: 'test_typedef' type(v): gcc.TypeDecl('test_typedef') -v.name: 'test_var' -type(v): gcc.VarDecl('test_var') td: gcc.TypeDecl('test_typedef') td.name: 'test_typedef' type(td.type): tests/plugin/type-attributes: OK tests/plugin/types: OK tests/plugin/version: OK 194 successes; 137 failures; 1 skipped Failed tests: tests/cpychecker/refcounts/GIL/correct tests/cpychecker/refcounts/PyArg_Parse/correct_simple tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O tests/cpychecker/refcounts/PyArg_ParseTuple/correct_O_bang tests/cpychecker/refcounts/PyArg_ParseTuple/correct_converter tests/cpychecker/refcounts/PyArg_ParseTuple/correct_simple tests/cpychecker/refcounts/PyArg_ParseTupleAndKeywords/correct_O tests/cpychecker/refcounts/PyArg_UnpackTuple/correct tests/cpychecker/refcounts/PyArg_UnpackTuple/missing-initialization tests/cpychecker/refcounts/PyCObject_FromVoidPtr/incorrect tests/cpychecker/refcounts/PyCObject_FromVoidPtrAndDesc/incorrect tests/cpychecker/refcounts/PyCapsule_GetPointer/basic tests/cpychecker/refcounts/PyDict_New/correct tests/cpychecker/refcounts/PyDict_SetItem/correct tests/cpychecker/refcounts/PyDict_SetItem/incorrect tests/cpychecker/refcounts/PyDict_SetItemString/correct tests/cpychecker/refcounts/PyDict_SetItemString/incorrect tests/cpychecker/refcounts/PyDict_Size/simple tests/cpychecker/refcounts/PyErr_NewException/basic tests/cpychecker/refcounts/PyErr_NoMemory/correct tests/cpychecker/refcounts/PyEval_CallMethod/correct tests/cpychecker/refcounts/PyEval_CallMethod/incorrect tests/cpychecker/refcounts/PyFloat_AsDouble/correct_PyFloatObject tests/cpychecker/refcounts/PyFloat_AsDouble/correct_cast tests/cpychecker/refcounts/PyFloat_FromDouble/simple tests/cpychecker/refcounts/PyInt_AsLong/correct_PyIntObject tests/cpychecker/refcounts/PyInt_AsLong/correct_cast tests/cpychecker/refcounts/PyInt_FromLong/correct_large_int tests/cpychecker/refcounts/PyInt_FromLong/correct_small_int tests/cpychecker/refcounts/PyIter_Next/simple tests/cpychecker/refcounts/PyList_Append/correct tests/cpychecker/refcounts/PyList_Append/incorrect tests/cpychecker/refcounts/PyList_Append/incorrect-loop tests/cpychecker/refcounts/PyList_Append/null-newitem tests/cpychecker/refcounts/PyList_Append/ticket-19 tests/cpychecker/refcounts/PyList_Append/ticket-22 tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct tests/cpychecker/refcounts/PyList_SET_ITEM_macro/correct_multiple tests/cpychecker/refcounts/PyList_SET_ITEM_macro/incorrect_multiple tests/cpychecker/refcounts/PyList_Size/known-size tests/cpychecker/refcounts/PyMapping_Size/basic tests/cpychecker/refcounts/PyMem_Malloc/correct/alloc-and-free tests/cpychecker/refcounts/PyModule_AddObject/incorrect-with-cast tests/cpychecker/refcounts/PyObject_CallFunction/correct tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/correct tests/cpychecker/refcounts/PyObject_CallFunctionObjArgs/incorrect tests/cpychecker/refcounts/PyObject_CallMethod/correct tests/cpychecker/refcounts/PyObject_CallMethod/correct-code-N tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/correct tests/cpychecker/refcounts/PyObject_CallMethodObjArgs/incorrect tests/cpychecker/refcounts/PyObject_CallObject/correct tests/cpychecker/refcounts/PyObject_GenericGetAttr/basic tests/cpychecker/refcounts/PyObject_GenericSetAttr/basic tests/cpychecker/refcounts/PyObject_GetAttr/correct tests/cpychecker/refcounts/PyObject_GetAttrString/correct tests/cpychecker/refcounts/PyObject_GetItem/correct tests/cpychecker/refcounts/PyObject_GetItem/incorrect tests/cpychecker/refcounts/PyObject_IsTrue/correct tests/cpychecker/refcounts/PyObject_SetAttrString/ignored-lhs tests/cpychecker/refcounts/PySequence_SetItem/correct tests/cpychecker/refcounts/PySequence_SetItem/incorrect tests/cpychecker/refcounts/PySequence_Size/correct tests/cpychecker/refcounts/PySequence_Size/null tests/cpychecker/refcounts/PyString_AsString/correct tests/cpychecker/refcounts/PyString_AsString/incorrect tests/cpychecker/refcounts/PyString_AsString/unknown tests/cpychecker/refcounts/PyString_Concat/basic tests/cpychecker/refcounts/PyString_Concat/leak-of-rhs tests/cpychecker/refcounts/PyString_ConcatAndDel/basic tests/cpychecker/refcounts/PyString_ConcatAndDel/correct tests/cpychecker/refcounts/PyString_FromStringAndSize/correct tests/cpychecker/refcounts/PyString_Size/correct tests/cpychecker/refcounts/PyStructSequence/correct tests/cpychecker/refcounts/PySys_SetObject/correct tests/cpychecker/refcounts/PyTuple_New/correct tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/correct_multiple tests/cpychecker/refcounts/PyTuple_SET_ITEM_macro/incorrect_multiple tests/cpychecker/refcounts/PyTuple_SetItem/correct tests/cpychecker/refcounts/PyTuple_SetItem/correct_multiple tests/cpychecker/refcounts/PyTuple_SetItem/incorrect_multiple tests/cpychecker/refcounts/PyTuple_Size/incorrect tests/cpychecker/refcounts/PyTuple_Size/ticket-24 tests/cpychecker/refcounts/PyUnicode_AsUTF8String/basic tests/cpychecker/refcounts/PyWeakref_GetObject/NULL tests/cpychecker/refcounts/PyWeakref_GetObject/correct tests/cpychecker/refcounts/PyWeakref_GetObject/incorrect tests/cpychecker/refcounts/Py_BuildValue/Py_TYPE tests/cpychecker/refcounts/Py_BuildValue/correct tests/cpychecker/refcounts/Py_BuildValue/correct-code-N tests/cpychecker/refcounts/Py_BuildValue/correct-code-O tests/cpychecker/refcounts/Py_BuildValue/correct-code-s tests/cpychecker/refcounts/SWIG_Python_ErrorType/correct tests/cpychecker/refcounts/_PyObject_New/correct tests/cpychecker/refcounts/__builtin_expect tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-marking tests/cpychecker/refcounts/attributes/returns-borrowed-ref/incorrect-usage tests/cpychecker/refcounts/attributes/sets-exception-on-nonzero-return/correct-usage tests/cpychecker/refcounts/attributes/sets-exception/correct-usage tests/cpychecker/refcounts/attributes/steals-reference-to-arg/correct-usage tests/cpychecker/refcounts/attributes/steals-reference-to-arg/incorrect-usage tests/cpychecker/refcounts/combinatorial-explosion tests/cpychecker/refcounts/combinatorial-explosion-with-error tests/cpychecker/refcounts/correct_decref tests/cpychecker/refcounts/correct_object_ctor tests/cpychecker/refcounts/fold_conditional tests/cpychecker/refcounts/function-that-exits tests/cpychecker/refcounts/getter tests/cpychecker/refcounts/handle_null_error tests/cpychecker/refcounts/loop_n_times tests/cpychecker/refcounts/loops/complex-loop-conditional-1 tests/cpychecker/refcounts/loops/complex-loop-conditional-2 tests/cpychecker/refcounts/macros/Py_XDECREF/crash tests/cpychecker/refcounts/missing_decref tests/cpychecker/refcounts/module_handling tests/cpychecker/refcounts/object_from_callback tests/cpychecker/refcounts/object_leak tests/cpychecker/refcounts/passing_dead_object tests/cpychecker/refcounts/returning_dead_object tests/cpychecker/refcounts/storage_regions/static/correct tests/cpychecker/refcounts/storage_regions/static/incorrect tests/cpychecker/refcounts/subclass/handling tests/cpychecker/refcounts/too_many_increfs tests/cpychecker/refcounts/uninitialized_data/comparison tests/cpychecker/refcounts/uninitialized_data/function_arg tests/cpychecker/refcounts/unrecognized_function tests/cpychecker/refcounts/unrecognized_function2 tests/cpychecker/refcounts/unrecognized_function3 tests/cpychecker/refcounts/unrecognized_function4 tests/cpychecker/refcounts/use_after_dealloc tests/examples/cplusplus/classes tests/plugin/array-type tests/plugin/expressions/get_symbol tests/plugin/gimple-walk-tree/dump-all tests/plugin/switch tests/plugin/translation-units make: *** [test-suite] Error 1