commit 335570e7f43ed016f366dcb93a9c8a40580c67d2 Author: David Malcolm dmalcolm@redhat.com Date: Thu Sep 1 16:33:37 2011 -0400
cpychecker: detect various NULL pointer arguments to API calls that will crash with them
libcpychecker/absinterp.py | 55 ++- libcpychecker/refcounts.py | 8 +- .../refcounts/PyDict_SetItem/correct/input.c | 78 ++ .../refcounts/PyDict_SetItem/correct/script.py | 22 + .../refcounts/PyDict_SetItem/correct/stdout.txt | 816 ++++++++++++++++++++ .../refcounts/PyDict_SetItem/incorrect/input.c | 76 ++ .../refcounts/PyDict_SetItem/incorrect/script.py | 22 + .../refcounts/PyDict_SetItem/incorrect/stderr.txt | 20 + .../refcounts/PyDict_SetItem/incorrect/stdout.txt | 651 ++++++++++++++++ 9 files changed, 1741 insertions(+), 7 deletions(-) --- diff --git a/libcpychecker/absinterp.py b/libcpychecker/absinterp.py index 9607997..0c3eef6 100644 --- a/libcpychecker/absinterp.py +++ b/libcpychecker/absinterp.py @@ -151,16 +151,23 @@ class InvalidlyNullParameter(PredictedError): % (self.fnname, self.paramidx, self.nullvalue))
-class NullPtrDereference(PredictedError): - def __init__(self, state, expr, ptr, isdefinite): +class PredictedValueError(PredictedError): + def __init__(self, state, expr, value, isdefinite): check_isinstance(state, State) - check_isinstance(expr, (gcc.ComponentRef, gcc.MemRef)) - check_isinstance(ptr, AbstractValue) + check_isinstance(expr, gcc.Tree) + check_isinstance(value, AbstractValue) self.state = state self.expr = expr - self.ptr = ptr + self.value = value self.isdefinite = isdefinite
+class NullPtrDereference(PredictedValueError): + def __init__(self, state, expr, ptr, isdefinite): + check_isinstance(state, State) + check_isinstance(expr, gcc.Tree) + check_isinstance(expr, (gcc.ComponentRef, gcc.MemRef)) + PredictedValueError.__init__(self, state, expr, ptr, isdefinite) + def __str__(self): if self.isdefinite: return ('dereferencing NULL (%s) at %s' @@ -169,6 +176,28 @@ class NullPtrDereference(PredictedError): return ('possibly dereferencing NULL (%s) at %s' % (self.expr, self.state.loc.get_stmt().loc))
+class NullPtrArgument(PredictedValueError): + def __init__(self, state, stmt, idx, ptr, isdefinite): + check_isinstance(state, State) + check_isinstance(stmt, gcc.Gimple) + check_isinstance(idx, int) + check_isinstance(ptr, AbstractValue) + PredictedValueError.__init__(self, state, stmt.args[idx], ptr, isdefinite) + self.stmt = stmt + self.idx = idx + + def __str__(self): + if self.isdefinite: + return ('calling %s with NULL (%s) as argument %i at %s' + % (self.stmt.fn, self.expr, + self.idx, self.state.loc.get_stmt().loc)) + else: + return ('possibly calling %s with NULL (%s) as argument %i at %s' + % (self.stmt.fn, self.expr, + self.idx, self.state.loc.get_stmt().loc)) + + + class ReadFromDeallocatedMemory(PredictedError): def __init__(self, stmt, value): check_isinstance(stmt, gcc.Gimple) @@ -801,6 +830,8 @@ class State: return fun.end
def raise_any_null_ptr_deref(self, expr, ptr): + check_isinstance(expr, gcc.Tree) + check_isinstance(ptr, AbstractValue) if isinstance(ptr, ConcreteValue): if ptr.is_null_ptr(): # Read through NULL @@ -811,6 +842,20 @@ class State: isdefinite = not hasattr(ptr, 'fromsplit') raise NullPtrDereference(self, expr, ptr, isdefinite)
+ def raise_any_null_ptr_func_arg(self, stmt, idx, ptr): + check_isinstance(stmt, gcc.Gimple) + check_isinstance(idx, int) + check_isinstance(ptr, AbstractValue) + if isinstance(ptr, ConcreteValue): + if ptr.is_null_ptr(): + # NULL argument to a function that requires non-NULL + # If we earlier split the analysis into NULL/non-NULL + # cases, then we're only considering the possibility + # that this pointer was NULL; we don't know for sure + # that it was. + isdefinite = not hasattr(ptr, 'fromsplit') + raise NullPtrArgument(self, stmt, idx, ptr, isdefinite) + def raise_split_value(self, ptr_rvalue, loc=None): """ Raise a SplitValue exception on the given rvalue, so that we can diff --git a/libcpychecker/refcounts.py b/libcpychecker/refcounts.py index 00d2cba..bae6220 100644 --- a/libcpychecker/refcounts.py +++ b/libcpychecker/refcounts.py @@ -296,8 +296,7 @@ class MyState(State):
fn is a function taking a RefcountValue instance, returning another one """ - assert isinstance(pyobjectptr, AbstractValue) - assert isinstance(pyobjectptr, PointerToRegion) + check_isinstance(pyobjectptr, PointerToRegion) ob_refcnt = self.make_field_region(pyobjectptr.region, 'ob_refcnt') assert isinstance(ob_refcnt, Region) oldvalue = self.get_store(ob_refcnt, None, loc) # FIXME: gcctype @@ -629,6 +628,9 @@ class MyState(State): # Otherwise returns 0, and adds a ref on the value v_dp, v_key, v_item = self.eval_stmt_args(stmt)
+ self.raise_any_null_ptr_func_arg(stmt, 1, v_key) + self.raise_any_null_ptr_func_arg(stmt, 2, v_item) + s_success = self.mkstate_concrete_return_of(stmt, 0) # the dictionary now owns a new ref on "item". We won't model the # insides of the dictionary type. Instead, treat it as a new @@ -653,6 +655,8 @@ class MyState(State):
# This is implemented in terms of PyDict_SetItem and shows the same # success and failures: + self.raise_any_null_ptr_func_arg(stmt, 1, v_key) + self.raise_any_null_ptr_func_arg(stmt, 2, v_item) return self.impl_PyDict_SetItem(stmt)
######################################################################## diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c b/tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c new file mode 100644 index 0000000..5944be5 --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c @@ -0,0 +1,78 @@ +/* + Copyright 2011 David Malcolm dmalcolm@redhat.com + Copyright 2011 Red Hat, Inc. + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + http://www.gnu.org/licenses/. +*/ + +#include <Python.h> + +/* + Test of correct reference-handling in a call to PyDict_SetItem +*/ + +PyObject * +test(PyObject *self, PyObject *args) +{ + PyObject *dict = NULL; + PyObject *key = NULL; + PyObject *value = NULL; + + dict = PyDict_New(); + if (!dict) { + goto error; + } + + key = PyLong_FromLong(500); + if (!key) { + goto error; + } + + value = PyLong_FromLong(1000); + if (!value) { + goto error; + } + + if (-1 == PyDict_SetItem(dict, key, value)) { + goto error; + } + /* + The successful call added refs on both "key" and "value", owned by the + dictionary. + We must now drop our references on them: + */ + Py_DECREF(key); + Py_DECREF(value); + + return dict; + + error: + Py_XDECREF(dict); + Py_XDECREF(key); + Py_XDECREF(value); + return NULL; +} +static PyMethodDef test_methods[] = { + {"test_method", test, METH_VARARGS, NULL}, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +/* + PEP-7 +Local variables: +c-basic-offset: 4 +indent-tabs-mode: nil +End: +*/ diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/correct/script.py b/tests/cpychecker/refcounts/PyDict_SetItem/correct/script.py new file mode 100644 index 0000000..fdd5ba3 --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/correct/script.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2011 David Malcolm dmalcolm@redhat.com +# Copyright 2011 Red Hat, Inc. +# +# This is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# http://www.gnu.org/licenses/. + +from libcpychecker import main +main(verify_refcounting=True, + dump_traces=True, + show_traces=False) diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt b/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt new file mode 100644 index 0000000..adcd64e --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/correct/stdout.txt @@ -0,0 +1,816 @@ +Trace 0: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() succeeds' + 'taking False path' + '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('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() succeeds' + 'taking False path' + 'taking True path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43' + 'returning' + Return value: + repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: None + r->ob_type: None + Exception: + (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28 + +Trace 2: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() succeeds' + 'taking False path' + '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('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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 3: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() succeeds' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:43' + 'returning' + Return value: + repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33), region=RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: None + r->ob_type: None + Exception: + (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:28 + +Trace 4: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 5: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 6: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 7: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 8: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' + 'taking False path' + 'taking True path' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 9: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' + 'taking False path' + 'taking True path' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 10: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 11: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:38' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 12: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 13: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 14: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 15: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 16: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'taking True path' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Exception: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 17: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c', line=33)) + str(): new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/correct/input.c:33 + r->ob_refcnt: None + r->ob_type: None + Exception: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 18: + Transitions: + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c new file mode 100644 index 0000000..c579297 --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c @@ -0,0 +1,76 @@ +/* + Copyright 2011 David Malcolm dmalcolm@redhat.com + Copyright 2011 Red Hat, Inc. + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + http://www.gnu.org/licenses/. +*/ + +#include <Python.h> + +/* + Test of incorrect call to PyDict_SetItem +*/ + +PyObject * +test(PyObject *self, PyObject *args) +{ + PyObject *dict = NULL; + PyObject *key = NULL; + PyObject *value = NULL; + + dict = PyDict_New(); + if (!dict) { + goto error; + } + + key = PyLong_FromLong(500); + value = PyLong_FromLong(1000); + + /* + This code doesn't check that key or value are non-NULL + PyDict_SetItem will assert/segfault with NULL key/values: + */ + if (-1 == PyDict_SetItem(dict, key, value)) { + goto error; + } + /* + The successful call added refs on both "key" and "value", owned by the + dictionary. + + We must now drop our references on them: + */ + Py_DECREF(key); + Py_DECREF(value); + + return dict; + + error: + Py_XDECREF(dict); + Py_XDECREF(key); + Py_XDECREF(value); + return NULL; +} +static PyMethodDef test_methods[] = { + {"test_method", test, METH_VARARGS, NULL}, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +/* + PEP-7 +Local variables: +c-basic-offset: 4 +indent-tabs-mode: nil +End: +*/ diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/script.py b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/script.py new file mode 100644 index 0000000..fdd5ba3 --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/script.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2011 David Malcolm dmalcolm@redhat.com +# Copyright 2011 Red Hat, Inc. +# +# This is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# http://www.gnu.org/licenses/. + +from libcpychecker import main +main(verify_refcounting=True, + dump_traces=True, + show_traces=False) diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stderr.txt b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stderr.txt new file mode 100644 index 0000000..89675e0 --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stderr.txt @@ -0,0 +1,20 @@ +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c: In function 'test': +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:29: error: calling PyDict_SetItem with NULL (gcc.VarDecl('value')) as argument 2 at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:10: note: when PyDict_New() succeeds at: dict = PyDict_New(); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:34:8: note: when taking False path at: if (!dict) { +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:9: note: reaching: key = PyLong_FromLong(500); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:9: note: when PyLong_FromLong() succeeds at: key = PyLong_FromLong(500); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:11: note: when PyLong_FromLong() fails at: value = PyLong_FromLong(1000); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:29: error: calling PyDict_SetItem with NULL (gcc.VarDecl('key')) as argument 1 at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:10: note: when PyDict_New() succeeds at: dict = PyDict_New(); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:34:8: note: when taking False path at: if (!dict) { +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:9: note: reaching: key = PyLong_FromLong(500); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:9: note: when PyLong_FromLong() fails at: key = PyLong_FromLong(500); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:11: note: when PyLong_FromLong() succeeds at: value = PyLong_FromLong(1000); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45:29: error: calling PyDict_SetItem with NULL (gcc.VarDecl('key')) as argument 1 at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33:10: note: when PyDict_New() succeeds at: dict = PyDict_New(); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:34:8: note: when taking False path at: if (!dict) { +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:9: note: reaching: key = PyLong_FromLong(500); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38:9: note: when PyLong_FromLong() fails at: key = PyLong_FromLong(500); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39:11: note: when PyLong_FromLong() fails at: value = PyLong_FromLong(1000); +tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28:1: note: graphical error report for function 'test' written out to 'tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c.test-refcount-errors.html' diff --git a/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt new file mode 100644 index 0000000..1afc25a --- /dev/null +++ b/tests/cpychecker/refcounts/PyDict_SetItem/incorrect/stdout.txt @@ -0,0 +1,651 @@ +Trace 0: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() succeeds' + 'taking False path' + '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('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() succeeds' + 'taking False path' + 'taking True path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39' + 'returning' + Return value: + repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: None + r->ob_type: None + Exception: + (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28 + +Trace 2: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() succeeds' + 'taking False path' + '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('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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 3: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() succeeds' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:39' + 'returning' + Return value: + repr(): PointerToRegion(gcctype='struct PyObject *', loc=gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33), region=RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33))) + str(): (struct PyObject *)&RegionOnHeap('new ref from (unknown) PyDict_New', 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: None + r->ob_type: None + Exception: + (struct PyObject *)0 from tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:28 + +Trace 4: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 5: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 6: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 7: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 8: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' + 'taking False path' + 'taking True path' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 9: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' + 'taking False path' + 'taking True path' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 10: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' + 'taking False 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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 11: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() succeeds' + 'PyDict_SetItem() fails' + 'taking True path' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33' + 'taking False path' + 'taking False path' + 'calling tp_dealloc on PyLongObject allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:38' + 'taking False path' + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 12: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() succeeds' + 'PyLong_FromLong() fails' + error: NullPtrArgument() + error: calling PyDict_SetItem with NULL (gcc.VarDecl('value')) as argument 2 at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 13: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'PyLong_FromLong() succeeds' + error: NullPtrArgument() + error: calling PyDict_SetItem with NULL (gcc.VarDecl('key')) as argument 1 at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 14: + Transitions: + 'PyDict_New() succeeds' + 'taking False path' + 'PyLong_FromLong() fails' + 'PyLong_FromLong() fails' + error: NullPtrArgument() + error: calling PyDict_SetItem with NULL (gcc.VarDecl('key')) as argument 1 at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:45 + Region("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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')")) + new ref from (unknown) PyDict_New allocated at tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c:33: + repr(): RegionOnHeap('new ref from (unknown) PyDict_New', gcc.Location(file='tests/cpychecker/refcounts/PyDict_SetItem/incorrect/input.c', line=33)) + str(): new ref from (unknown) PyDict_New 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=Region('PyTypeObject for new ref from (unknown) PyDict_New')) + Exception: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError')) + +Trace 15: + Transitions: + '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("region-for-arg-gcc.ParmDecl('self')"): + repr(): Region("region-for-arg-gcc.ParmDecl('self')") + str(): Region("region-for-arg-gcc.ParmDecl('self')") + 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("region-for-arg-gcc.ParmDecl('args')"): + repr(): Region("region-for-arg-gcc.ParmDecl('args')") + str(): Region("region-for-arg-gcc.ParmDecl('args')") + 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: + RegionForGlobal(gcc.VarDecl('PyExc_MemoryError'))
gcc-python-plugin-commits@lists.stg.fedorahosted.org